Question: DESeq2: How to correct for multiple comparisons
gravatar for NG
3 months ago by
NG0 wrote:


I am relatively new to using DESeq2 so thank you in advanced for your help!

I have multiple samples (A, B, C, D, E) with three replicates of each sample. I would like to compare each sample to each other sample (e.g. A vs B, A vs C, A vs D, A vs E, B vs C, etc..). I am fairly comfortable with running each individual pairwise comparison and from my understanding, the adjusted P-values that I get as output are only adjusted for that individual comparison. I'm wondering how do I go about correcting for the 10 comparisons I want to make?

Here is the code I'm currently using.

ountData <- as.matrix((read.csv("counts.csv", row.names="gene_id")))
colData=data.frame(row.names = colnames(countData),sampleCondition=rep(c("E","E", "E", "F","F", "F", "G", "G", "G", "H", "H", "H", "I","I", "I" ,"J", "J", "J", "K", "K", "K")))
colData$sampleCondition <- relevel(colData$sampleCondition, ref = "E")
countData <- countData[, rownames(colData)]
all(rownames(colData) == colnames(countData))
dds <- DESeqDataSetFromMatrix(countData = countData,colData = colData,design = ~ sampleCondition)
dds <- DESeq(dds)
res <- results(dds, contrast = c("E","F","G" ,"H", "I", "K"))
res_e <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","E"))
res_f <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","F"))
res_g <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","G"))
res_h <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","H"))
res_i <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","I"))
res_k <- results(dds, pAdjustMethod = "BH", contrast = c("sampleCondition", "J","K"))

Thank you! Noa

deseq2 • 167 views
ADD COMMENTlink modified 3 months ago by Michael Love26k • written 3 months ago by NG0
Answer: DESeq2: How to correct for multiple comparisons
gravatar for Michael Love
3 months ago by
Michael Love26k
United States
Michael Love26k wrote:

(You can use 3x backticks to make code blocks on the support site)

I tend to list each contrast and describe that the FDR control is across genes. But that would imply that you should present the results from all contrasts. If you are going to test over many comparisons, and then selectively show only the significant comparisons, you may want to consider the stageR Bioconductor package for looking for any difference in any pair, followed by confirmation of which pairs per gene have a difference at the pair-wise level.

ADD COMMENTlink written 3 months ago by Michael Love26k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 256 users visited in the last hour