This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to include geneIDs in colData and countData format in DESeq2?

Hi everyone,

I'm trying to analyse a bunch of ribo-seq samples using DESeq2.

I know that ncol(countData) == nrow(colData) should evaluate TRUE.

But I don't know how to input GeneIDs in this case.

Currently, my colData looks as follows:

> coldata
     Sample  Treatment
[1,] "cts46" "Untr"    
[2,] "cts47" "Ifn"        
[3,] "cts48" "Vir"       
[4,] "cts49" "Ifn-Vir"  
[5,] "cts50" "Ltm-Untr"  
[6,] "cts51" "Ltm-Ifn"   
[7,] "cts52" "Ltm-Vir"   
[8,] "cts53" "Ltm-Ifn-Vir"

... and my countData as follows:

> head(countdata)
                 key cts46 cts47 cts48 cts49 cts50 cts51 cts52 cts53 
1  ENST00000000233.9     4     0     1     1     4     3     2     4 
2  ENST00000000412.7     0     0     0     0     0     1     0     0 
3 ENST00000000442.10     0     0     0     0     0     0     0     0 
4  ENST00000001008.5     1     1     2     2    67    72    31    43 
5  ENST00000001146.6     0     0     0     0     0     0     0     0 
6  ENST00000002125.8     0     0     0     0     0     0     0     0

...etc.

If ncol(countdata) is equal to the number of samples, then where will the geneIDs go? I would have thought ncol(countdata) == nrow(coldata) + 1. Sorry if I've missed something in the documentation. I've found it a little difficult to understand at times. Thanks for any help working this out.

deseq2 rna-seq

1 answer

You should make your leftmost columns of both datasets into rownames, instead of having row numbers

Thanks so much! This worked :)

Log in to answer this question.