DESeq2: How to correct for multiple comparisons
1
0
Entering edit mode
NG • 0
@ng-21603
Last seen 4.6 years ago

Hello,

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 • 2.9k views
ADD COMMENT
0
Entering edit mode

Hi Noa,

I hope your problem was solved. Actually, I had the same question and just came across this post. I have 6 samples and I want to create a heatmap for a list of genes of interest for all these samples. To do that, I need to have normalized counts for all the samples but if I do pairwise comparison in DESeq2, I am not sure that would be OK to combine the values into one table to create a heatmap. I appreciate it if you share your experience on this. Thanks a lot, Hamid.

ADD REPLY
0
Entering edit mode
@mikelove
Last seen 11 minutes ago
United States

(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 COMMENT

Login before adding your answer.

Traffic: 801 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6