I have some RNASeq data from a microbe that was grown either aerobically or anaerobically, and samples were taken at T0, T1, T2, or T3.
To set up a model matrix describing my sample, I have done the following...
permut <- model.matrix(~ 0 + aerobicity + timing)
And this yields the following, dropping level T0, which makes sense.
aerobic anaerobic T1 T2 T3
1 1 0 0 0 0
2 1 0 0 0 0
3 1 0 1 0 0
4 1 0 1 0 0
5 1 0 0 1 0
6 1 0 0 1 0
7 1 0 0 0 1
8 1 0 0 0 1
9 1 0 0 0 0
10 1 0 0 0 0
11 1 0 1 0 0
12 1 0 1 0 0
13 1 0 0 1 0
14 1 0 0 1 0
15 1 0 0 0 1
16 1 0 0 0 1
17 0 1 0 0 0
18 0 1 0 0 0
19 0 1 1 0 0
20 0 1 1 0 0
21 0 1 0 1 0
22 0 1 0 1 0
23 0 1 0 0 1
24 0 1 0 0 1
25 0 1 0 0 0
26 0 1 0 0 0
27 0 1 1 0 0
28 0 1 1 0 0
29 0 1 0 1 0
30 0 1 0 1 0
31 0 1 0 0 1
32 0 1 0 0 1
When I set up contrasts, I can easily compare the aerobic to anaerobic growth conditions:
aerobicity_contrast <- makeContrasts(aerobic - anaerobic, levels = permut)
But, I am sad to say that I am stumped trying to set up a contrast between T3 and T0. Since the level is dropped, I am not sure how to extract the relevant contrasts from the model. The following clearly doesn't work:
timing_contrast <- makeContrasts(T3 - T0, levels = permut)
However, dropping T0 from the makeContrasts
works, but I am unsure if this is appropriate given the model.
timing_contrast <- makeContrasts(T3, levels = permut)
Any advice would be appreciated.
I'll leave this comment for the sake of posterity.
If anyone is curious, just making a contrast with
T3
does work the same asT3 - T0
. I made a convoluted model.matrix, leaving out one of the other time points, and calledT3 - T0
, and got the same answer to prove it to myself.