rrna-seq

edgeR: Error in optimize(commonCondLogLikDerDelta, interval = c(1e-04, 100/(100 + : invalid 'tol' value


RNA seq of bacterial supernatants with four conditions (groups "1", "2", "3", "4"). All conditions are in quadruplicate (except condition 2, which is in triplicate). Error arises at estimateCommonDisp from the edgeR library in this pipeline.

annotation <- data.frame("GeneID" = cds$locus_tag, "chr" = cds$V1 , "start" = cds$V4 , "end" = cds$V5, "strand" = cds$V7)

bams <- dir(path = "./data/input/reads/bams", pattern = "*.BAM", full.names = T, recursive = F)
ann <- annotation
fc_SE <- featureCounts(files = bams, annot.ext = ann, isPairedEnd = T, nthreads = 20)
write.csv(fc_SE$counts, "./data/input/counts.csv", quote = F, row.names = T)
write.csv(fc_SE$stat, "./data/input/stats.csv", quote = F, row.names = T)

counts <- read.csv("./data/input/counts.csv", header = T)
rownames(counts) <- counts[ , 1]

x <- counts[ , 2:16]

group <- factor(c("3", "3", "3", "3", "1", "1", "1", "1", "4", "4", "4", "4", "2", "2", "2"))

y <- DGEList(counts = x, group = group)
design <- model.matrix(~0 + group, data = y$samples)
keep <- filterByExpr(y)
y <- y[keep, keep.lib.sizes = F]
y <- calcNormFactors(y)
y <- estimateCommonDisp(y, design)

results in:

Error in optimize(commonCondLogLikDerDelta, interval = c(1e-04, 100/(100 + : invalid 'tol' value

everything is good until the last line (y <- estimateCommonDisp(y, design)). I've found if I remove "design" from this (y <- estimateCommonDisp(y) it will run; however, I assume this screws up the data.


Solution

  • See if it helps.

      y <- estimateCommonDisp(y, group=design)