This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 4 group comparison

I want to compare the DEG expression levels in WT(Wild Type) and three mutants(mutantA, mutantB, mutantC ; lacked a certain genes). I used Salmon, tximport, and DESeq2(shown below).

group <- data.frame(con = (c(rep("WT", 3), rep("A", 3), rep("B", 3), rep("C", 3)))

# compare WT with A
dds <- DESeqDataSetFromTximport(txi = gene.exp, colData = group, design = ~ con)
dds <- estimateSizeFactors(dds)
dds <- estimateDispersions(dds)
dds <- nbinomWaldTest(dds)
res <- results(dds, contrast = c("con", "WT", "A"))
head(res[order(res$pvalue), ])
write.table(res, file = "result.txt", row.names = T, col.names = T, sep = "\t")

# compare WT with B
dds <- DESeqDataSetFromTximport(txi = gene.exp, colData = group, design = ~ con)
dds <- estimateSizeFactors(dds)
dds <- estimateDispersions(dds)
dds <- nbinomWaldTest(dds)
res <- results(dds, contrast = c("con", "WT", "B"))
head(res[order(res$pvalue), ])
write.table(res, file = "result.txt", row.names = T, col.names = T, sep = "\t")

# compare WT with C
dds <- DESeqDataSetFromTximport(txi = gene.exp, colData = group, design = ~ con)
dds <- estimateSizeFactors(dds)
dds <- estimateDispersions(dds)
dds <- nbinomWaldTest(dds)
res <- results(dds, contrast = c("con", "WT", "C"))
head(res[order(res$pvalue), ])
write.table(res, file = "result.txt", row.names = T, col.names = T, sep = "\t")

dds <- DESeqDataSetFromTximport(txi = gene.exp, colData = group, design = ~ con)
dds <- estimateSizeFactors(dds)
dds <- estimateDispersions(dds)
dds <- nbinomLRT(dds, full = ~ con, reduced = ~ 1)
res <- results(dds)
head(res[order(res$pvalue), ])
write.table(res, file = "result.txt", row.names = T, col.names = T, sep = "\t")

Is this correct? Should I do something for WT?

Would you tell me the workflow?

rna-seq deseq2 heatmap deg

1 answer

You don't need to run the same workflow multiple times, so making the dataset, the normalization step and estimating dispersion. You can extract multiple contrasts from the results object, please see http://bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#contrasts

Log in to answer this question.