Question: Receiving error trying to import matrix into DESeq2
gravatar for rbronste
12 months ago by
rbronste60 wrote:

I am trying the following code and getting an error I am unsure how to fix:

rownames(countData) <- countData[,1]
countData[,1] <- NULL

sampleNames<-c("MB1",    "MB2",    "MB3",    "FB1",    "FB2",    "FB3",    "MM1",    "MM2",    "MM3",    "FM1",    "FM2",    "FM3")
sampleSex<-c("male", "male", "male", "female", "female", "female", "male", "male", "male", "female", "female", "female")
sampleAge<-c("p14", "p14", "p14", "p14", "p14", "p14", "p14", "p14", "p14", "p14", "p14", "p14")
colData<-data.frame(sampleName=sampleNames, sex=sampleSex, age=sampleAge)

dds<-DESeqDataSetFromMatrix(countData = countData,
                            colData = colData,
                            design = ~ sex + age + age:sex)

Receiving the following error, I think having something to do with the way my input matrix is designed - as it was imported from diffbind so is not a list of genes but rather a list of binding counts from which I cut the chromosome start-end sites:

Error in DESeqDataSet(se, design = design, ignoreRank) :
  design contains one or more variables with all samples having the same value,
  remove these variables from the design


Thanks for your help!

ADD COMMENTlink modified 12 months ago by Andy9160 • written 12 months ago by rbronste60
gravatar for Andy91
12 months ago by
Andy9160 wrote:

I cannot say anything about your count matrix as you would have to provide an example of it (i.e. head(countData)).

The error seems to suggest that your provided design matrix ("colData") is not well designed. If the provided example is what you are using, the issue would be that the "Age" object contains only one level: "p14". Assuming this covariate represents age, one cannot properly correct for age as all your samples are obtained from the same age, you cannot say something about a "p15" or "p16" for example. The same goes for the interaction between "Age" and "Sex". Try removing "Age" and "Age:Sex" and see whether that works.

ADD COMMENTlink modified 12 months ago • written 12 months ago by Andy9160
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 365 users visited in the last hour