Skip to content

Commit

Permalink
fix #149
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperSkytte committed Sep 29, 2022
1 parent 5cff89d commit e9c0694
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -68,5 +68,5 @@ Suggests:
doParallel,
foreach,
patchwork
RoxygenNote: 7.2.0
RoxygenNote: 7.2.1
Config/testthat/edition: 3
4 changes: 2 additions & 2 deletions R/internals.R
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit e9c0694

Please sign in to comment.