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
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.