Group-specific condition effect
1
0
Entering edit mode
claudia • 0
@ee208474
Last seen 18 days ago
Belgium

Hello,

I am facing a problem with the analysis of some data. I keep getting the error:

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.

I followed the instructions reported in the vignette of DESeq2 in case of Group-specific condition effect, which is the case of my experimental design, but I am not able to solve the problem. This is my script:

counts <- data.frame(final_counts_clean)

samples <- data.frame(condition=factor(rep(c("HN","LN"),each=6)),
phenotype=factor(rep(c("HLR", "FLR", "ALR"),each=2)),
                     genotype=factor(rep(c("A", "B", "C", "D", "E", "F"),4)),
                     rep=factor(rep(1:2, each=12)))

samples$ind.n <- factor(rep(rep(1:3,each=2),2))
as.data.frame(samples)
matrix<-model.matrix(~ condition + condition:ind.n + condition:phenotype, samples)
ds <- DESeqDataSetFromMatrix(countData=counts, 
                             colData=samples, 
                             design=matrix)

I don't have any "full zero" columns of missing interactions, which should be the cause of the error. I feel very lost.

DESeq2 • 90 views
ADD COMMENT
0
Entering edit mode
@kevin
Last seen 2 hours ago
Republic of Ireland

Hi, so far, this is what you have:

samples
   condition phenotype genotype rep ind.n
1         HN       HLR        A   1     1
2         HN       HLR        B   1     1
3         HN       FLR        C   1     2
4         HN       FLR        D   1     2
5         HN       ALR        E   1     3
6         HN       ALR        F   1     3
7         LN       HLR        A   1     1
8         LN       HLR        B   1     1
9         LN       FLR        C   1     2
10        LN       FLR        D   1     2
11        LN       ALR        E   1     3
12        LN       ALR        F   1     3
13        HN       HLR        A   2     1
14        HN       HLR        B   2     1
15        HN       FLR        C   2     2
16        HN       FLR        D   2     2
17        HN       ALR        E   2     3
18        HN       ALR        F   2     3
19        LN       HLR        A   2     1
20        LN       HLR        B   2     1
21        LN       FLR        C   2     2
22        LN       FLR        D   2     2
23        LN       ALR        E   2     3
24        LN       ALR        F   2     3

I am unsure why you are creating an interaction between condition and ind.n (?)

What is genotype?

I think that you could create a new 'group' variable, and use this as an interaction with genotype:

samples$group <- paste(samples$condition, samples$phenotype, sep = '_')
table(samples$group, samples$genotype)

         A B C D E F
  HN_ALR 0 0 0 0 2 2
  HN_FLR 0 0 2 2 0 0
  HN_HLR 2 2 0 0 0 0
  LN_ALR 0 0 0 0 2 2
  LN_FLR 0 0 2 2 0 0
  LN_HLR 2 2 0 0 0 0

dds <- DESeqDataSetFromMatrix(
  countData = counts,
  colData = samples,
  design = ~ group + genotype + group:genotype)

, or, if you don't need genotype, just use:

dds <- DESeqDataSetFromMatrix(
  countData = counts,
  colData = samples,
  design = ~ group)

Kevin

ADD COMMENT

Login before adding your answer.

Traffic: 731 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6