[BioC] Limma: doing multiple paired t-tests in one go...
Groot, Philip de
philip.degroot at wur.nl
Wed Nov 28 16:11:23 CET 2007
Hello All,
I encountered a problem that I cannot easily solve, most probably because my knowledge of linear models is too restricted. The problem is that I want to do a paired t-test using limma, but that I want to fit multiple comparisons (using different patients!) simultanuously. The reason for this is that all .CEL-files in my experiment are fitted and this fit is used for the eBayes() command to maximize the advantage of using the eBayes approach.
I found in the bioconductor mailing list a somewhat related topic:
https://stat.ethz.ch/pipermail/bioconductor/2007-February/016123.html <https://stat.ethz.ch/pipermail/bioconductor/2007-February/016123.html>
However, my problem is different. Instead of having multiple treatments over the same patients, I have multiple treatments over multiple patients (but still can do a paired t-test because before and after a single treatment is done on the same person).
For simplicity, let's assume that I have 2 diets and 2 patients for each diet. My pData(x.norm) looks like this:
sample replicates sibship
A96_hA_09_113_1_base.CEL 1 Control_Diet_1 113
A96_hA_40_113_1_final.CEL 2 Treatment_Diet_1 113
A96_hA_10_114_1_base.CEL 3 Control_Diet_1 114
A96_hA_41_114_1_final.CEL 4 Treatment_Diet_1 114
A96_hA_01_101_2_base.CEL 5 Control_Diet_2 101
A96_hA_32_101_2_final.CEL 6 Treatment_Diet_2 101
A96_hA_02_103_2_base.CEL 7 Control_Diet_2 103
A96_hA_33_103_2_final.CEL 8 Treatment_Diet_2 103
My design matrix (for a paired t-test) is calculated as follows (from the Limma user guide):
Replicates <- factor(pData(x.norm)$replicates)
SibShip <- factor(pData(x.norm)$sibship)
design <- model.matrix(~SibShip+Replicates)
And the design matrix looks like this:
(Intercept) SibShip103 SibShip113 SibShip114 ReplicatesControl_Diet_2
1 1 0 1 0 0
2 1 0 1 0 0
3 1 0 0 1 0
4 1 0 0 1 0
5 1 0 0 0 1
6 1 0 0 0 0
7 1 1 0 0 1
8 1 1 0 0 0
ReplicatesTreatment_Diet_1 ReplicatesTreatment_Diet_2
1 0 0
2 1 0
3 0 0
4 1 0
5 0 0
6 0 1
7 0 0
8 0 1
attr(,"assign")
[1] 0 1 1 1 2 2 2
attr(,"contrasts")
attr(,"contrasts")$SibShip
[1] "contr.treatment"
attr(,"contrasts")$Replicates
[1] "contr.treatment"
As you can image, the comparisons I am interested in are Control_Diet_1-Treatment_Diet_1 and Control_Diet_2-Treatment_Diet_2. I might also be interested in Control_Diet_1-Control_Diet_2 and Treatment_Diet_1-Treatment_Diet_2, and so forth. My problem is that the current design matrix is rather complicated and that multiple interaction effects are somehow included, i.e. I cannot get individual effects by simply subtracting two factors in the design matrix (as I understand it). My question is: how can I create a contrast matrix that gives me the comparisons I am interested in? I am really looking forward to an answer!
Kind Regards,
Dr. Philip de Groot
Wageningen University
More information about the Bioconductor
mailing list