Hi,
I'm new to this forum and I got a question doe DESeq2 concerning model design and contrast, because my model design is not full ranked. I read multiple threads before and still did not understand how to proceed correctly.
I have 16 samples of single end Illumina reads. With 4 different treatments (group). Per treatment I have 4 biological replicates (indi). Unfortunately, the biological replicates are not evenly distributed across both used flowcells (flow). I am interested in the differences between the different treatments (group) and how to correctly get rid of the batch effect, if thats even possible. I followed the DESeq2 manual for this particular case as follows:
Here my meta matrix for the samples:
Like in the manual I first built my design matrix like so:
This workaroud should allow me, to get the differences between treatments within one batch:
Resulting in a new meta table:
But how do I use the contrast, to get the differences between treatment T1 versus T2 with the elimination of the batch effect of the flowcells. Is this possible?
Can I maybe just do something like this:
I'm new to this forum and I got a question doe DESeq2 concerning model design and contrast, because my model design is not full ranked. I read multiple threads before and still did not understand how to proceed correctly.
I have 16 samples of single end Illumina reads. With 4 different treatments (group). Per treatment I have 4 biological replicates (indi). Unfortunately, the biological replicates are not evenly distributed across both used flowcells (flow). I am interested in the differences between the different treatments (group) and how to correctly get rid of the batch effect, if thats even possible. I followed the DESeq2 manual for this particular case as follows:
Here my meta matrix for the samples:
Code:
group indi flow T1 I1 A T1 I2 A T1 I3 B T1 I4 B T2 I1 A T2 I2 A T2 I3 B T2 I4 B T3 I1 A T3 I2 A T3 I3 B T3 I4 B T4 I1 A T4 I2 A T4 I3 B T4 I4 B
Like in the manual I first built my design matrix like so:
Code:
ds_txi <- DESeqDataSetFromTximport(txi = txi_salmon, colData = meta, design = ~ indi+group) ds_txi$indi_n <- c("I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2") meta$indi_n <- c("I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2","I1","I2") meta$indi_n <- as.factor(meta$indi_n) ds_txi$indi_n <- as.factor(ds_txi$indi_n) ds_txi <- DESeqDataSetFromTximport(txi = txi_salmon, colData = meta, design = ~ flow + flow:indi_n + flow:group)
This workaroud should allow me, to get the differences between treatments within one batch:
Code:
dss <- DESeq(ds_txi) res <- results(dss,contrast=list("flowA.groupT1","flowA.groupT2"), alpha= p_adjust_treshold, lfcThreshold = L2FC_treshold)
Code:
group indi flow indi_n T1 I1 A I1 T1 I2 A I2 T1 I3 B I1 T1 I4 B I2 T2 I1 A I1 T2 I2 A I2 T2 I3 B I1 T2 I4 B I2 T3 I1 A I1 T3 I2 A I2 T3 I3 B I1 T3 I4 B I2 T4 I1 A I1 T4 I2 A I2 T4 I3 B I1 T4 I4 B I2
Can I maybe just do something like this:
Code:
res <- results(dss,contrast=list(c("flowA.groupT1","flowB.groupT1"),c("flowA.groupT2","flowB.groupT2")), alpha= p_adjust_treshold, lfcThreshold = L2FC_treshold)