Hi,
I have RNA-seq data with three factors
- line (genotype): a554, s018, s311, s84
- tissue : leaf, sam
- condition : cold, regrowth
Thanks to DESeq documentation and r-bloggers page I have quite good understanding of model for two-way analysis (ie. two factors and interaction).
However for three factors situation complicates a lot.
We are primarily interested in a question: does lines (genotypes) react differently to condition? But also: does line reaction to condition is different in tissues? And also in simple cold vs regrowth comparison for each line. So I should investigate the interaction, it is not hard for two-factor analysis but for three-way it is above my skills...
So I wanted to use method proposed in DESeq2 section on contrasts
Where DESeq2 developers combine factors into one factor 'group'. Indeed it makes pairwise contrasts very convenient.
So here is an extract from my colData
colData(dds2d.ch.rg.group)
DataFrame with 48 rows and 11 columns
pool.plant letter tissue line pool.time time
<character> <character> <factor> <factor> <character> <factor>
la5.3.21 a5.3.21 C leaf a554 10-17 3
ls0.3.21 s0.3.21 F leaf s018 10-17 3
ls8.3.21 s8.3.21 I leaf s84 10-17 3
ls3.3.21 s3.3.21 L leaf s311 10-17 3
sa5.3.21 a5.3.21 O sam a554 10-17 3
... ... ... ... ... ... ...
ls3.3.43 s3.3.43 L leaf s311 10-17 3
sa5.3.43 a5.3.43 O sam a554 10-17 3
ss0.3.43 s0.3.43 S sam s018 10-17 3
ss8.3.43 s8.3.43 W sam s84 10-17 3
ss3.3.43 s3.3.43 Z sam s311 10-17 3
day rep condition group sizeFactor
<factor> <factor> <factor> <factor> <numeric>
la5.3.21 2 1 cold a554.cold.leaf 0.599133
ls0.3.21 2 1 cold s018.cold.leaf 0.532561
ls8.3.21 2 1 cold s84.cold.leaf 0.440120
ls3.3.21 2 1 cold s311.cold.leaf 0.569728
sa5.3.21 2 1 cold a554.cold.sam 1.329649
... ... ... ... ... ...
ls3.3.43 4 3 regrowth s311.regrowth.leaf 1.12049
sa5.3.43 4 3 regrowth a554.regrowth.sam 1.82546
ss0.3.43 4 3 regrowth s018.regrowth.sam 2.33982
ss8.3.43 4 3 regrowth s84.regrowth.sam 2.14273
ss3.3.43 4 3 regrowth s311.regrowth.sam 1.96530
My design is design(dds2d.ch.rg.group)= ~ 0 + group
And my coefficients are
dds2d.ch.rg.group=DESeq(dds2d.ch.rg.group)
resultsNames(dds2d.ch.rg.group)
[1] "groupa554.cold.leaf" "groupa554.cold.sam"
[3] "groupa554.regrowth.leaf" "groupa554.regrowth.sam"
[5] "groups018.cold.leaf" "groups018.cold.sam"
[7] "groups018.regrowth.leaf" "groups018.regrowth.sam"
[9] "groups311.cold.leaf" "groups311.cold.sam"
[11] "groups311.regrowth.leaf" "groups311.regrowth.sam"
[13] "groups84.cold.leaf" "groups84.cold.sam"
[15] "groups84.regrowth.leaf" "groups84.regrowth.sam"
So I understand that for comparison groupa554.cold.leaf
vs groupa554.regrowth.leaf
i should use command
results(dds2d.ch.rg.group, contrast=c('group', 'groupa554.cold.leaf', 'groupa554.regrowth.leaf'))
Is it possible to get interaction with such design?
So for example could I compare if a554 reaction to regrowth in leaf is different to s018 reaction like that
(groupa554.regrowth.leaf - groupa554.cold.leaf) - (groups018.regrowth.leaf - groups018.cold.leaf)
Or to find out if a554 reaction to regrowth is different in leaf and sam
(groupa554.regrowth.leaf - groupa554.cold.leaf) - (groupa554.regrowth.sam - groupa554.cold.sam)
So for my example comparison the code would be
?
Thank you Michael Love for the advice (this one and all previous ones). I don't have formal statistical training and I'd like to read about 3-factor analysis, ie. something which allow investigation of effects like
line:condition:tissue
. Could you recommend any book/website with examples of such analysis usingDESeq2
?There's nothing special with three factors, it's the same concept as with two...
I would recommend to try to meet with anyone at your institute who uses linear models (it doesn't have to be in the genomics concept). Often there is a intro to linear models course at most institutes and you could just borrow their materials.
So if I want to compare LINE reaction to CONDITION (cold, regrowth) across TISSUE (leaf, sam)
i.e. such interaction (groupa554.regrowth.leaf - groupa554.cold.leaf) - (groupa554.regrowth.sam - groupa554.cold.sam)
I need this code:
contrast=list(c("groupa554.regrowth.leaf", "groupa554.cold.sam"), c("groupa554.cold.leaf", "groupa554.regrowth.sam"))
right?