Ahhh yes opps my bad. I was geeting cofused looking at some DESeq2 documentation about data orientation ! Thanks for point it out for me :)
I am running deseq2 on a matric of species abundance persample from a metagenomic dataset and am getting the following error:
Error in DESeqDataSetFromMatrix(countData = data, colData = metadata, :
ncol(countData) == nrow(colData) is not TRUE
I get what the error is telling me but I dont understand why DESeq requiers this satisfaction. Why does the number of samples and number of genes (in this case species) need the be the same? Or am I missundstanding something here?
The code generating this error is :
ddsFullCountTable = DESeqDataSetFromMatrix(
countData = data,
colData = metadata,
design = Caste_composite
)
Any help would be appriciated :)
2 answers
Just to follow up what ATpoint said - your colData (here that is metadata) should contain a row for each sample in the analysis, which your countData (here that is data) should contain one column for each sample. Therefore the number of rows in colData should be the same as the number of columns in countData and both should be equal to the number of samples in the study.
Why does the number of samples and number of genes (in this case species) need the be the same? Or am I missundstanding something here?
It talks about colData, not the columns of your matrix. Please show the colData (metadata) and the colnames of your count matrix.
No problem at all :) If you need anything else just let us know.
Log in to answer this question.
Hi, I am running DEseq for analysing a count data file generated by ht-seq. I am running the following command after creating a separate file metadata with all the information from the Count.csv. i can see that there are 8 columns including gene in the cts where as in metadata i have 7 rows. As i understand this must be equal, but how to make them equal?
Please help me fix this error.
Go look at a DESeq2 vignette, like this one:
https://bioconductor.org/packages/release/bioc/vignettes/DESeq/inst/doc/DESeq.pdf
See how neither their count data nor their metadata has row numbers, and you do? Fix that.
Thank you, this was helpful. As per this link,I generated the phenodata (table) using scripts and it worked.
Dear Sujit, this is a new question and should not be posted as an answer to an existing question. Can you please repost this in its own question.
Sorry for writing here, i have followed your suggestions in other threads and that has been quite helpful. I posted the question here so that i could get your reply. Thankfully its solved now.