I'm using DESeq2 to do differentially expression analysis. I have 8 liver slices from control group, and 6 liver slices from treatment group. So the purpose is to find out the differentially expressed genes between these two groups. But those slices are not independent: slices from control group the slices from treatment group may come from the same fish.
I'm using DESeq2 package in R, so my colData looks like:
samples fishGroup expGroup
1 Sample1 1 control
2 Sample12 3 control
3 Sample18 4 control
4 Sample25 5 control
5 Sample31 6 control
6 Sample38 7 control
7 Sample44 8 control
8 Sample6 2 control
9 Sample11 2 treat
10 Sample17 3 treat
11 Sample24 4 treat
12 Sample30 5 treat
13 Sample37 6 treat
14 Sample50 8 treat
If I perform DESeq2 based on independent sample test, then only "expGroup" will be used:
dds_independent <- DESeqDataSetFromMatrix(countData, colData, design = ~expGroup)
But that will miss the samples' pair information. So I guess that the paired sample test is better.
In the section of "Model matrix not full rank" from vignette('DESeq2')
, it seems to discuss about this problem, to use a design like this: design = ~ expGroup + fishGroup
. I'm no expert on statistics, but it seems that the two factors are treated equally, but in my understanding, expGroup should be first, and fishGroup only gives the pair information.
By the way, design = ~ expGroup + fishGroup + expGroup:fishGroup
(which I don't know the exact meaning) throws out an error:
Error in checkFullRank(modelMatrix) :
the model matrix is not full rank, so the model cannot be fit as specified.
Levels or combinations of levels without any samples have resulted in column(s) of zeros in the model matrix.
So anyone has any idea of how to design the "design" to tell DESeq2 to do a paired sample test?
It is problematic since you don't have matching for all fish - have you tried running it for just the matched samples. You could use edgeR where you can precompute a design matrix and check it before running your diffex analysis. Or you could use voom, with a 'block' over your fishGroup (not sure how that behaves with singletons in the block though).
Still want to stick to DESeq2. Tried deleting the non-matching samples, but got strange results. Refer to my reply to Devon Ryan