Hello,
I have a dataset that consists of four conditions (one control, and three different stages of disease) and four batches.
I accounted for batch effects, by:
dds <- DESeqDataSetFromTximport(txi.rsem, sampleTable, ~batch + condition)
I then explicitly set the levels of factor condition to make sure every stage is compared to my control.
dds$condition <- factor(dds$condition, levels=c("Normal","Stage1", "Stage2", "Stage3"))
And performed differential expression: dds <- DESeq(dds).
My questions are:
1) Do I need to do anything else to account for batch effects?
2) Having set my "Normal" samples as the reference level, can I expect that every stage has been separately compared to "Normal"?
3) I am also interested in comparing Stage 2 to Stage 1, Stage 3 to Stage 2 and Stage 3 to Stage 1. Is there a way to code this? I assume I could reset the levels and choose Stage 1 or 2 as reference, then keep only the comparisons that make sense.
Thanks so much for your help!
Thanks so much!
As far as the multiple comparisons go, even if I specify three levels to be compared with Normal, I still get a single column of LFC values.
Is there a way that I can get three columns, one per each level compared to Normal?
Interestingly, too, the LFC values seem "flipped", as if I specified the levels in the opposite order. I did dds$condition <- factor(dds$condition, levels=c("Normal","Stage1", "Stage2", "Stage3")), which according to the vignette is correct.
results() only does one contrast at a time. coef() can be used to get a matrix of model coefficients. The LFC values from a contrast: (variable, numerator, denominator) give log2 of numerator/denominator.