From e9c06944e51002a491294843c2dade047bacf6ff Mon Sep 17 00:00:00 2001 From: Kasper Skytte Andersen Date: Thu, 29 Sep 2022 16:54:24 +0200 Subject: [PATCH] fix #149 --- DESCRIPTION | 4 ++-- R/internals.R | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 348d5ba..4c334d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: ampvis2 Type: Package Title: Tools for visualising amplicon data Description: ampvis2 is a small set of tools that allows effortless visualisation of amplicon data. -Version: 2.7.31 +Version: 2.7.32 Authors@R: c( person( c("Kasper", "Skytte"), "Andersen", @@ -68,5 +68,5 @@ Suggests: doParallel, foreach, patchwork -RoxygenNote: 7.2.0 +RoxygenNote: 7.2.1 Config/testthat/edition: 3 diff --git a/R/internals.R b/R/internals.R index f79c81c..354b0fd 100644 --- a/R/internals.R +++ b/R/internals.R @@ -549,12 +549,12 @@ filter_otus <- function(data, filter_otus = 0) { #dont normalise if (isTRUE(abundAreCounts(data))) { - abund_tmp[, .rel_abund := count/sum(count), by = ".SampleID"] + abund_tmp[, .rel_abund := count/sum(count)*100, by = ".SampleID"] } else if (isFALSE(abundAreCounts(data))) { abund_tmp[, .rel_abund := count] } - abund_tmp <- abund_tmp[,.SD[any(.rel_abund >= filter_otus/100)], by = "OTU"] + abund_tmp <- abund_tmp[,.SD[any(.rel_abund >= filter_otus)], by = "OTU"] OTUs_keep <- abund_tmp[, unique(as.character(OTU))] data$abund <- data$abund[OTUs_keep, , drop = FALSE]