Some confuse in ?results example of DESeq2
1
0
Entering edit mode
@shangguandong1996-21805
Last seen 17 months ago
China

Hi, Dr Love. I am little confused about the example in ?results. The example3 in ?results is listed below

## Example 3: two conditions, three genotypes

# ~~~ Using interaction terms ~~~

dds <- makeExampleDESeqDataSet(n=100,m=18)
dds$genotype <- factor(rep(rep(c("I","II","III"),each=3),2))
design(dds) <- ~ genotype + condition + genotype:condition
dds <- DESeq(dds)

> resultsNames(dds)
[1] "Intercept"              "genotype_II_vs_I"      
[3] "genotype_III_vs_I"      "condition_B_vs_A"      
[5] "genotypeII.conditionB"  "genotypeIII.conditionB"

# the condition effect for genotype I (the main effect)
results(dds, contrast=c("condition","B","A"))

# the condition effect for genotype III.
# this is the main effect *plus* the interaction term
# (the extra condition effect in genotype III compared to genotype I).
results(dds, contrast=list( c("condition_B_vs_A","genotypeIII.conditionB") ))

# the interaction term for condition effect in genotype III vs genotype I.
# this tests if the condition effect is different in III compared to I
results(dds, name="genotypeIII.conditionB")

# the interaction term for condition effect in genotype III vs genotype II.
# this tests if the condition effect is different in III compared to II
results(dds, contrast=list("genotypeIII.conditionB", "genotypeII.conditionB"))

Forgive my little konwledge about model.matrix. I haven't figured model.matrix out yet.

According to these example, I thinks the contrast=c("condition","B","A") means genotypeIB(or I say IB) - genotypeIA(or I say IA).

And the name=genotypeIII.conditionB means (IIIB - IIIA) - (IB - IA).

And according to the above explanation, the results(dds, contrast=list("genotypeIII.conditionB", "genotypeII.conditionB")) will means [(IIIB - IIIA) - (IB - IA)] - [(IIB - IIA) - (IB - IA)] = (IIIB - IIIA) - (IIB - IIA). which same as this word this tests if the condition effect is different in III compared to II

But If I apply this explanation to results(dds, contrast=list( c("condition_B_vs_A","genotypeIII.conditionB") )), this will not make sense. this will become (IB - IA) - [(IIIB - IIIA) - (IB - IA)] = 2(IB - IA) - (IIIB - IIIA).

deseq2 • 674 views
ADD COMMENT
0
Entering edit mode
@mikelove
Last seen 4 hours ago
United States

If the descriptions of interaction terms in the manual pages or the interaction section in the vignette are not sufficient, I’d highly recommend working with a statistician to design your analysis. The specification of the design is up to the user.

You can also just provide a numeric contrast if that would be easier than calling the coefficients by name.

ADD COMMENT
0
Entering edit mode

Thanks for your reply Dr. Love. I just want to know if my explanation about the design is right or there are more complex explanation should be considered.

Like results(dds, contrast=c("condition","B","A")) will means IB - IA

results(dds, name="genotypeIII.conditionB") will means (IIB - IIA) - (IB - IA).

I think it will help me understand better the vignette or question about design about DESeq2.

ADD REPLY
0
Entering edit mode

The meaning depends on the design actually. And I unfortunately don’t have sufficient time to go through these on the support site.

I’d also recommend to check out ExploreModelMatrix — this is a new Bioconductor package to help explain what coefficients mean for various designs.

ADD REPLY
0
Entering edit mode

Thanks again :). I will see the ExploreModeMatrix.

ADD REPLY

Login before adding your answer.

Traffic: 733 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6