diff --git a/DESCRIPTION b/DESCRIPTION index 5343e4638..5bec4a1f5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.8.1.9050 -Date: 2022-09-16 +Version: 1.8.1.9051 +Date: 2022-09-17 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 diff --git a/NEWS.md b/NEWS.md index 25403324f..efead1cd6 100755 --- a/NEWS.md +++ b/NEWS.md @@ -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! diff --git a/R/aa_globals.R b/R/aa_globals.R index 0ffa31299..26bd4339c 100755 --- a/R/aa_globals.R +++ b/R/aa_globals.R @@ -138,7 +138,6 @@ globalVariables(c( "se_max", "se_min", "species", - "species_id", "total", "txt", "type", diff --git a/R/mo_property.R b/R/mo_property.R index 8f9f47ac7..34fb60186 100755 --- a/R/mo_property.R +++ b/R/mo_property.R @@ -678,24 +678,20 @@ mo_url <- function(x, open = FALSE, language = get_AMR_locale(), ...) { meet_criteria(open, allow_class = "logical", has_length = 1) language <- validate_language(language) - stop("FIX mo_url") - x.mo <- as.mo(x = x, language = language, ... = ...) 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 - names(u) <- df$fullname + x.rank <- microorganisms$rank[match(x.mo, microorganisms$mo)] + 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 (length(u) > 1) { diff --git a/data-raw/microorganisms.dta b/data-raw/microorganisms.dta index 4fe1dc5d7..ae4b4e6b2 100644 Binary files a/data-raw/microorganisms.dta and b/data-raw/microorganisms.dta differ diff --git a/data-raw/microorganisms.feather b/data-raw/microorganisms.feather index ff9995850..700f7d9e8 100644 Binary files a/data-raw/microorganisms.feather and b/data-raw/microorganisms.feather differ diff --git a/data-raw/microorganisms.md5 b/data-raw/microorganisms.md5 index fcb9bdda8..faae4a581 100644 --- a/data-raw/microorganisms.md5 +++ b/data-raw/microorganisms.md5 @@ -1 +1 @@ -0ae8fdb3b65de240dd8f7c203421ff3e +fd8e7edf6febc16c6549dcf33932b589 diff --git a/data-raw/microorganisms.parquet b/data-raw/microorganisms.parquet index 7dc984173..2ebf0379b 100644 Binary files a/data-raw/microorganisms.parquet and b/data-raw/microorganisms.parquet differ diff --git a/data-raw/microorganisms.rds b/data-raw/microorganisms.rds index fab7d5684..d17687776 100644 Binary files a/data-raw/microorganisms.rds and b/data-raw/microorganisms.rds differ diff --git a/data-raw/microorganisms.sas b/data-raw/microorganisms.sas index 6276332f5..d2c940a10 100644 Binary files a/data-raw/microorganisms.sas and b/data-raw/microorganisms.sas differ diff --git a/data-raw/microorganisms.sav b/data-raw/microorganisms.sav index e15b62eba..5712deeb6 100644 Binary files a/data-raw/microorganisms.sav and b/data-raw/microorganisms.sav differ diff --git a/data-raw/microorganisms.xlsx b/data-raw/microorganisms.xlsx index 886c99fa6..d00772b91 100644 Binary files a/data-raw/microorganisms.xlsx and b/data-raw/microorganisms.xlsx differ diff --git a/data/microorganisms.rda b/data/microorganisms.rda index a4e4af294..ff6b18fd9 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ