1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 02:03:04 +02:00

unit tests

This commit is contained in:
2022-12-20 22:18:50 +01:00
parent f0a2cdbf5e
commit 6f4bb603ec
9 changed files with 57 additions and 69 deletions

2
R/mo.R
View File

@ -385,7 +385,7 @@ as.mo <- function(x,
lpsn_matches <- AMR::microorganisms$lpsn_renamed_to[match(out, AMR::microorganisms$mo)]
lpsn_matches[!lpsn_matches %in% AMR::microorganisms$lpsn] <- NA
# GBIF only for non-bacteria, since we use LPSN as primary source for bacteria
# (example is Strep anginosus, renamed according to GBIF, not according to LPSN)
# (an example is Strep anginosus, renamed according to GBIF, not according to LPSN)
gbif_matches <- AMR::microorganisms$gbif_renamed_to[AMR::microorganisms$kingdom != "Bacteria"][match(out, AMR::microorganisms$mo[AMR::microorganisms$kingdom != "Bacteria"])]
gbif_matches[!gbif_matches %in% AMR::microorganisms$gbif] <- NA
AMR_env$mo_renamed <- list(

View File

@ -220,7 +220,7 @@ mo_shortname <- function(x, language = get_AMR_locale(), keep_synonyms = getOpti
shortnames[shortnames == "S. coagulase-negative"] <- "CoNS"
shortnames[shortnames == "S. coagulase-positive"] <- "CoPS"
# exceptions for streptococci: Group A Streptococcus -> GAS
shortnames[shortnames %like% "S. group [ABCDFGHK]"] <- paste0("G", gsub("S. group ([ABCDFGHK])", "\\1", shortnames[shortnames %like% "S. group [ABCDFGHK]"], perl = TRUE), "S")
shortnames[shortnames %like_case% "S. Group [ABCDFGHK]"] <- paste0("G", gsub("S. Group ([ABCDFGHK])", "\\1", shortnames[shortnames %like_case% "S. Group [ABCDFGHK]"], perl = TRUE), "S")
# unknown species etc.
shortnames[shortnames %like% "unknown"] <- paste0("(", trimws2(gsub("[^a-zA-Z -]", "", shortnames[shortnames %like% "unknown"], perl = TRUE)), ")")

Binary file not shown.