makeContrasts for comparing multiple levels of a factor variable to the reference level
1
0
Entering edit mode
S.Bamopoulos ▴ 10
@sbamopoulos-12845
Last seen 5.8 years ago
Germany

Hello all,

I have a quick question regarding the makeContrasts function of the limma package, for which I couldn't find a clear answer online. I am running a differential expression pipeline and I want to explore the effect of 3 mutations, lets call them: mutA, mutB, mutC. I built a design matrix by putting the mutations in a factor variable along with the control. Now the variable has 4 levels (mutA, mutB, mutC, control) and I have set the "control" level as the first level.

How do I make a contrast that detects DE elements that are found in all mutated samples when compared to the control?

Basically I want to make a contrast like this: "(mutA + mutB + mutC)/3 - control"

but "control" doesn't appear as a coefficient in the design matrix since it is the reference level.

Is this:

design <- model.matrix( ~ factor with mutations as levels + some confounders)

con <- makeContrasts("(mutA + mutB + mutC)/3", levels=design)

the correct way to make the contrast I am looking for? Or is this doing something else?

Thanks in advance!

Stefan

diffrential expression limma makeContrasts • 1.9k views
ADD COMMENT
2
Entering edit mode
@gordon-smyth
Last seen 1 hour ago
WEHI, Melbourne, Australia

Yes, that's the way to make the contrast. Since you set "control" as the first level, all the mut coefficients measure fold-changes vs control: mutA-control, mutB-control etc.

ADD COMMENT
0
Entering edit mode

Thank you for the quick response!
 

ADD REPLY

Login before adding your answer.

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