This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeqDataSetFromMatrix error

I am trying to do deseq2 analysis,

This is my count matrix (sample): gene MESO-N1 MESO-N2 MESO-N3 1060P11.3 2 0 0 LNP 18 228 110

This is my sample information: Sample Group Cancer_Type MESO-N1 Control healthy MESO-N2 Control healthy MESO-N3 Control healthy

The problem is that I keep getting this error : Error in DESeqDataSetFromMatrix(countData = count_data, colData = sample_info, : ncol(countData) == nrow(colData) is not TRUE

I know it has to do with the gene column but as you know i need that for the deseq analysis. So what do i do to avoid this error? What code can i use?

deseq

1 answer

in general, in R data tables, the first column does not have a name. You need to make a data table such that the gene column is the row names, with three columns of count data. What R probably thinks you have there is a table with 4 columns of data. You should confirm this yourself by asking R for the dimensions of your count_data table.

Thank you.

Log in to answer this question.