mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 19:26:13 +01:00
(v2.1.1.9070) fix for mo_current mo (no-verify)
This commit is contained in:
parent
83907c9c65
commit
573c0346ed
@ -1,6 +1,6 @@
|
||||
Package: AMR
|
||||
Version: 2.1.1.9068
|
||||
Date: 2024-07-17
|
||||
Version: 2.1.1.9070
|
||||
Date: 2024-07-19
|
||||
Title: Antimicrobial Resistance Data Analysis
|
||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||
data analysis and to work with microbial and antimicrobial properties by
|
||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
||||
# AMR 2.1.1.9068
|
||||
# AMR 2.1.1.9070
|
||||
|
||||
*(this beta version will eventually become v3.0. We're happy to reach a new major milestone soon, which will be all about the new One Health support! Install this beta using [the instructions here](https://msberends.github.io/AMR/#latest-development-version).)*
|
||||
|
||||
|
14
R/mo.R
14
R/mo.R
@ -1258,14 +1258,14 @@ synonym_mo_to_accepted_mo <- function(x, fill_in_accepted = FALSE, dataset = AMR
|
||||
|
||||
# make sure to get the latest name, e.g. Fusarium pulicaris robiniae was first renamed to Fusarium roseum, then to Fusarium sambucinum
|
||||
# we need the MO of Fusarium pulicaris robiniae to return the MO of Fusarium sambucinum
|
||||
idx <- !is.na(is_still_synonym) & is_still_synonym
|
||||
x_gbif <- dataset$gbif_renamed_to[match(out[idx], dataset$mo)]
|
||||
x_mycobank <- dataset$mycobank_renamed_to[match(out[idx], dataset$mo)]
|
||||
x_lpsn <- dataset$lpsn_renamed_to[match(out[idx], dataset$mo)]
|
||||
must_be_corrected <- !is.na(is_still_synonym) & is_still_synonym
|
||||
x_gbif <- dataset$gbif_renamed_to[match(out, dataset$mo)]
|
||||
x_mycobank <- dataset$mycobank_renamed_to[match(out, dataset$mo)]
|
||||
x_lpsn <- dataset$lpsn_renamed_to[match(out, dataset$mo)]
|
||||
|
||||
out[idx][!is.na(x_gbif)] <- dataset$mo[match(x_gbif[idx][!is.na(x_gbif)], dataset$gbif)]
|
||||
out[idx][!is.na(x_mycobank)] <- dataset$mo[match(x_mycobank[idx][!is.na(x_mycobank)], dataset$mycobank)]
|
||||
out[idx][!is.na(x_lpsn)] <- dataset$mo[match(x_lpsn[idx][!is.na(x_lpsn)], dataset$lpsn)]
|
||||
out[must_be_corrected & !is.na(x_gbif)] <- dataset$mo[match(x_gbif[must_be_corrected & !is.na(x_gbif)], dataset$gbif)]
|
||||
out[must_be_corrected & !is.na(x_mycobank)] <- dataset$mo[match(x_mycobank[must_be_corrected & !is.na(x_mycobank)], dataset$mycobank)]
|
||||
out[must_be_corrected & !is.na(x_lpsn)] <- dataset$mo[match(x_lpsn[must_be_corrected & !is.na(x_lpsn)], dataset$lpsn)]
|
||||
|
||||
is_still_synonym <- dataset$status[match(out, dataset$mo)] == "synonym"
|
||||
}
|
||||
|
@ -928,7 +928,7 @@ mo_url <- function(x, open = FALSE, language = get_AMR_locale(), keep_synonyms =
|
||||
# overwrite with LPSN:
|
||||
u[!is.na(x.lpsn)] <- paste0(TAXONOMY_VERSION$LPSN$url, "/", x.rank[!is.na(x.lpsn)], "/", gsub(" ", "-", tolower(x.name[!is.na(x.lpsn)]), fixed = TRUE))
|
||||
# overwrite with MycoBank (bacteria from LPSN will not be overwritten since MycoBank has no bacteria)
|
||||
u[!is.na(x.mycobank)] <- paste0(TAXONOMY_VERSION$MycoBank$url, "/name/", gsub(" ", "%20", tolower(x.name[!is.na(x.mycobank)]), fixed = TRUE))
|
||||
u[!is.na(x.mycobank)] <- paste0(TAXONOMY_VERSION$MycoBank$url, "/mb/", gsub(" ", "%20", tolower(x.mycobank[!is.na(x.mycobank)]), fixed = TRUE))
|
||||
|
||||
names(u) <- x.name
|
||||
|
||||
|
@ -113,7 +113,8 @@ expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919")
|
||||
expect_equal(mo_authors("Escherichia coli"), "Castellani et al.")
|
||||
expect_equal(mo_year("Escherichia coli"), 1919)
|
||||
|
||||
expect_true(mo_url("Candida albicans") %like% "gbif.org")
|
||||
expect_true(mo_url("Amoeba dysenteriae") %like% "gbif.org")
|
||||
expect_true(mo_url("Candida albicans") %like% "mycobank.org")
|
||||
expect_true(mo_url("Escherichia coli") %like% "lpsn.dsmz.de")
|
||||
|
||||
# test integrity of getting back full names
|
||||
|
@ -326,7 +326,6 @@ expect_identical(out_vet$PRA, rep(NA_sir_, 11))
|
||||
expect_identical(out_vet$FLR, as.sir(c("S", "S", NA, "S", "S", NA, "I", "R", NA, "R", "R")))
|
||||
|
||||
sir_history <- sir_interpretation_history()
|
||||
print(sir_history$host)
|
||||
expect_identical(sort(sir_history$host),
|
||||
c("cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cats", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle",
|
||||
"cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "cattle", "dogs",
|
||||
|
Loading…
Reference in New Issue
Block a user