Skip to content

Commit

Permalink
More robust norm-from-counts
Browse files Browse the repository at this point in the history
  • Loading branch information
pfh committed Oct 4, 2016
1 parent 85604ef commit 25db38e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nesoni/nesoni-r/R/counts.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ read.counts <- function(filename, min.total=0, min.max=0, keep=NULL, norm.file=N
cat(sprintf("%d genes after filtering\n", sum(good)))

result <- DGEList(counts=counts[good,,drop=F], genes=gene[good,,drop=F])
result$samples$lib.size <- pmax(1, result$samples$lib.size)

mean.lib.size <- exp(mean(log(pmax(1,result$samples$lib.size))))
mean.lib.size <- exp(mean(log(result$samples$lib.size)))

if (!have.norm) {
if (use.tmm) {
Expand Down

0 comments on commit 25db38e

Please sign in to comment.