mirror of
https://github.com/msberends/AMR.git
synced 2024-12-25 07:26:12 +01:00
fix for Salmonella group A, unit tests
This commit is contained in:
parent
bc434db835
commit
03294c7901
@ -1,5 +1,5 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.8.2.9114
|
Version: 1.8.2.9115
|
||||||
Date: 2023-02-10
|
Date: 2023-02-10
|
||||||
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)
|
||||||
|
2
NEWS.md
2
NEWS.md
@ -1,4 +1,4 @@
|
|||||||
# AMR 1.8.2.9114
|
# AMR 1.8.2.9115
|
||||||
|
|
||||||
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
||||||
|
|
||||||
|
@ -94,7 +94,9 @@ TAXONOMY_VERSION <- list(
|
|||||||
)
|
)
|
||||||
|
|
||||||
globalVariables(c(
|
globalVariables(c(
|
||||||
|
".mo",
|
||||||
".rowid",
|
".rowid",
|
||||||
|
".syndromic_group",
|
||||||
"ab",
|
"ab",
|
||||||
"ab_txt",
|
"ab_txt",
|
||||||
"affect_ab_name",
|
"affect_ab_name",
|
||||||
@ -105,8 +107,10 @@ globalVariables(c(
|
|||||||
"atc_group1",
|
"atc_group1",
|
||||||
"atc_group2",
|
"atc_group2",
|
||||||
"base_ab",
|
"base_ab",
|
||||||
"ci_min",
|
"bind_rows",
|
||||||
"ci_max",
|
"ci_max",
|
||||||
|
"ci_min",
|
||||||
|
"clinical_breakpoints",
|
||||||
"code",
|
"code",
|
||||||
"cols",
|
"cols",
|
||||||
"count",
|
"count",
|
||||||
@ -138,6 +142,7 @@ globalVariables(c(
|
|||||||
"mo",
|
"mo",
|
||||||
"name",
|
"name",
|
||||||
"new",
|
"new",
|
||||||
|
"numerator",
|
||||||
"observations",
|
"observations",
|
||||||
"old",
|
"old",
|
||||||
"old_name",
|
"old_name",
|
||||||
@ -149,13 +154,14 @@ globalVariables(c(
|
|||||||
"reference.rule_group",
|
"reference.rule_group",
|
||||||
"reference.version",
|
"reference.version",
|
||||||
"rowid",
|
"rowid",
|
||||||
"sir",
|
|
||||||
"clinical_breakpoints",
|
|
||||||
"rule_group",
|
"rule_group",
|
||||||
"rule_name",
|
"rule_name",
|
||||||
"se_max",
|
"se_max",
|
||||||
"se_min",
|
"se_min",
|
||||||
|
"SI",
|
||||||
|
"sir",
|
||||||
"species",
|
"species",
|
||||||
|
"syndromic_group",
|
||||||
"total",
|
"total",
|
||||||
"txt",
|
"txt",
|
||||||
"type",
|
"type",
|
||||||
|
@ -165,7 +165,7 @@ bug_drug_combinations <- function(x,
|
|||||||
out <- run_it(x)
|
out <- run_it(x)
|
||||||
}
|
}
|
||||||
rownames(out) <- NULL
|
rownames(out) <- NULL
|
||||||
out <- out %>% pm_arrange(mo, ab)
|
out <- out %pm>% pm_arrange(mo, ab)
|
||||||
out <- as_original_data_class(out, class(x.bak)) # will remove tibble groups
|
out <- as_original_data_class(out, class(x.bak)) # will remove tibble groups
|
||||||
structure(out, class = c("bug_drug_combinations", ifelse(data_has_groups, "grouped", character(0)), class(out)))
|
structure(out, class = c("bug_drug_combinations", ifelse(data_has_groups, "grouped", character(0)), class(out)))
|
||||||
}
|
}
|
||||||
|
8
R/mo.R
8
R/mo.R
@ -966,14 +966,14 @@ convert_colloquial_input <- function(x) {
|
|||||||
out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI"
|
out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI"
|
||||||
|
|
||||||
# Salmonella in different languages, like "Salmonella grupo B"
|
# Salmonella in different languages, like "Salmonella grupo B"
|
||||||
out[x %like_case% "salmonella.* [bcd]$"] <- gsub(".*salmonella.* ([bcd])$",
|
out[x %like_case% "salmonella.* [abcd]$"] <- gsub(".*salmonella.* ([abcd])$",
|
||||||
"B_SLMNL_GRP\\U\\1",
|
"B_SLMNL_GRP\\U\\1",
|
||||||
x[x %like_case% "salmonella.* [bcd]$"],
|
x[x %like_case% "salmonella.* [abcd]$"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
out[x %like_case% "group [bcd] salmonella"] <- gsub(".*group ([bcd]) salmonella*",
|
out[x %like_case% "group [abcd] salmonella"] <- gsub(".*group ([abcd]) salmonella*",
|
||||||
"B_SLMNL_GRP\\U\\1",
|
"B_SLMNL_GRP\\U\\1",
|
||||||
x[x %like_case% "group [bcd] salmonella"],
|
x[x %like_case% "group [abcd] salmonella"],
|
||||||
perl = TRUE
|
perl = TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,9 +69,8 @@
|
|||||||
#' @return
|
#' @return
|
||||||
#' - An [integer] in case of [mo_year()]
|
#' - An [integer] in case of [mo_year()]
|
||||||
#' - An [ordered factor][factor] in case of [mo_pathogenicity()]
|
#' - An [ordered factor][factor] in case of [mo_pathogenicity()]
|
||||||
#' - A [list] in case of [mo_taxonomy()], [mo_synonyms()] and [mo_info()]
|
#' - A [list] in case of [mo_taxonomy()], [mo_synonyms()], [mo_snomed()] and [mo_info()]
|
||||||
#' - A named [character] in case of [mo_url()]
|
#' - A named [character] in case of [mo_url()]
|
||||||
#' - A [numeric] in case of [mo_snomed()]
|
|
||||||
#' - A [character] in all other cases
|
#' - A [character] in all other cases
|
||||||
#' @export
|
#' @export
|
||||||
#' @seealso Data set [microorganisms]
|
#' @seealso Data set [microorganisms]
|
||||||
|
@ -163,7 +163,7 @@ expect_identical(mo_current(c("Escherichia blattae", "Escherichia coli")),
|
|||||||
expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019")
|
expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019")
|
||||||
expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999")
|
expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999")
|
||||||
|
|
||||||
expect_true(112283007 %in% mo_snomed("Escherichia coli"))
|
expect_true(112283007 %in% mo_snomed("Escherichia coli")[[1]])
|
||||||
# old codes must throw a warning in mo_* family
|
# old codes must throw a warning in mo_* family
|
||||||
expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
|
expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))
|
||||||
# outcome of mo_fullname must always return the fullname from the data set
|
# outcome of mo_fullname must always return the fullname from the data set
|
||||||
|
@ -284,9 +284,8 @@ mo_property(
|
|||||||
\itemize{
|
\itemize{
|
||||||
\item An \link{integer} in case of \code{\link[=mo_year]{mo_year()}}
|
\item An \link{integer} in case of \code{\link[=mo_year]{mo_year()}}
|
||||||
\item An \link[=factor]{ordered factor} in case of \code{\link[=mo_pathogenicity]{mo_pathogenicity()}}
|
\item An \link[=factor]{ordered factor} in case of \code{\link[=mo_pathogenicity]{mo_pathogenicity()}}
|
||||||
\item A \link{list} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}}, \code{\link[=mo_synonyms]{mo_synonyms()}} and \code{\link[=mo_info]{mo_info()}}
|
\item A \link{list} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}}, \code{\link[=mo_synonyms]{mo_synonyms()}}, \code{\link[=mo_snomed]{mo_snomed()}} and \code{\link[=mo_info]{mo_info()}}
|
||||||
\item A named \link{character} in case of \code{\link[=mo_url]{mo_url()}}
|
\item A named \link{character} in case of \code{\link[=mo_url]{mo_url()}}
|
||||||
\item A \link{numeric} in case of \code{\link[=mo_snomed]{mo_snomed()}}
|
|
||||||
\item A \link{character} in all other cases
|
\item A \link{character} in all other cases
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user