1
0
mirror of https://github.com/msberends/AMR.git synced 2025-01-15 22:41:38 +01:00

mo_url fix

This commit is contained in:
dr. M.S. (Matthijs) Berends 2022-09-17 12:58:43 +02:00
parent ae9059ab99
commit 98cf1ba0b3
13 changed files with 15 additions and 20 deletions

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 1.8.1.9050 Version: 1.8.1.9051
Date: 2022-09-16 Date: 2022-09-17
Title: Antimicrobial Resistance Data Analysis Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR) Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by data analysis and to work with microbial and antimicrobial properties by

View File

@ -1,4 +1,4 @@
# AMR 1.8.1.9050 # AMR 1.8.1.9051
This version will eventually become v2.0! We're happy to reach a new major milestone soon! This version will eventually become v2.0! We're happy to reach a new major milestone soon!

View File

@ -138,7 +138,6 @@ globalVariables(c(
"se_max", "se_max",
"se_min", "se_min",
"species", "species",
"species_id",
"total", "total",
"txt", "txt",
"type", "type",

View File

@ -678,24 +678,20 @@ mo_url <- function(x, open = FALSE, language = get_AMR_locale(), ...) {
meet_criteria(open, allow_class = "logical", has_length = 1) meet_criteria(open, allow_class = "logical", has_length = 1)
language <- validate_language(language) language <- validate_language(language)
stop("FIX mo_url")
x.mo <- as.mo(x = x, language = language, ... = ...) x.mo <- as.mo(x = x, language = language, ... = ...)
metadata <- get_mo_failures_uncertainties_renamed() metadata <- get_mo_failures_uncertainties_renamed()
#
# df <- AMR::microorganisms[match(x.mo, AMR::microorganisms$mo), c("mo", "fullname", "source", "kingdom", "rank"), drop = FALSE]
# df$url <- ifelse(df$source == "LPSN",
# paste0(CATALOGUE_OF_LIFE$url_LPSN, "/species/", gsub(" ", "-", tolower(df$fullname), fixed = TRUE)),
# paste0(CATALOGUE_OF_LIFE$url_CoL, "/data/search?type=EXACT&q=", gsub(" ", "%20", df$fullname, fixed = TRUE))
# )
#
# genera <- which(df$kingdom == "Bacteria" & df$rank == "genus")
# df$url[genera] <- gsub("/species/", "/genus/", df$url[genera], fixed = TRUE)
# subsp <- which(df$kingdom == "Bacteria" & df$rank %in% c("subsp.", "infraspecies"))
# df$url[subsp] <- gsub("/species/", "/subspecies/", df$url[subsp], fixed = TRUE)
u <- df$url x.rank <- microorganisms$rank[match(x.mo, microorganisms$mo)]
names(u) <- df$fullname x.name <- microorganisms$fullname[match(x.mo, microorganisms$mo)]
x.lpsn <- microorganisms$lpsn[match(x.mo, microorganisms$mo)]
x.gbif <- microorganisms$gbif[match(x.mo, microorganisms$mo)]
u <- character(length(x))
u[!is.na(x.gbif)] <- paste0(TAXONOMY_VERSION$GBIF$url, "/species/", x.gbif[!is.na(x.gbif)])
# 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))
names(u) <- x.name
if (isTRUE(open)) { if (isTRUE(open)) {
if (length(u) > 1) { if (length(u) > 1) {

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
0ae8fdb3b65de240dd8f7c203421ff3e fd8e7edf6febc16c6549dcf33932b589

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.