Receiving error trying to import matrix into DESeq2
1
0
Entering edit mode
rbronste ▴ 60
@rbronste-12189
Last seen 5.1 years ago

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

countData<-read.csv("p14_binding.csv")
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!

LANGUAGE_DETECTION = []
deseq2 deseq differential binding analysis • 1.2k views
ADD COMMENT
2
Entering edit mode
Andy91 ▴ 60
@andy91-8905
Last seen 3.1 years ago
Netherlands

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 COMMENT

Login before adding your answer.

Traffic: 659 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