Question: DEseq2 ncol(countData) == nrow(colData) is not TRUE Error
0
gravatar for trumbia
4 weeks ago by
trumbia0
trumbia0 wrote:

Hello'

I have an error of ncol(countData) == nrow(colData) is not TRUE when I tried to set matrix. Code is below:

countdata = read.table('k.txt', header=TRUE, sep = "\t", row.names = 1, as.is=TRUE)

show(countdata) countdata <- as.matrix(countdata)

head(countdata)

condition <- factor(c(rep("x", 2), rep("y", 2),rep("z", 2),rep("t", 2)))

show(condition)

library(DESeq2)

coldata <- data.frame(skip=colnames(countdata), condition)

show(coldata)

dds <- DESeqDataSetFromMatrix(countData=countdata, colData=coldata, design=~condition) # here is it gave an error

dds <- DESeq(dds)

Also my data file like this

       x  y z t

b1 5 6 7 8

b2 3 4 5 6

Could you help me? Thanks

deseq2 • 135 views
ADD COMMENTlink modified 4 weeks ago • written 4 weeks ago by trumbia0
Answer: DEseq2 ncol(countData) == nrow(colData) is not TRUE Error
0
gravatar for Michael Love
4 weeks ago by
Michael Love24k
United States
Michael Love24k wrote:

You can probably debug this on your end. The counts matrix needs to have same number of columns as the sample table (colData) has rows, because columns of the counts matrix are matched with samples (they must also be in the same order, DESeq2 assumes same order in both).

ADD COMMENTlink modified 4 weeks ago • written 4 weeks ago by Michael Love24k

I can not debug this one. I guess i have problem about generating coldata but I still could not figure out

ADD REPLYlink written 29 days ago by trumbia0

Maybe you can connect with a bioinformatics group at your institute to work through use of R? Basically you need to provide DESeq2 with the correct data first and it checks to see if basic rules have been followed. One of these is that the sample information is consistent with the number of samples. You can also try to learn about using R online, from eg the free courses or Quick-R.

ADD REPLYlink written 29 days ago by Michael Love24k
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 16.09
Traffic: 217 users visited in the last hour