This is a test version of Biostars. For the public version, visit https://www.biostars.org.
DESeq2 - Changing the order of counts / metadata

Dear team,

Sorry to ask a basic questions but i m getting an error in RStudio:

Error in DESeqDataSetFromMatrix(countData = counts, colData = metadata,  : 
  rownames of the colData:
   SRR1979370,SRR1979371,SRR1979372,SRR1979373,SRR1979374,SRR1979375 
  are not in the same order as the colnames of the countData:
   SRR1979370,SRR1979372,SRR1979375,SRR1979374,SRR1979373,SRR1979371

Please may i know code to change the order so that i can then run this using:

dds <- DESeqDataSetFromMatrix(countData=counts, colData=metadata, design=~genotype)

Thank you,

Himan

counts metadata deseq2

What is unclear about these two lines not being in the same order?

SRR1979370,SRR1979371,SRR1979372,SRR1979373,SRR1979374,SRR1979375

SRR1979370,SRR1979372,SRR1979375,SRR1979374,SRR1979373,SRR1979371

It appears that you need to match counts and metadata.

You can do something like

colData <- colData[colnames(countData), ]

to bring those two in the same order.

0 answers

No answers yet.

Log in to answer this question.