Error in DESeqDataSetFromMatrix /.../ ncol(countData) == nrow(colData) is not TRUE
1
0
Entering edit mode
8 months ago
Nick • 0

Hey all,

I'm kind of at my wit's end here... I know other's have posted similar errors, and I've eliminated the trivial (extra column) type causes.

> ddsPlin2wtvsko <- DESeqDataSetFromMatrix(countData=countData, colData=metaData2,
 design=~genotype, tidy = TRUE)

Error in DESeqDataSetFromMatrix(countData = countData, colData = metaData2,  : 
  ncol(countData) == nrow(colData) is not TRUE

> all(colnames(countData) == rownames(metaData2))

TRUE

> class(countData)

"matrix" "array" 

> class(metaData2)

"matrix" "array" 

> dim(as.matrix(countData))

54309     8

> dim(as.matrix(metaData2))

8 4

> all(colnames(countData) == rownames(metaData2))

TRUE

Why am I getting an "ncol(countData) == nrow(colData) is not TRUE" error?!?

DESeq2 R • 426 views
ADD COMMENT
1
Entering edit mode
8 months ago

The quick thing to try: try tidy = FALSE

ADD COMMENT
0
Entering edit mode

You, beauty! I'm totally baffled as to why there was an error, but at least I've moved past the banging head against wall stage.

> ddsPlin2wtvsko <- DESeqDataSetFromMatrix(countData=countData, colData=metaData2 design=~genotype, tidy = FALSE)

converting counts to integer mode
Warning message:
In DESeqDataSet(se, design = design, ignoreRank) :
  some variables in design formula are characters, converting to factors
ADD REPLY
0
Entering edit mode

Those messages are not problems. You want raw counts to be integers, and you probably want your design elements to be factors.

ADD REPLY

Login before adding your answer.

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