Hello all, I've read Limma user's guide completely but I'm still unsure about the way I am making my design matrix. I have two groups (pre and post) for each subject. Two treatments (treatment and placebo) and sex. I want to find out if there are any differentially expressed genes between post-treatment and pre-treatment. The targets looks like this:
Sample_Name Sample_Group Sample_Source Treatment Sex 003 post A01 Placebo M 21v7 pre B01 Rapamycin M 42v1 pre C01 Rapamycin M 030v7 pre F01 Rapamycin F 46v1 pre G01 Rapamycin M 14v7 pre H01 Placebo M 003 pre A01 Placebo M 42v4 post C01 Rapamycin M 030v9 post F01 Rapamycin F 46v4 post G01 Rapamycin M 14v9 post H01 Placebo M
I know that Sample_Group is my within-individual factor and Treatment is between-individual factor, but still do not get answers. Here is my code. I would really appreciate if anyone can help me. I am so confused.
groups <- factor($targets$Sample_Group) ## pre & post treatment <- factor(targets$Treatment) ## Rapamycin & placebo individual <- factor(targets$Sample_Source) gender <- factor(targets$Sex) design1 <- model.matrix(~0+groups*treatment, data=targets) dupfit <- duplicateCorrelation(eset, design1, block=targets$Sample_Source) fit <- lmFit(eset, design1,correlation=dupfit$consensus, block=individual) fit2 <- eBayes(fit)
Thanks a lot.