Convenience wrapper function to identify differentially expressed genes (DEGs) in batch mode with the edgeR GML method for any number of pairwise sample comparisons specified under the cmp argument. Users are strongly encouraged to consult the edgeR vignette for more detailed information on this topic and how to properly run edgeR on data sets with more complex experimental designs.

run_edgeR(countDF, targets, cmp, independent = TRUE, paired = NULL, mdsplot = "")



date.frame containing raw read counts


targets data.frame


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.


If independent=TRUE then the countDF will be subsetted for each comparison. This behavior can be useful when working with samples from unrelated studies. For samples from the same or comparable studies, the setting independent=FALSE is usually preferred.


Defines pairs (character vector) for paired analysis. Default is unpaired (paired=NULL).


Directory where plotMDS should be written to. Default setting mdsplot="" will omit the plotting step.


data.frame containing edgeR results from all comparisons. Comparison labels are appended to column titles for tracking.


Please properly cite the edgeR papers when using this function:


Thomas Girke

See also

run_DESeq2, readComp and edgeR vignette


targetspath <- system.file("extdata", "targets.txt", package="systemPipeR")
targets <- read.delim(targetspath, comment.char = "#")
cmp <- readComp(file=targetspath, format="matrix", delim="-")
countfile <- system.file("extdata", "countDFeByg.xls", package="systemPipeR")
countDF <- read.delim(countfile, row.names=1)
edgeDF <- run_edgeR(countDF=countDF, targets=targets, cmp=cmp[[1]], independent=FALSE, mdsplot="")
#> Disp = 0.20653 , BCV = 0.4545 
pval <- edgeDF[, grep("_FDR$", colnames(edgeDF)), drop=FALSE]
fold <- edgeDF[, grep("_logFC$", colnames(edgeDF)), drop=FALSE]
DEG_list <- filterDEGs(degDF=edgeDF, filter=c(Fold=2, FDR=10))

#> [1] "UporDown" "Up"       "Down"     "Summary" 
#>         Comparisons Counts_Up_or_Down Counts_Up Counts_Down
#> M1-A1         M1-A1                 0         0           0
#> M1-V1         M1-V1                 1         1           0
#> A1-V1         A1-V1                 1         1           0
#> M6-A6         M6-A6                 0         0           0
#> M6-V6         M6-V6                 1         0           1
#> A6-V6         A6-V6                 2         1           1
#> M12-A12     M12-A12                 4         2           2
#> M12-V12     M12-V12                 2         0           2
#> A12-V12     A12-V12                 1         0           1