I'm an undergrad student who is just getting to grips with bioinformatics/RNAseq and appear to have ran into a common novice error with DESeq2. This is the code I am trying to run:
dds <- DESeqDataSetFromMatrix(countData = rna_counts,
+ colData = rna_design, design = ~ condition )
Error in DESeqDataSetFromMatrix(countData = rna_counts, colData = rna_design, :
ncol(countData) == nrow(colData) is not TRUE
I understand completely why this is happening, but am just looking on guidance of how to fix it. This is what my count and metadata looks like:
> head(rna_counts)
featureid s69 s70 s71 s75 s76 s77
1 ENSG00000000003 1 1 0 8 2 1
2 ENSG00000000005 0 0 0 0 0 0
3 ENSG00000000419 993 469 664 1172 491 685
4 ENSG00000000457 385 207 235 610 226 353
5 ENSG00000000460 849 436 522 1002 430 608
6 ENSG00000000938 26 6 12 75 43 44
> rna_design
sample.id condition
1 s69 control
2 s70 control
3 s71 control
4 s75 treated
5 s76 treated
6 s77 treated
How should I make these dimensions compatible?
Thanks a lot Kevin, that was exactly what I was looking for. Have a nice day!