Issues about experiment design
2
0
Entering edit mode
TFony ▴ 10
@tfony-12313
Last seen 7.8 years ago

Hi, everyone.

In my experiment, I have 5 objects (A,B,C,D,E) with drug treatment (Pre and Post). Therefore total samples include A-pre, A-post, B-pre, B-post, C-pre, C-post, D-pre, D-post, E-pre, E-post

Fist aim is comparing pre-treatment and post-treament, it should be 5 samples vs 5 samples

Second aim is comparing pre-treatment and post-treament in each indidual object, it should be A-pre vs A-post; B-pre vs B-post, C-pre vs C-post, D-pre vs D-post, E-pre vs E-post

I am confused about how to make design matrix and contrast matrix.

Design <- model.matrix(~0+treat_status+object) ??

Contrast <- make.contrast() ???

 

Thanks

Bests,

Shawn
 

limma model.matrix makecontrasts • 1.4k views
ADD COMMENT
1
Entering edit mode
Gavin Kelly ▴ 690
@gavin-kelly-6944
Last seen 4.6 years ago
United Kingdom / London / Francis Crick…

To get the overall pre vs post, taking account of the pairing, you'll need ~treat_status + object and the second coefficient will give you the log fold-change estimate of the pre vs post (it'll be relative to 'post' if you've kept the default alphabetic factor order). So topTable(..., coef=2), or topTable(..., coef="treat_statusPost") 

If you don't include an intercept (with your inclusion of '0' on the RHS of the model formula), then you'll get an esimate for both pre and post, so you'd need to have a make.contrast that subtracted these two; with an intercept, everythings relative to the baseline condition, so that subtraction is already done for you.

To get individual objects' changes, you'll need  ~ object + object:treat_status - 1 and you'll get the first five coefficients being the per-object baseline, and the next five being the per-object post-to-pre log fold change.  So topTable(..., coef=6)  or topTable(..., coef="objectA:treat_statusPost")  etc

 

ADD COMMENT
1
Entering edit mode

Just to add to Gavin's answer; it seems that you only have one sample per object/treatment combination. In that case, there will not be any residual degrees of freedom in your design matrix if you include a log-fold change term for each object. This precludes a DE analysis with limma, because there is no way to estimate the sample variance. It is not possible to get significance statistics for individual objects, only the log-fold changes. Thus, you might as well just compute the pre/post differences in log-expression values directly for each object, which is the best you can do for your second aim.

ADD REPLY
0
Entering edit mode
TFony ▴ 10
@tfony-12313
Last seen 7.8 years ago

Thanks a lot for your replying. Let me try it.

Bests,

Shawn

ADD COMMENT

Login before adding your answer.

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