I am using DESeq2 library following the manual 3.2 Starting from count matrices. I have my countdata and coldata imported from CSV files. I understand that countdata file can be a problem here but I don't understand what's the problem exactly.
library(DESeq2) NGS <- read.csv2(paste0(datadir,"/CLN3_NGS_orig.csv"), header = T,stringsAsFactors = F) Sinfo <- read.csv2(paste0(datadir,"/Sampleinfo.csv"), header = T,stringsAsFactors = F) head(NGS) head(Sinfo) coldata <- DataFrame(Sinfo) coldata <- lapply(coldata, as.factor) coldata lapply(NGSnum, class) NGSnum <- data.frame(NGS, apply(NGS[2:13],2, as.numeric)) NGSFull <- DESeqDataSetFromMatrix( countData = NGSnum, colData = coldata, design = ~ Genotype + Treatment) NGSFull NGS$Genotype <- relevel(NGSFull$Genotype, "WT") deseqNGS <- DESeq(NGS) res <- results(deseqNGS) res
My error after appyling DESeqDataSetFromMatrix:
Error in `rownames<-`(`*tmp*`, value = colnames(countData)) : attempt to set 'rownames' on an object with no dimensions
By the way, my countdata contain transcripts, sometimes several transcripts (ENST) correspond to single gene (ENSG). Can DESeq2 sort it out for me and give me only output with genes? It is easy to convert transcripts to genes but harder to make one position out of several.
Thank you in advance,