# Differential expression analysis when nested effects

I have 3 tumour samples from 3 patients from an experiment, I also downloaded 10 normal samples from TCGA. My design is like this

> mycols
condition batch
normal1           normal     1
normal2           normal     1
normal3           normal     1
normal4           normal     1
normal5           normal     1
normal6           normal     1
normal7           normal     1
normal8           normal     1
normal9           normal     1
normal10          normal     1
OESO_036_a_RNA    cancer     2
OESO_013_a_RNA    cancer     2
OESO_005_a_RNA    cancer     2
>


But DESeq2 returns error when trying for differential expression analysis

> dds <- DESeqDataSetFromMatrix(countData=counts, colData=mycols, design=~batch+condition)
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')
In addition: Warning message:
In DESeqDataSet(se, design = design, ignoreRank) :
some variables in design formula are characters, converting to factors


Then how I could extract deferentially expressed genes between tumour and normal samples while they are coming from two different batches?

• Did you read the vignette section "Model matrix not full rank"? The problem here is that there is no way you can distinguish the effect of being normal and the effect of being sequenced on batch 1, you have the two effects affecting the same samples! – llrs Mar 21 '19 at 15:12
• There should be a solution for this case , is not it? – Exhausted Mar 21 '19 at 16:23
• Not unless you have some normal and cancer samples that you can resequence in a third batch. (But perhaps you don't have a batch effect, but I wouldn't bet anything on this) – llrs Mar 21 '19 at 16:37