DESeq2_tidiers
From biobroom v1.4.2
by John D Storey
Tidying methods for DESeq2 DESeqDataSet objects
This reshapes a DESeq2 expressionset object into a tidy format. If the dataset contains hypothesis test results (pvalues and estimates), this summarizes one row per gene per possible contrast.
Usage
"tidy"(x, colData = FALSE, intercept = FALSE, ...)
"tidy"(x, ...)
Arguments
 x
 DESeqDataSet object
 colData
 whether colData should be included in the tidied output for those in the DESeqDataSet object. If dataset includes hypothesis test results, this is ignored
 intercept
 whether to include hypothesis test results from the (Intercept) term. If dataset does not include hypothesis testing, this is ignored
 ...
 extra arguments (not used)
Details
colDat=TRUE
adds covariates from colData to the data frame.
Value

If the dataset contains results (pvalues and log2 fold changes),
the result is a data frame with the columns
 term
 The contrast being tested, as given to
results
 gene
 gene ID
 baseMean
 mean abundance level
 estimate
 estimated log2 fold change
 stderror
 standard error in log2 fold change estimate
 statistic
 test statistic
 p.value
 pvalue
 p.adjusted
 adjusted pvalue If the dataset does not contain results (
 gene
 gene ID
 sample
 sample ID
 count
 number of reads in this gene in this sample If
DESeq
has
not been run on it), tidy
defaults to tidying the counts in
the dataset:
colData = TRUE
, it also merges this with the columns present
in colData(x)
.
Examples
# From DESeq2 documentation
if (require("DESeq2")) {
dds < makeExampleDESeqDataSet(betaSD = 1)
tidy(dds)
# With design included
tidy(dds, colData=TRUE)
# add a noise confounding effect
colData(dds)$noise < rnorm(nrow(colData(dds)))
design(dds) < (~ condition + noise)
# perform differential expression tests
ddsres < DESeq(dds, test = "Wald")
# now results are pergene, perterm
tidied < tidy(ddsres)
tidied
if (require("ggplot2")) {
ggplot(tidied, aes(p.value)) + geom_histogram(binwidth = .05) +
facet_wrap(~ term, scale = "free_y")
}
}
Community examples
Looks like there are no examples yet.