I am trying to perform differential gene expression analysis, but i'm having trouble integrating data to edgeR library.
here is the code i'm running
dir<-"/Users/timofei.ivanov/mice_project/results" setwd(dir) samples=read.table(file.path(dir, "INDEX_FILE"), header = TRUE) files=file.path(samples$results_name) names(files)=samples$sample print(files) txi.rsem <- tximport(files, type = "rsem", txIn = FALSE, txOut = FALSE,countsFromAbundance = "lengthScaledTPM") library(edgeR) cts <- txi.rsem$counts normMat <- txi.rsem$length normMat <- normMat/exp(rowMeans(log(normMat))) o <- log(calcNormFactors(cts/normMat)) + log(colSums(cts/normMat))
and at the last line i got an error
Error in calcNormFactors.default(cts/normMat) : NA counts not permitted
I've googled the problem, and it points to this:
Do not do this: Do not manually pass
txi$counts alone to downstream methods, if you have left
countsFromAbundance="no". This is simply passing the summed estimated counts, and does not correct for potential differential isoform usage, which is the point of the tximport methods and package (Soneson, Love, and Robinson 2015). Passing uncorrected counts alone is not recommended by the tximport package authors.
But when i try to change the countsFromAbundance parameter of function tximport, it just won't change, yet raise no error.
What am i doing wrong?