diff --git a/DESCRIPTION b/DESCRIPTION index 2e6819f0..8047d1ee 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.7.1.9100 -Date: 2019-10-08 +Version: 0.7.1.9101 +Date: 2019-10-09 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 6f8699d5..31370ec2 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# AMR 0.7.1.9100 -Last updated: 08-Oct-2019 +# AMR 0.7.1.9101 +Last updated: 09-Oct-2019 ### Breaking * Determination of first isolates now **excludes** all 'unknown' microorganisms at default, i.e. microbial code `"UNKNOWN"`. They can be included with the new parameter `include_unknown`: @@ -26,33 +26,34 @@ * Renamed data set `septic_patients` to `example_isolates` ### New -* Function `bug_drug_combinations()` to quickly get a `data.frame` with the antimicrobial resistance of any bug-drug combination in a data set. The columns with microorganism codes is guessed automatically and its input is transformed with `mo_shortname()` at default: +* Function `bug_drug_combinations()` to quickly get a `data.frame` with the results of all bug-drug combinations in a data set. The column containing microorganism codes is guessed automatically and its input is transformed with `mo_shortname()` at default: ```r x <- bug_drug_combinations(example_isolates) - # NOTE: Using column `mo` as input for `col_mo`. - x[1:5, ] - #> ab mo S I R total - #> 1 AMC CoNS 178 0 132 310 - #> 2 AMC E. coli 332 74 61 467 - #> 3 AMC K. pneumoniae 49 3 6 58 - #> 4 AMC P. aeruginosa 0 0 30 30 - #> 5 AMC P. mirabilis 28 7 1 36 + #> NOTE: Using column `mo` as input for `col_mo`. + x[1:4, ] + #> mo ab S I R total + #> 1 A. baumannii AMC 0 0 3 3 + #> 2 A. baumannii AMK 0 0 0 0 + #> 3 A. baumannii AMP 0 0 3 3 + #> 4 A. baumannii AMX 0 0 3 3 + #> NOTE: Use 'format()' on this result to get a publicable/printable format. # change the transformation with the FUN argument to anything you like: x <- bug_drug_combinations(example_isolates, FUN = mo_gramstain) - # NOTE: Using column `mo` as input for `col_mo`. + #> NOTE: Using column `mo` as input for `col_mo`. x[1:4, ] - #> ab mo S I R total - #> 1 AMC Gram-negative 469 89 174 732 - #> 2 AMC Gram-positive 873 2 272 1147 - #> 3 AMK Gram-negative 251 0 2 253 - #> 4 AMK Gram-positive 0 0 100 100 + #> mo ab S I R total + #> 1 Gram-negative AMC 469 89 174 732 + #> 2 Gram-negative AMK 251 0 2 253 + #> 3 Gram-negative AMP 227 0 405 632 + #> 4 Gram-negative AMX 227 0 405 632 + #> NOTE: Use 'format()' on this result to get a publicable/printable format. ``` You can format this to a printable format, ready for reporting or exporting to e.g. Excel with the base R `format()` function: ```r format(x, combine_IR = FALSE) ``` -* Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for `portion_*` functions or `count_*` functions. This can be used to determine the empiric susceptibily of a combination therapy. A new parameter `only_all_tested` (**which defaults to `FALSE`**) replaces the old `also_single_tested` and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the `portion` and `count` help pages), where the %SI is being determined: +* Additional way to calculate co-resistance, i.e. when using multiple antimicrobials as input for `portion_*` functions or `count_*` functions. This can be used to determine the empiric susceptibility of a combination therapy. A new parameter `only_all_tested` (**which defaults to `FALSE`**) replaces the old `also_single_tested` and can be used to select one of the two methods to count isolates and calculate portions. The difference can be seen in this example table (which is also on the `portion` and `count` help pages), where the %SI is being determined: ```r # -------------------------------------------------------------------- diff --git a/data-raw/reproduction_of_microorganisms.R b/data-raw/reproduction_of_microorganisms.R index 4334b842..fa031096 100644 --- a/data-raw/reproduction_of_microorganisms.R +++ b/data-raw/reproduction_of_microorganisms.R @@ -189,8 +189,14 @@ MOs <- MOs %>% authors), # fix beginning and ending ref = gsub(", $", "", ref), - ref = gsub("^, ", "", ref) + ref = gsub("^, ", "", ref), + ref = gsub("^(emend|et al.,?)", "", ref), + ref = trimws(ref) ) +# a lot start with a lowercase character - fix that +MOs$ref[!grepl("^d[A-Z]", MOs$ref)] <- gsub("^([a-z])", "\\U\\1", MOs$ref[!grepl("^d[A-Z]", MOs$ref)], perl = TRUE) +# specific one for the French that are named dOrbigny +MOs$ref[grepl("^d[A-Z]", MOs$ref)] <- gsub("^d", "d'", MOs$ref[grepl("^d[A-Z]", MOs$ref)]) # Remove non-ASCII characters (these are not allowed by CRAN) MOs <- MOs %>% diff --git a/data/microorganisms.rda b/data/microorganisms.rda index 0e070c49..41a50e9a 100644 Binary files a/data/microorganisms.rda and b/data/microorganisms.rda differ diff --git a/docs/404.html b/docs/404.html index d504f837..ad667066 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9100 + 0.7.1.9101 diff --git a/docs/authors.html b/docs/authors.html index d11f0d35..65206c15 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -84,7 +84,7 @@ AMR (for R) - 0.7.1.9100 + 0.7.1.9101 diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index e03af2b0..d2617de6 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,4 +1,4 @@ -pandoc: 2.3.1 +pandoc: [] pkgdown: 1.4.1 pkgdown_sha: ~ articles: