runDiff {systemPipeR} | R Documentation

## Differential abundance analysis for many range sets

### Description

Convenience wrapper function for `run_edgeR` and `run_DESeq2` to perform differential expression or abundance analysis iteratively for several count tables. The latter can be peak calling results for several samples or counts generated for different genomic feature types. The function also returns the filtering results and plots from `filterDEGs`.

### Usage

    runDiff(args, diffFct, targets, cmp, dbrfilter, ...)

### Arguments

`args` | Object of class `SYSargs` where `infile1(args)` specifies the paths to the tabular read count data files and `outpaths(args)` to the result files.
`diffFct` | Defines which function should be used for the differential abundance analysis. Can be `diffFct=run_edgeR` or `diffFct=run_DESeq2`.
`targets` | targets `data.frame`
`cmp` | `character matrix` where comparisons are defined in two columns. This matrix should be generated with `readComp()` from the targets file. Values used for comparisons need to match those in the `Factor` column of the targets file.
`dbrfilter` | Named vector with filter cutoffs of format `c(Fold=2, FDR=1)` where `Fold` refers to the fold change cutoff (unlogged) and `FDR` to the p-value cutoff. Those values are passed on to the `filterDEGs` function.
`...` | Arguments to be passed on to the internally used `run_edgeR` or `run_DESeq2` function.

### Value

Returns `list` containing the `filterDEGs` results for each count table. Each result set is a `list` with four components which are described under `?filterDEGs`. The result files contain the `edgeR` or `DESeq2` results from the comparisons specified under `cmp`. The base names of the result files are the same as the corresponding input files specified under `countfiles` and the value of `extension` appended.

### Author(s)

Thomas Girke

### See Also

`run_edgeR`, `run_DESeq2`, `filterDEGs`

### Examples

    ## Paths to BAM files
    param <- system.file("extdata", "bowtieSE.param", package="systemPipeR")
    targets <- system.file("extdata", "targets.txt", package="systemPipeR")
    args_bam <- systemArgs(sysma=param, mytargets=targets)
    bfl <- BamFileList(outpaths(args_bam), yieldSize=50000, index=character())

    ## Not run:
    ## SYSargs with paths to range data and count files
    args <- systemArgs(sysma="param/count_rangesets.param", mytargets="targets_macs.txt")

    ## Iterative read counting
    countDFnames <- countRangeset(bfl, args, mode="Union", ignore.strand=TRUE)
    writeTargetsout(x=args, file="targets_countDF.txt", overwrite=TRUE)

    ## Run differential abundance analysis
    cmp <- readComp(file=args_bam, format="matrix")
    args_diff <- systemArgs(sysma="param/rundiff.param", mytargets="targets_countDF.txt")
    dbrlist <- runDiff(args, diffFct=run_edgeR, targets=targetsin(args_bam), cmp=cmp[[1]], independent=TRUE, dbrfilter=c(Fold=2, FDR=1))
    writeTargetsout(x=args_diff, file="targets_rundiff.txt", overwrite=TRUE)

    ## End(Not run)

[Package systemPipeR version 1.18.2 Index]