Question: Questions for ResultsNames() and the Contrast function
0
27 days ago by
dennism92510 wrote:

After reading this post and this page I would like some clarification for results(). For exemplification, I am will be referring to the webpage.

1a) In "Example 1 : two-group comparison" what would be the difference between the following codes?

results(dds, contrast=c("condition", "B", "A")
results(dds, name="condition_B_vs_A")


From my understanding the lfc (countData B / countDataA) is the same for both

1b) In "Example 2: two conditions, two genotypes, with an interaction term (The effect of treatment in wild-type (the main effect)", what would be the difference between the following codes?

results(dds, contrast=c("condition", "Trt", "Ctrl"))
results(dds, name="condition_Trt_vs_Ctrl")


2a) In "Example 2: two conditions, two genotypes, with an interaction term (The effect of treatment in wild-type (the main effect)", treatment effect across all genotypes or just "wt"?

res = results(dds, contrast=c("condition","Trt","Ctrl"))


I would think that this contrast would compare the effects of "Trt" and "Ctrl" across all genotypes, but in the text below it states that this contrasts the effect in only "wt" because we set the reference. A one word answer would suffice

2b) In "Example 2: two conditions, two genotypes, with an interaction term (The effect of treatment in wild-type (the main effect)" is there a method on retrieving the SDG from the effect of treatment across all samples?

For the data I am analysing I would like to see the effects of a treatment across all samples , using the untreated version of said sample as reference. (i.e) I hope to get the SDG of treatment by comparing HeyA8-QC with HeyA8-DMSO, HeyA8MDR-QC and HeyA8MDR-DMSO, etc.

   sample_id treatment
1      HeyA8      DMSO
2  HeyA8_MDR      DMSO
3  HeyA8_MDR        QC
4      HeyA8        QC
5      SKOV3      DMSO
6      SKOV3        QC
7         TR      DMSO
8        C13      DMSO
9        C13        QC
10     HeyC2      DMSO
11     HeyC2        QC
12    OV2008      DMSO
13    OV2008        QC
14        TR        QC

deseq2 • 143 views
modified 27 days ago by Michael Love24k • written 27 days ago by dennism92510

You need to add what the design is for your examples, as adding the interaction term changes the meaning of some of the examples. I strongly recommend making a dummy data set as the second link shows, getting the normalized counts, and confirming in Excel what all the different kinds of contrasts do.

Thank you for the reply, but all the questions except for 2b are referring the webpage I linked. As for 2b I wasn't too sure on what order I wanted the design in (you gave a reply to this question in my previous post). However, for clarification here would be my design.

#design for question 2b
~ sample.id + treatment


EDIT: Also how would I get a descriptive idea on differing contrasts from numerical data? Moveover how would I find these differences in the sea of numbers?

Answer: Questions for ResultsNames() and the Contrast function
1
27 days ago by
Michael Love24k
United States
Michael Love24k wrote:

1a and 1b those are the same.

2a it is correct as stated in the help, because of the design. The interpretation of comparisons depends on the design, as also commented by swbarnes2 above.

What is the SDG?

My apologies i mistyped it an meant DEG for differential gene expression

1

In an interaction design, short answer: no, there is not a term representing the treatment for all samples, because there are instead treatments per genotype (using the example in the docs).

Would your answer remain true, if you were to remove the interaction term?

1

No, if you remove the interaction, then the treatment is assumed to be shared across e.g. genotype.

This is described a bit in the Interaction section of the vignette, maybe take another look at that section for more details.