# 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 per-gene, per-term
tidied <- tidy(ddsres)
tidied
if (require("ggplot2")) {
ggplot(tidied, aes(p.value)) + geom_histogram(binwidth = .05) +
facet_wrap(~ term, scale = "free_y")
}
}
Run the code above in your browser using DataLab