Search
Question: Creating design and contrast matrices for DEG with Limma for 2 factors?
0
gravatar for Natasha
21 days ago by
Natasha0
Natasha0 wrote:

Hi everyone,

I have some data from a Microarray experiment for 70 samples and they are for 3 different treatments across 5 timepoints (1h/2h/8h/24h/48h).  This is how my data looks like; the number of samples I have for each Treatment for each time point.

Time(hrs)/Treatment Control A B A+B
1 3 2 3 4
2 3 3 3 3
8 3 3 4 3
24 5 5 5 5
48 4 3 3 3

I want to be able to compare upregulation and downregulation of genes between the 4 treatment groups at different time points.

In such a case, should I first create 2 columns in my metadata called Timepoint and Treatment Type first?

And how would I then create the design and contrast matrix? I appreciate any advice on this, thanks!

ADD COMMENTlink modified 21 days ago by Aaron Lun17k • written 21 days ago by Natasha0
2
gravatar for Aaron Lun
21 days ago by
Aaron Lun17k
Cambridge, United Kingdom
Aaron Lun17k wrote:

You need two vectors; one specifying the time point for each sample, another specifying the treatment condition. Whether these are stored as columns in a data.frame or otherwise is irrelevant. Once you have these vectors, it is simple to construct the design matrix using a one-way layout following the advice in Section 9.5 of the limma user's guide. A contrast matrix can be similarly formulated based on the comparisons of interest.

ADD COMMENTlink written 21 days ago by Aaron Lun17k

Hello Aaron,

Thank you so much for your reply. Section 9.5 of the user  guide was very useful indeed. However, I am a little confused about what this means in the guide.

"A list of top genes for RNA2 versus RNA1 can be obtained from

> topTable(fit2, coef=1, adjust="BH") "

Here, since sort.by is not specified, how  is toptable ordering the results? (logFC/p value etc.)

Also, somehow my results for this seem to include the columns for my featureData together with the actual toptable output columns. If you would happen to know why, please do let me know.

Thank you for all your help!

 

 

ADD REPLYlink written 20 days ago by Natasha0

Some basic R knowledge would be helpful here. If you look at ?topTable, you will see that the default value for the sort.by argument is "B", i.e., the function will return genes sorted by the B-statistic (also known as the log-odds). The same documentation will reveal that the columns of fit$genes are added to the output table by default.

ADD REPLYlink modified 20 days ago • written 20 days ago by Aaron Lun17k

Thank you, I shall look up ?topTable.

ADD REPLYlink written 20 days ago by Natasha0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 138 users visited in the last hour