Search
Question: Receiving error trying to import matrix into DESeq2
0
gravatar for rbronste
4 months ago by
rbronste50
rbronste50 wrote:

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 = []
ADD COMMENTlink modified 4 months ago by Andy9130 • written 4 months ago by rbronste50
2
gravatar for Andy91
4 months ago by
Andy9130
Netherlands
Andy9130 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 4 months ago • written 4 months ago by Andy9130
Please log in to add an answer.

Help
Access

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