From 1ab8331aecbbab9d7f8fad3683e0e75f7af3fe2d Mon Sep 17 00:00:00 2001 From: Vasco Elbrecht Date: Wed, 23 Aug 2017 15:20:47 +0200 Subject: [PATCH] denoise discarded reads fix discarded reads were previously misscounted --- JAMP/R/Denoise.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JAMP/R/Denoise.R b/JAMP/R/Denoise.R index 9a585f2..de84043 100755 --- a/JAMP/R/Denoise.R +++ b/JAMP/R/Denoise.R @@ -206,10 +206,10 @@ names(data)[i+2] <- sub("_data/3_unoise/(.*)_denoised.txt", "\\1", denoised_sequ data <- cbind(data, "sequences"=unlist(haplotypes), stringsAsFactors=F) # sort by OTUs -data <- data[order(as.numeric(sub("OTU_", "", data$OTU))),] +data <- data[order(suppressWarnings(as.numeric(sub("OTU_", "", data$OTU)))),] data <- cbind("sort"=1:nrow(data), data) -data <- rbind(data, c(nrow(data)+1, NA, "rm_bydenoising", counts, NA)) +data <- rbind(data, c(nrow(data)+1, NA, "rm_bydenoising", counts-colSums(data[4:(ncol(data)-1)]), NA)) dir.create("_data/4_denoised")