Entering edit mode
indrik.wijaya
▴
20
@indrikwijaya-19180
Last seen 4.2 years ago
Hi all, I am planning to run differential gene expression analysis with this kind of design matrix (4 time points, 2 replicates each, 2 different assays and 2 different types):
> sample_name time assay type
> rna_0_r1 t0 rna cyto
> rna_1_r1 t1 rna cyto
> rna_2_r1 t2 rna cyto
> rna_3_r1 t3 rna cyto
> rna_0_r2 t0 rna cyto
> rna_1_r2 t1 rna cyto
> rna_2_r2 t2 rna cyto
> rna_3_r2 t3 rna cyto
> rpf_0_r1 t0 rpf cyto
> rpf_1_r1 t1 rpf cyto
> rpf_2_r1 t2 rpf cyto
> rpf_3_r1 t3 rpf cyto
> rpf_0_r2 t0 rpf cyto
> rpf_1_r2 t1 rpf cyto
> rpf_2_r2 t2 rpf cyto
> rpf_3_r2 t3 rpf cyto
> rna_0_r1 t0 rna crude
> rna_1_r1 t1 rna crude
> rna_2_r1 t2 rna crude
> rna_3_r1 t3 rna crude
> rna_0_r2 t0 rna crude
> rna_1_r2 t1 rna crude
> rna_2_r2 t2 rna crude
> rna_3_r2 t3 rna crude
> rpf_0_r1 t0 rpf crude
> rpf_1_r1 t1 rpf crude
> rpf_2_r1 t2 rpf crude
> rpf_3_r1 t3 rpf crude
> rpf_0_r2 t0 rpf crude
> rpf_1_r2 t1 rpf crude
> rpf_2_r2 t2 rpf crude
> rpf_3_r2 t3 rpf crude
I would like to study the effect of (rpfcrude/rpfcyto)/(rnacrude/rnacyto) at every time point. How should I write the formula for this problem? Is it time + assay + type + assay:time + assay:type + type:assay?
Thank you
A question about how you want to incorporate time: do you want to compare time points to t0? Or do you want to compare that ratio within each time point alone?
Hi Mike,
Thanks for the reply, I want to compare both ie to t0 and ratio within each time point alone.
I think you want a design of
~time + assay + cond + cond:assay + time:assay + time:cond + time:cond:assay
.If you arrange the colData such that the times are grouped together, it's clearer that the above design gives you a simple 2x2 interaction model for time=0, and then the other time points also have 2x2 interactions but comparing to time=0.
On the other hand, to get simple 2x2 for each time point, where the time points are not compared to time=0, you can use
~time + time:assay + time:cond + time:cond:assay
.Hi Mike,
Thank for the help! I'm sorry if I want to clarify other things. I ran the it with design
~ time + assay + cond + cond:assay + time:assay + time:cond + time:cond:assay
as you suggested. I changed 'cyto' to 'a' and 'crude' to 'b' for simplicity. This is the resultsNames that I getDoes "time _t1 _vs _t0" mean looking at "RNA _a time1" vs "RNA _a time0" ?
Does "timet1.assayrpf" mean looking at "RPF _a time1/RNA _a time1" vs "RPF _a time0/RNA _a time0" (or equivalently, "RPF _a time1/RPF _a time0" vs "RNA _a time1/RNA _a time0")?
Does "timet1.condb" mean looking at "RNA _b time1/RNA _b time0" vs "RNA _a time1/RNA _a time0" ?
Does "timet1.assayrpf.condb" mean looking at "RPF _b time1/RPF _a time1" vs "RNA _b time1/RNA _a time1" with all terms compared to time0?
Thank so much for the help!
For the interpretation of the coefficients, I’d recommend working with a statistician. If you take a look at the design matrix itself (plugging in to model.matrix for example), you can get an idea how the coefficients are used to explain various differences across samples.
Hi, Mike,
Okay, will do! Thanks so much for the help :)