Entering edit mode
2.5 years ago
mcsimenc
▴
20
I'm trying to make a DESeqDataSet for comparing against multiple controls using a design matrix specifying set, group, and batch, where set specifies which set of groups to compare. I want to compare each group vs its control within a set while controlling for batch effects. But sometimes a batch has only one set and other times it has multiple sets.
My design is:
design = ~ Group + Set + Batch
The error I'm getting is:
Error in DESeqDataSet(se, design = design, ignoreRank) :
design contains one or more variables with all samples having the same value,
remove these variables from the design
Here is a snippet from my design matrix:
I want to compare:
Set1_Group1
vsSet1_Group0
Set1_Group2
vsSet1_Group0
Set2_Group1
vsSet2_Group0
Set3_Group1
vsSet3_Group0
Is it possible to do this?
batch1 is perfectly confounded with set1, so you can't separate the effect of batch1 from set1. However, since all of your desired comparisons are within sets, and every set is contained within the same batch, it's likely fine to remove the batch variable.
I see, thanks rpolicastro. I would still want to remove the batch effect for batch 5. Is this possible? If I use only the subset of the design matrix for batch 5 and
design = ~ Group + Set + Batch
I get the same error.If you only subset the Batch5 samples, they all have the same batch so nothing can be done.
I understand. Thank you!