DEGSet.RdS4 class to store data from differentially expression analysis. It should be compatible with different package and stores the information in a way the methods will work with all of them.
DEGSet(resList, default) DEGSet(resList, default) as.DEGSet(object, ...) # S4 method for TopTags as.DEGSet(object, default = "raw", extras = NULL) # S4 method for data.frame as.DEGSet(object, contrast, default = "raw", extras = NULL) # S4 method for DESeqResults as.DEGSet(object, default = "shrunken", extras = NULL)
| resList | List with results as elements containing log2FoldChange, pvalues and padj as column. Rownames should be feature names. Elements should have names. |
|---|---|
| default | The name of the element to use by default. |
| object | Different objects to be transformed to DEGSet when using |
| ... | Optional parameters of the generic. |
| extras | List of extra tables related to the same comparison when using |
| contrast | To name the comparison when using |
For now supporting only DESeq2::results() output.
Use constructor degComps() to create the object.
The list will contain one element for each comparison done. Each element has the following structure:
DEG table
Optional table with shrunk Fold Change when it has been done.
To access the raw table use deg(dgs, "raw"), to access the
shrunken table use deg(dgs, "shrunken") or just deg(dgs).
library(DESeq2)#>#>#>#>#> #>#> #> #> #> #>#> #> #>#> #> #> #> #> #> #> #>#> #>#> #> #>#>#>#>#>#>#> #> #> #> #>#>#>#> #>#> #> #>#>#> #>#> #> #>#> #> #>library(edgeR)#>#> #>#> #> #>#> #> #>library(limma) dds <- makeExampleDESeqDataSet(betaSD = 1) colData(dds)[["treatment"]] <- sample(colData(dds)[["condition"]], 12) design(dds) <- ~ condition + treatment dds <- DESeq(dds)#>#>#>#>#>#>#>#>#>#> #> #> #> #>deg(res)#> log2 fold change (MAP): condition B vs A #> Wald test p-value: condition B vs A #> DataFrame with 1000 rows and 6 columns #> baseMean log2FoldChange lfcSE #> <numeric> <numeric> <numeric> #> gene202 595.738080502665 2.84842810352625 0.266347713336691 #> gene710 117.423055944441 2.27457157814062 0.269412722270367 #> gene365 62.4434899710059 2.58422310739862 0.312590047837112 #> gene92 220.780204589055 2.34371133129609 0.293935357285173 #> gene364 504.522116500683 2.02714357936619 0.261124625693044 #> ... ... ... ... #> gene817 1.01863690444656 0.449433023322897 0.445454565205662 #> gene843 0.337116176782868 -0.213542721980008 0.335419175582519 #> gene896 0.641791262357825 -0.193113193147619 0.453528848117175 #> gene929 0.400097105619871 0.148754379342596 0.336592062169539 #> gene986 1.03912504596143 -0.08078789533133 0.501091699324092 #> stat pvalue padj #> <numeric> <numeric> <numeric> #> gene202 10.4242414625226 1.92186681865069e-25 1.84307027908601e-22 #> gene710 8.19578166036082 2.48969903778264e-16 1.19381068861678e-13 #> gene365 8.02865482517521 9.85471916802617e-16 3.15022522737903e-13 #> gene92 7.7626720152767 8.31584691463868e-15 1.99372429778462e-12 #> gene364 7.51756890822073 5.58041485417993e-14 1.07032356903171e-11 #> ... ... ... ... #> gene817 1.05361747680227 0.292058084434074 NA #> gene843 -0.406932816121088 0.684057332932902 NA #> gene896 -0.612499137852159 0.5402075682426 NA #> gene929 0.414219583248068 0.678713301164469 NA #> gene986 0.0436335995171099 0.965196468651691 NA#> <numeric>#> # A tibble: 1,000 x 7 #> gene baseMean log2FoldChange lfcSE stat pvalue padj #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 gene202 596. 2.85 0.266 10.4 1.92e-25 1.84e-22 #> 2 gene710 117. 2.27 0.269 8.20 2.49e-16 1.19e-13 #> 3 gene365 62.4 2.58 0.313 8.03 9.85e-16 3.15e-13 #> 4 gene92 221. 2.34 0.294 7.76 8.32e-15 1.99e-12 #> 5 gene364 505. 2.03 0.261 7.52 5.58e-14 1.07e-11 #> 6 gene968 69.4 2.62 0.345 7.11 1.17e-12 1.87e-10 #> 7 gene836 49.2 2.41 0.335 7.05 1.78e-12 2.43e-10 #> 8 gene77 32.5 -2.31 0.334 -6.75 1.50e-11 1.80e- 9 #> 9 gene342 484. 1.45 0.225 6.50 7.90e-11 8.42e- 9 #> 10 gene880 27.5 2.80 0.402 6.48 9.01e-11 8.64e- 9 #> # … with 990 more rows# From edgeR dge <- DGEList(counts=counts(dds), group=colData(dds)[["treatment"]]) dge <- estimateCommonDisp(dge) res <- as.DEGSet(topTags(exactTest(dge))) # From limma v <- voom(counts(dds), model.matrix(~treatment, colData(dds)), plot=FALSE) fit <- lmFit(v) fit <- eBayes(fit, robust=TRUE) res <- as.DEGSet(topTable(fit, n = "Inf"), "A_vs_B")#>