Error in DESeqDataSetFromMatrix
1
0
Entering edit mode
@laurenfitch-11575
Last seen 4.0 years ago

I'm trying to set up a DEG analysis with deseq2. I've been getting an error running DESeqDataSetFromMatrix and I haven't been able to figure out the source from the error message.

> dim(countdata)
[1] 34722   112
> dim(samples)
[1] 112   4

> identical(sort(colnames(countdata)), sort(rownames(samples)))
[1] TRUE

> dds <- DESeqDataSetFromMatrix(
+             countData = countdata,
+             colData = samples,
+             design = ~Dose+Compound     #must match testConditon
+         )
Error in DESeqDataSetFromMatrix(countData = countdata, colData = samples,  : 
  rownames of the colData:
   Vehicle_A_Liver_16399,Vehicle_A_Liver_16400

It goes on to list many but not all of the colnames of countdata, which leads me to think that something is wrong with that, but I've confirmed above that the colnames of the count table and the rownames of the sample table are identical. Any help would be appreciated.

deseq2 error • 3.4k views
ADD COMMENT
2
Entering edit mode
@james-w-macdonald-5106
Last seen 1 hour ago
United States

You showed they are identical after you sorted them. They have to be in the same order to begin with.

ADD COMMENT
0
Entering edit mode

Did not know that was a requirement, thank you! 

ADD REPLY
0
Entering edit mode

A DESeqDataSet is a subclass of a RangedSummarizedExperiment, and the colData slot is intended to describe the columns of the 'assays' slot. So there is a check when you instantiate a new object that the rownames of the colData and the colnames of the samples (which ends up in the 'assays' slot) are identical.

That's one of the nice things about using data structures like this - they ensure that what you put together makes sense (for some definition of 'makes sense'), so it's hard to make errors that in retrospect would look silly, like mixing up which samples are which.

ADD REPLY

Login before adding your answer.

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