DEGSet.Rd
S4 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)#>#>#>#>#>#>#>#>#>#> 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.69290441661694 0.312772825764591 #> gene710 117.423055944441 2.39202225442696 0.309387809822349 #> gene365 62.4434899710059 2.68819163853763 0.347014786363427 #> gene364 504.522116500683 2.13726876442053 0.304160581713146 #> gene92 220.780204589055 2.05762907387256 0.326874656707121 #> ... ... ... ... #> gene984 3.56063169601722 1.18342031931477 0.558212799249338 #> gene986 1.03912504596143 -0.131696247712928 0.550000503156253 #> gene989 1.84138670225673 0.797083476699305 0.567712937423255 #> gene995 2.88636057994642 0.0840813792066131 0.555663728011982 #> gene1000 2.5816660463203 -0.535343293319606 0.564961445050577 #> stat pvalue padj #> <numeric> <numeric> <numeric> #> gene202 7.82879005947595 4.92587384985754e-15 4.05892005228261e-12 #> gene710 6.93369964061162 4.0997464674756e-12 1.68909554459995e-09 #> gene365 6.79494555755484 1.08353438828276e-11 2.9761077864833e-09 #> gene364 6.56399761634188 5.23840391930272e-11 1.07911120737636e-08 #> gene92 5.4297680851086 5.64273306072517e-08 9.29922408407507e-06 #> ... ... ... ... #> gene984 1.56606943948116 0.117332361646146 NA #> gene986 -0.743786405055134 0.457005706109876 NA #> gene989 1.31499465077388 0.188511700254376 NA #> gene995 1.09138089416803 0.275105315817471 NA #> gene1000 -0.806243807885651 0.420102283688199 NA#> # A tibble: 1,000 x 7 #> gene baseMean log2FoldChange lfcSE stat pvalue padj #> * <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 gene202 596. 2.69 0.313 7.83 4.93e-15 4.06e-12 #> 2 gene710 117. 2.39 0.309 6.93 4.10e-12 1.69e- 9 #> 3 gene365 62.4 2.69 0.347 6.79 1.08e-11 2.98e- 9 #> 4 gene364 505. 2.14 0.304 6.56 5.24e-11 1.08e- 8 #> 5 gene92 221. 2.06 0.327 5.43 5.64e- 8 9.30e- 6 #> 6 gene664 110. 1.97 0.350 5.20 2.03e- 7 2.79e- 5 #> 7 gene577 135. -1.66 0.295 -5.17 2.37e- 7 2.79e- 5 #> 8 gene564 83.3 -1.93 0.361 -5.12 3.08e- 7 3.10e- 5 #> 9 gene787 71.0 1.92 0.360 5.08 3.76e- 7 3.10e- 5 #> 10 gene836 49.2 2.25 0.377 5.08 3.71e- 7 3.10e- 5 #> # ... 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")#>