Hi all, I'm trying to wrap my head around how I c...
# differentialabundance
k
Hi all, I'm trying to wrap my head around how I could do a nested experimental design with Differential abundance pipeline, based on this documentation from the DESeq2 vignette I'm trying to follow a design with: • 2 groups (X and Y) • 3 patients per group (1,2,3 and 4,5,6) • 2 conditions (A and B) per group The goal is to to look at if the effects of A vs B differ between groups X and Y, while controlling for individual. (I've attached a diagram to illustrate this) I can encode the table like so:
Copy code
##    grp ind cnd ind.n
## 1    X   1   A     1
## 2    X   1   B     1
## 3    X   2   A     2
## 4    X   2   B     2
## 5    X   3   A     3
## 6    X   3   B     3
## 7    Y   4   A     1
## 8    Y   4   B     1
## 9    Y   5   A     2
## 10   Y   5   B     2
## 11   Y   6   A     3
## 12   Y   6   B     3
From the documentation, this suggests the model can be:
counts ~ grp + grp:ind.n + grp:cnd
However, I'm failing to see how we can translate interaction terms into the samplesheet and contrasts? The closest that I can think of/manage is that we can instead have a column
grp_ind
that acts to combine the `grp`and
ind
columns (as they are linearly related)
Copy code
##    grp ind cnd individual_and_group
## 1    X   1   A     X_1
## 2    X   1   B     X_1
## 3    X   2   A     X_2
## 4    X   2   B     X_2
## 5    X   3   A     X_3
## 6    X   3   B     X_3
## 7    Y   4   A     Y_4
## 8    Y   4   B     Y_4
## 9    Y   5   A     Y_5
## 10   Y   5   B     Y_5
## 11   Y   6   A     Y_6
## 12   Y   6   B     Y_6
As far as I can tell, with the pipeline, we can only model A vs B within each group (X and Y) accounting for patient, and then have to do I have to the group-specific condition effects outside the pipeline? My contrasts file would therefore, from what I can tell, look like:
Copy code
id,variable,reference,target,blocking,exclude_samples_col,exclude_samples_values
X_cnd_B_vs_A,cnd,A,B,ind_grp,grp,Y
Y_cnd_B_vs_A,cnd,A,B,ind_grp,grp,X
where the first row is looking at A vs B only in group X, accounting for patient ID. and the second row is the same except for group Y? Hopefully what I've laid out above makes sense and I hope I haven't made an incredibly obvious blunder, thanks in advance šŸ™‚
j
Without getting my head around this completely, I strongly suspect you need the more advanced modelling capabilities @Gregor Sturm has been working with colleagues to add to the pipeline. Still on dev (and dev is in a bit of a strange state right now), but maybe Gregor could comment.
k
Hi Jonathan, appreciate the quick reply, I'm sort of suspecting this, but definitely want to check! šŸ™‚ I saw on Dev there's the addition of the DREAM option, which looks amazing, but I couldn't seem to get it functioning as of end of Dec (as you say this may be due to dev's current state)
g
Hi @Kai Lawson-McDowall, these kind of designs were exactly the motivation for implementing DREAM in the pipeline. I would probably model both group and patient as a random effect in that case, i.e.
~ condition + (1 | patient) + (1 | group)
, but there's probably more info on modelling in the dream tutorial. We did fix some issues with DREAM since December, so if you could give it another try and report back that would be great!
šŸŽ‰ 1
k
Hi Gregor, Appreciate the response! Incredibly excited by the potential for the DREAM implementation! I was looking at ImpulseDE2 and the TimeSeriesAnalysis pipeline, but they both have the same issue as differentialabundance I'll give it a go and get back to you ASAP 😊
@Gregor Sturm and @Jonathan Manning - out of curiosity, is there a tentative release date for 1.6? Or is that very much TBD? šŸ™‚
j
Oh, this will definitely be a 2.0. I think we were hoping for a couple of months, but it will depend on last fixes/ testing
šŸ™Œ 1
šŸ‘ 2
k
Y'know, I did think this would be the biggest minor patch I'd ever seen if it was 1.6! Appreciate the fast response and looking forward to 2.0! šŸ™‚