Contrast of Contrasts in Limma
1
0
Entering edit mode
mpitz • 0
@ec27fee4
Last seen 19 months ago
Germany

I want to get the difference of differences from a limma voom analysis. In a simplified example, I have 3 genotypes: Parent1, Parent2 and the Hybrid (of the two parents). For this example, I want to find whether the Hybrid expression is closer to the expression level of Parent1 or Parent2 (or equally close to both parents). In the analysis, we already compare both parents to the Hybrid in individual contrasts.

y <- DGEList(countdata)
y <- calcNormFactors(y)
design <- model.matrix(~ 0 + sampleinfo$Genotype + sampleinfo$REP.BAT)
v <- voomWithQualityWeights(y,design)
fit <- lmFit(v, design)

makeContrasts(Parent1-Hybrid, Parent2-Hybrid, levels=design)->mat.a

fit.a <- contrasts.fit(fit, mat.a)
fit.a <- eBayes(fit.a)
fit.treat.a <- treat(fit.a)

By subtracting the absolute values of the coefficients from those contrasts, we should get the difference of differences. What I am looking for, is to get the corresponding statistical test for these results.

abs(fit.treat.a[["coefficients"]][,1])-abs(fit.treat.a[["coefficients"]][,2])

Is there a way, to also extract the corresponding standard deviation and calculate the corresponding t-tests? Or is there a way, to build a contrast directly, that compares the difference of Parent1vsHybrid and Parent2vsHybrid directly?

makeContrasts((Parent1-Hybrid) - (Parent2-Hybrid), levels=design)->mat.a

Like this, but it the Hybrid is being cut out in this formulation, resulting in Parent1-Parent2, which is not what I want.

limma DifferentialExpression • 692 views
ADD COMMENT
1
Entering edit mode
@gordon-smyth
Last seen 6 hours ago
WEHI, Melbourne, Australia

Determining which parent the hybrid is closest to is not equivalent to any linear model hypothesis test and so can't be tested in limma.

You can however test whether Parent1 is equal to Parent2 and whether either is different from the Hybrid. That requires three separate contrasts, and those three comparisons tell you everything you need to know to determine which can be distinguished from which.

You can also use plotMDS() to explore the relationships between the samples in terms of leading-fold-change distances. That will show visually whether hybrid samples tend to cluster closer to one parent or the other.

ADD COMMENT
0
Entering edit mode

Thank you for the clarification. We did the comparisons you suggested, and have an idea which parent the Hybrid is closer to, where the expression in the Hybrid is only significantly different from one of the two parents. In cases of genes, where the expression is Parent1<Hybrid<Parent2, our impression is, that the distance to Parent2 is smaller than to Parent1. By also comparing the average of both parents to the hybrid in combination with the Parent1vsParent2 results, we should be able to check that impression at least for some genes.

makeContrasts((Parent1+Parent2)/2) - Hybrid, levels=design)->mat.a

If the Hybrid expression is higher than the average of Parent1+Parent2 and the Parent2 expression is higher than Parent1, then the Hybrid expression must be closer to Parent2 (for Parent1<Hybrid<Parent2).

ADD REPLY

Login before adding your answer.

Traffic: 1607 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