diff --git a/R/eucast_rules.R b/R/eucast_rules.R index 79d160a6..ee89bcbf 100755 --- a/R/eucast_rules.R +++ b/R/eucast_rules.R @@ -469,6 +469,7 @@ eucast_rules <- function(x, stop(e, call. = FALSE) } ) + tbl_[rows, cols] <<- tbl_original[rows, cols] after <- as.character(unlist(as.list(tbl_original[rows, cols]))) @@ -574,7 +575,6 @@ eucast_rules <- function(x, rule_group_previous <- eucast_rules_df[max(1, i - 1), "reference.rule_group"] rule_group_current <- eucast_rules_df[i, "reference.rule_group"] rule_group_next <- eucast_rules_df[min(nrow(eucast_rules_df), i + 1), "reference.rule_group"] - #no_of_changes <- 0 if (is.na(eucast_rules_df[i, 4])) { rule_text <- paste(eucast_rules_df[i, 6], "=", eucast_rules_df[i, 7]) } else { diff --git a/R/mo.R b/R/mo.R index 860a6bec..6c78c5b3 100755 --- a/R/mo.R +++ b/R/mo.R @@ -60,13 +60,13 @@ #' #' The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \code{?microorganisms}). #' -#' \strong{Self-learning algoritm} \cr -#' The \code{as.mo()} function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use \code{clean_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. -#' -#' Usually, any guess after the first try runs 80-95\% faster than the first try. -#' -#' For now, learning only works per session. If R is closed or terminated, the algorithms reset. This will probably be resolved in a next version. -#' +# \strong{Self-learning algoritm} \cr +# The \code{as.mo()} function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use \code{clean_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. +# +# Usually, any guess after the first try runs 80-95\% faster than the first try. +# +# For now, learning only works per session. If R is closed or terminated, the algorithms reset. This will probably be resolved in a next version. +# #' \strong{Intelligent rules} \cr #' This function uses intelligent rules to help getting fast and logical results. It tries to find matches in this order: #' \itemize{ diff --git a/R/mo_history.R b/R/mo_history.R index 54098efc..0274e5c5 100644 --- a/R/mo_history.R +++ b/R/mo_history.R @@ -22,6 +22,9 @@ # print successful as.mo coercions to AMR environment #' @importFrom dplyr %>% distinct filter set_mo_history <- function(x, mo, uncertainty_level, force = FALSE) { + # disable function + return(base::invisible()) + if (base::interactive() | force == TRUE) { mo_hist <- read_mo_history(uncertainty_level = uncertainty_level, force = force) df <- data.frame(x, mo, stringsAsFactors = FALSE) %>% @@ -55,6 +58,9 @@ set_mo_history <- function(x, mo, uncertainty_level, force = FALSE) { } get_mo_history <- function(x, uncertainty_level, force = FALSE) { + # disable function + return(NA) + history <- read_mo_history(uncertainty_level = uncertainty_level, force = force) if (base::is.null(history)) { NA @@ -67,6 +73,9 @@ get_mo_history <- function(x, uncertainty_level, force = FALSE) { #' @importFrom dplyr %>% filter distinct read_mo_history <- function(uncertainty_level = 2, force = FALSE, unfiltered = FALSE) { + # disable function + return(NULL) + if ((!base::interactive() & force == FALSE)) { return(NULL) } diff --git a/R/zzz.R b/R/zzz.R index 24f915a2..e9995bbb 100755 --- a/R/zzz.R +++ b/R/zzz.R @@ -45,13 +45,13 @@ value = make_trans_tbl(), envir = asNamespace("AMR")) - assign(x = "mo_history", - value = data.frame(x = character(0), - mo = character(0), - uncertainty_level = integer(0), - package_v = character(0), - stringsAsFactors = FALSE), - envir = asNamespace("AMR")) +# assign(x = "mo_history", +# value = data.frame(x = character(0), +# mo = character(0), +# uncertainty_level = integer(0), +# package_v = character(0), +# stringsAsFactors = FALSE), +# envir = asNamespace("AMR")) } diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 56fb4f43..1bd977fa 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -71,13 +71,6 @@ Use the \code{\link{mo_property}_*} functions to get properties based on the ret The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \code{?microorganisms}). -\strong{Self-learning algoritm} \cr -The \code{as.mo()} function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use \code{clean_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. - -Usually, any guess after the first try runs 80-95\% faster than the first try. - -For now, learning only works per session. If R is closed or terminated, the algorithms reset. This will probably be resolved in a next version. - \strong{Intelligent rules} \cr This function uses intelligent rules to help getting fast and logical results. It tries to find matches in this order: \itemize{