Hi,
I've a small question concerning differential expression analysis. So I've a 12 samples divided into three groups (A, B and C ). If a do that :
samples <- read.table("samples.txt",sep="\t",as.is=T)
colnames(samples)<-c("sampleName","fileName","condition")
dds1 <- DESeqDataSetFromHTSeqCount(sampleTable=samples,directory="./",design= ~ condition)
dds1 <- DESeq(dds1)
res <- results(dds1)
What will the p-value represent? If it's significatif, is it because the gene of interest is up or down regulated in one of the three groups?
To do pairwise comparison, I do that. Is it correct?
res.A.B <- results(dds1, contrast=c("condition","A","B"))
res.A.C <- results(dds1, contrast=c("condition","A","C"))
res.B.C <- results(dds1, contrast=c("condition","B","C"))
Thanks
Thanks Devon. For LRT is that ok?
Yup, that's exactly what I'd use.
ok great ! thanks again. I accept the answer ;)
Thanks for your answer Ryan. It is really helpful.
May I add some follow up questions please? (should I open a new discussion)
If one does an LRT test with ~condition as a full model and ~1 as a reduced model then the results names for the dds object are: "Intercept", "conditionA_vs_B", "conditionC_vs_B". I think I understood that the pvalues are the same whatever the "name" argument used for results(). But the LogFoldChanges seems to be dependent on the "name" argument. So I was wondering:
-How can one compare condition A versus C, as it is not within the results names?
-My understanding is that if one wants pairwise comparisons then Wald tests should be used. So what are those LogFold Changes and how can they be used?
Many thanks
There is a lot of information for you in
?results
See the 'test' argument and the 'contrast' argument descriptions for example. And see the section On p-values under Details.
In short: LRT gives you one p-value for there being any difference across the 3 levels. If you want to do pairwise comparisons, use 'contrast' and test="Wald". You can run Wald tests simply using results() if you are using version >= 1.6.
Hello,
Thanks a lot for your answer. My understanding from the
?results
is that:If I have a "condition" factor such as
c(A,B,C)
and if I use a full model~condition
and a reduced model~1
(withtest=LRT
), I will generate results with the following names:Intercept
,condition_B_vs_A
,condition_C_vs_A
. Then I do understand that I can compare B versus A by doing:and C versus A by doing:
What I really am not sure about is how to compare B and C with the results name I have. I do see that I would have to use "contrast". But my question is beyond DESeq2 I think, it is the formulas and constrasts in general that I am having difficulties with. A wild guess would be:
because (B-A)-(C-A) = B-C. Does it make any sense please?
Hi Aurelie,
you can modify the condition to
c_A
,b_B
,a_C
instead of A, B, C. This time, you can havecondition_b_B_vs_a_C
.Aifu