This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Deseq2 model matrix error

I have trying to do Deseq2 analysis for mainly mutants vs controls. I have two covariates influencing the dataset - Gender and Genotype.

This is how my sample annotation file looks -

sample  condition   genotype    gender    
SK01    mutant  hr  F
SK02    mutant  hr  F
SK03    mutant  hr  M
SK04    mutant  hr  F
SK07    control het M
SK08    control het F
SK09    control het M
SK10    control het F
SK11    control hd  F
SK12    control hd  F

dds <- DESeqDataSetFromMatrix(countData = count_matrix,
                               colData = sample_annotation, 
                               design = ~ gender + genotype + condition)

I am getting error

the model matrix is not full rank, so the model cannot be fit as specified

I saw a couple of issues earlier (https://support.bioconductor.org/p/64480/) but I am not understanding what to do for my case?

Do I need to change my annotation file?

Can someone please explain this in a simple way. I am not a biostatistician.

rnaseq

1 answer

Did you look in the vignette? Condition is nested in Genotype. You can't include both in the design. And with such a small set of samples, you might not be able to include sex in the design either.

Log in to answer this question.