I am working with a complex experiment design shown below and I am not able to build the appropriate design matrix. I looked through the DESeq2 manual and this blog and tried different designs and every time I am getting error as "Design matrix not of full rank".
Patients highlighted in orange are unpaired (i.e. have only pre-treatment data). I also introduced ind.n column as suggested by DESeq2 manual but may not be necessary in the design.
I am interested in DE testing for:
- ResistantvsSensitive considering the patients effect
- PostvsPre considering the patients effect (All samples)
- PostvsPre considering the patients effect (within Resistant group)
- PostvsPre considering the patients effect (within Sensitive group)
Can you please suggest the best possible design matrix?
Also, a very naive question - I have seen design examples starting with "~1", "~0 + ". What is the difference between the two? I found the explanations for - 1. Dependent and independent variables represented on either side of ~ symbol 2. Interaction are represented with : symbol. But I am unsure of "~1" and "~0 +" designs.