1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-25 07:26:12 +01:00

(v1.1.0.9010) lose dependencies

This commit is contained in:
dr. M.S. (Matthijs) Berends 2020-05-18 11:09:02 +02:00
parent bf0402a653
commit d659c9baef
14 changed files with 37 additions and 46 deletions

View File

@ -101,8 +101,6 @@ R-release:
# build package
- R CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'devtools::install_local("${PKG_FILE_NAME}")'
- Rscript -e 'AMR::eucast_rules(AMR::example_isolates_unclean, info = TRUE)'
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- R CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:
@ -130,8 +128,6 @@ R-devel:
# build package
- Rdevel CMD build . --no-build-vignettes --no-manual
- PKG_FILE_NAME=$(ls -1t *.tar.gz | head -n 1)
- Rscript -e 'devtools::install_local("${PKG_FILE_NAME}")'
- Rscript -e 'AMR::eucast_rules(AMR::example_isolates_unclean, info = TRUE)'
- Rscript -e 'Sys.setenv(NOT_CRAN = "true")'
- Rdevel CMD check "${PKG_FILE_NAME}" --no-build-vignettes --no-manual --as-cran
artifacts:

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 1.1.0.9009
Version: 1.1.0.9010
Date: 2020-05-18
Title: Antimicrobial Resistance Analysis
Authors@R: c(

View File

@ -1,4 +1,4 @@
# AMR 1.1.0.9009
# AMR 1.1.0.9010
## <small>Last updated: 18-May-2020</small>
### Breaking

View File

@ -520,7 +520,7 @@ eucast_rules <- function(x,
x[, col_mo] <- as.mo(x[, col_mo, drop = TRUE])
x <- x %>%
left_join_microorganisms(by = col_mo, suffix = c("_oldcols", ""))
x$gramstain <- mo_gramstain(x[, col_mo, drop = TRUE])
x$gramstain <- mo_gramstain(x[, col_mo, drop = TRUE], language = NULL)
x$genus_species <- paste(x$genus, x$species)
if (ab_missing(AMP) & !ab_missing(AMX)) {
@ -658,7 +658,7 @@ eucast_rules <- function(x,
rule_group_current %like% "expert",
paste0("\nEUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (",
font_red(paste0("v", EUCAST_VERSION_EXPERT_RULES)), ")\n"),
"\nOther rules by this AMR package\n"))))
"\nOther rules by this AMR package (turn on/off with 'rules' parameter)\n"))))
}
# Print rule -------------------------------------------------------------
if (rule_current != rule_previous) {
@ -678,32 +678,27 @@ eucast_rules <- function(x,
like_is_one_of <- eucast_rules_df[i, 2]
# be sure to comprise all coagulase-negative/-positive Staphylococci when they are mentioned
if (eucast_rules_df[i, 3] %like% "coagulase-") {
suppressWarnings(
all_staph <- microorganisms %>%
filter(genus == "Staphylococcus") %>%
mutate(CNS_CPS = mo_name(mo, Becker = "all"))
)
if (eucast_rules_df[i, 3] %like% "coagulase-") {
eucast_rules_df[i, 3] <- paste0("^(",
paste0(all_staph %>%
filter(CNS_CPS %like% "coagulase-negative") %>%
pull(fullname),
collapse = "|"),
if (eucast_rules_df[i, 3] %like% "coagulase") {
all_staph <- microorganisms[which(microorganisms$genus == "Staphylococcus"), ]
all_staph$CNS_CPS <- suppressWarnings(mo_name(all_staph$mo, Becker = "all", language = NULL))
if (eucast_rules_df[i, 3] %like% "coagulase") {
eucast_rules_df[i, 3] <- paste0("^(", paste0(all_staph[which(all_staph$CNS_CPS %like% "negative"),
"fullname",
drop = TRUE],
collapse = "|"),
")$")
} else {
eucast_rules_df[i, 3] <- paste0("^(",
paste0(all_staph %>%
filter(CNS_CPS %like% "coagulase-positive") %>%
pull(fullname),
collapse = "|"),
eucast_rules_df[i, 3] <- paste0("^(", paste0(all_staph[which(all_staph$CNS_CPS %like% "positive"),
"fullname",
drop = TRUE],
collapse = "|"),
")$")
}
like_is_one_of <- "like"
}
if (like_is_one_of == "is") {
# so 'Enterococcus' will turn into '^Enterococcus$'
# so e.g. 'Enterococcus' will turn into '^Enterococcus$'
mo_value <- paste0("^", eucast_rules_df[i, 3], "$")
} else if (like_is_one_of == "one_of") {
# so 'Clostridium, Actinomyces, ...' will turn into '^(Clostridium|Actinomyces|...)$'

View File

@ -79,8 +79,8 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE) {
if (search_string.ab %in% colnames(x)) {
ab_result <- colnames(x)[colnames(x) == search_string.ab][1L]
} else if (any(tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations"))))) {
ab_result <- colnames(x)[tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations")))][1L]
} else if (any(tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations", language = NULL))))) {
ab_result <- colnames(x)[tolower(colnames(x)) %in% tolower(unlist(ab_property(search_string.ab, "abbreviations", language = NULL)))][1L]
} else {
# sort colnames on length - longest first
@ -96,13 +96,13 @@ guess_ab_col <- function(x = NULL, search_string = NULL, verbose = FALSE) {
if (length(ab_result) == 0) {
if (verbose == TRUE) {
message(paste0("No column found as input for `", search_string,
"` (", ab_name(search_string, language = "en", tolower = TRUE), ")."))
"` (", ab_name(search_string, language = NULL, tolower = TRUE), ")."))
}
return(NULL)
} else {
if (verbose == TRUE) {
message(font_blue(paste0("NOTE: Using column `", font_bold(ab_result), "` as input for `", search_string,
"` (", ab_name(search_string, language = "en", tolower = TRUE), ").")))
"` (", ab_name(search_string, language = NULL, tolower = TRUE), ").")))
}
return(ab_result)
}
@ -173,11 +173,11 @@ get_column_abx <- function(x,
for (i in seq_len(length(x))) {
if (verbose == TRUE & !names(x[i]) %in% names(duplicates)) {
message(font_blue(paste0("NOTE: Using column `", font_bold(x[i]), "` as input for `", names(x)[i],
"` (", ab_name(names(x)[i], tolower = TRUE), ").")))
"` (", ab_name(names(x)[i], tolower = TRUE, language = NULL), ").")))
}
if (names(x[i]) %in% names(duplicates)) {
warning(font_red(paste0("Using column `", font_bold(x[i]), "` as input for `", names(x)[i],
"` (", ab_name(names(x)[i], tolower = TRUE),
"` (", ab_name(names(x)[i], tolower = TRUE, language = NULL),
"), although it was matched for multiple antibiotics or columns.")),
call. = FALSE,
immediate. = verbose)
@ -210,7 +210,7 @@ get_column_abx <- function(x,
}
generate_warning_abs_missing <- function(missing, any = FALSE) {
missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE), ")")
missing <- paste0(missing, " (", ab_name(missing, tolower = TRUE, language = NULL), ")")
if (any == TRUE) {
any_txt <- c(" any of", "is")
} else {

View File

@ -52,10 +52,10 @@ matrix:
build_script:
# - travis_tool.sh clean_library # turn off for caching, turn on for release of new R versions
- travis_tool.sh install_deps
- travis-tool.sh install_deps
test_script:
- travis_tool.sh run_tests
- travis-tool.sh run_tests
on_failure:
- 7z a failure.zip *.Rcheck\*

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="https://msberends.gitlab.io/AMR/index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>

View File

@ -43,7 +43,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>
@ -229,9 +229,9 @@
<small>Source: <a href='https://gitlab.com/msberends/AMR/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="amr-1-1-0-9009" class="section level1">
<h1 class="page-header" data-toc-text="1.1.0.9009">
<a href="#amr-1-1-0-9009" class="anchor"></a>AMR 1.1.0.9009<small> Unreleased </small>
<div id="amr-1-1-0-9010" class="section level1">
<h1 class="page-header" data-toc-text="1.1.0.9010">
<a href="#amr-1-1-0-9010" class="anchor"></a>AMR 1.1.0.9010<small> Unreleased </small>
</h1>
<div id="last-updated-18-may-2020" class="section level2">
<h2 class="hasAnchor">

View File

@ -10,7 +10,7 @@ articles:
WHONET: WHONET.html
benchmarks: benchmarks.html
resistance_predict: resistance_predict.html
last_built: 2020-05-18T08:29Z
last_built: 2020-05-18T09:07Z
urls:
reference: https://msberends.gitlab.io/AMR/reference
article: https://msberends.gitlab.io/AMR/articles

View File

@ -81,7 +81,7 @@
</button>
<span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9009</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Latest development version">1.1.0.9010</span>
</span>
</div>