Hi,
I have two groups of mice - wild type and mutant in which every mice had one brain hemisphere treated/damaged (ipsi) and one hemisphere healthy (contra). I would like to assess if there is a difference in response to the treatment between WT and MUT. Another question is if the healthy hemispheres differ significantly in gene expression levels (mut vs. wt).
> head(metaData)
ID genotype hemi
1 WT_1 WT Contra
2 WT_2 WT Contra
3 WT_3 WT Contra
4 WT_1 WT Ipsi
5 WT_2 WT Ipsi
6 WT_3 WT Ipsi
Based on another topic (DESEq2 Paired samples Before and after treatment ) I made my design as:
~ mouseID + hemi* genotype
But I got an error message:
Error in checkFullRank(modelMatrix) : the model matrix is not full rank, so the model cannot be fit as specified. One or more variables or interaction terms in the design formula are linear combinations of the others and must be removed.Please read the vignette section 'Model matrix not full rank': vignette('DESeq2')
I read a vignette but I am still not sure how to change the design so it reflects my question (how the genotype affects the response to treatment). Or is there something I am doing wrong with the IDs, should I add a column of "mice.n" similar as in the the topic I am referring to? In that topic I understand the additional column is required because of unequal number of patients in naive/second groups.
Thank you! Is the one below correct?
When you read the vignette, did you read the section about individuals nested within groups? If you want to compare within mouse, that section is relevant.
Hi Michael,
Thank you for pointing this out. I did not find this particular section reading the vignette before, now I understand that the additional column is the nested and it explains a lot. Thank you very much, I am not sure if I grasp the idea correctly but I will try and in case of troubles I will ask more precise questions.
edit: yes, it works perfectly, thank you so much!
So now I can use the coefficients to make contrasts - do I understand correctly that the contrast from the vignette example
(results(dds, contrast=list("grpY.cndB","grpX.cndB"))
and in my caseresults(dds, contrast=list("genotypeMUT.hemiIpsi","genotypeWT.hemiIpsi")))
is similar to Interaction term in the design with Interaction (ignoring the individuals)? I mean if I run this design:
which woudl give me the coefficients:
should I get similar result for
results(dds, name="genotypeMUT.hemiIpsi")
? Is this correct?For confirming that a particular statistical design is what you are intending, I'd recommend working with a statistician. Beyond what we've laid out in the vignette, I don't have sufficient time to follow up on the support site with statistical design questions.