Hi everyone,
I have a few samples with the following coldata:
samples condition library time pos_neg
1 A_1_pos A_1_pos A 1 pos
2 A_1_neg A_1_neg A 1 neg
3 A_2_pos A_2_pos A 2 pos
4 A_2_neg A_2_neg A 2 neg
5 A_3_pos A_3_pos A 3 pos
6 A_3_neg A_3_neg A 3 neg
7 B_4_pos B_4_pos B 4 pos
8 C_1_pos1 C_1_pos C 1 pos
9 C_1_pos2 C_1_pos C 1 pos
10 C_1_pos3 C_1_pos C 1 pos
11 C_1_neg1 C_1_neg C 1 neg
12 C_1_neg2 C_1_neg C 1 neg
13 C_2_pos1 C_2_pos C 2 pos
14 C_2_pos2 C_2_pos C 2 pos
15 C_2_pos3 C_2_pos C 2 pos
16 C_2_neg1 C_2_neg C 2 neg
17 C_2_neg2 C_2_neg C 2 neg
18 C_3_pos1 C_3_pos C 3 pos
19 C_3_pos2 C_3_pos C 3 pos
20 C_3_pos3 C_3_pos C 3 pos
21 C_3_pos4 C_3_pos C 3 pos
22 C_3_neg1 C_3_neg C 3 neg
23 C_3_neg2 C_3_neg C 3 neg
24 C_3_neg3 C_3_neg C 3 neg
25 C_3_neg4 C_3_neg C 3 neg
A simple clustering showed the samples can be well clustered by "time", and among samples with the same "time", they were further well clustered by "library", but not clearly clustered by "pos_neg".
Now my purpose is to find:
1. DEGs of "pos" samples between each two adjacent "time", i.e, 1_pos VS 2_pos, 2_pos VS 3_pos, 3_pos VS 4_pos (though there's only one sample without replicate), no matter what "library" it is.
2. DEGs between "pos" and "neg", no matter "library" and "time". (Is there a difference to find DEGs between "pos" and "neg" in all "time", and that in any "time"?)
So how could I make the design and contrast matrix to achieve my purposes?
Thanks for any kind of comments and suggestions.
Thanks, Michael! That's really great.
For the listValues, if I understand correctly, I should put
c(1/4, -1/3)
for averaging if mycontrasts=list(c("1_pos", "2_pos", "3_pos", "4_pos"), c("1_neg", "2_neg", "3_neg"))
right?Yes, that will average over those levels.
Got it. Thanks!