(v1.7.1.9073) as.rsi() fix for UTIs

This commit is contained in:
dr. M.S. (Matthijs) Berends 2021-12-14 21:47:14 +01:00
parent 5eef01165e
commit bd4bb1d72f
25 changed files with 27787 additions and 27785 deletions

View File

@ -1,5 +1,5 @@
Package: AMR
Version: 1.7.1.9072
Version: 1.7.1.9073
Date: 2021-12-14
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)

View File

@ -1,4 +1,4 @@
# `AMR` 1.7.1.9072
# `AMR` 1.7.1.9073
## <small>Last updated: 14 December 2021</small>
All functions in this package are now all considered to be stable. Updates to the AMR interpretation rules (such as by EUCAST and CLSI), the microbial taxonomy, and the antibiotic dosages will all be updated every 6 to 12 months from now on.

View File

@ -263,9 +263,9 @@
#'
#' Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations.
#' @format A [data.frame] with `r format(nrow(intrinsic_resistant), big.mark = ",")` observations and `r ncol(intrinsic_resistant)` variables:
#' - `microorganism`\cr Official taxonomic name of the microorganism, according to the LPSN
#' - `antibiotic`\cr Official name of the antibiotic drug, according to the WHOCC
#' @details The repository of this `AMR` package contains a file comprising this exact data set: <https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt>. This file **allows for machine reading EUCAST guidelines about intrinsic resistance**, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
#' - `mo`\cr Microorganism ID
#' - `ab`\cr Antibiotic ID
#' @details The repository of this `AMR` package contains a file comprising this data set with full taxonomic and antibiotic names: <https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt>. This file **allows for machine reading EUCAST guidelines about intrinsic resistance**, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
#'
#' This data set is based on `r format_eucast_version_nr(3.3)`.
#' @inheritSection AMR Reference Data Publicly Available

16
R/mo.R
View File

@ -485,6 +485,11 @@ exec_as.mo <- function(x,
}
}
# remove spp and species
x <- gsub(" +(spp.?|ssp.?|sp.? |ss ?.?|subsp.?|subspecies|biovar |serovar |species)", " ", x, ignore.case = TRUE, perl = TRUE)
x <- gsub("( spp?.?| ss |subsp.?|subspecies|biovar|serovar|species)", "", x, ignore.case = TRUE, perl = TRUE)
x <- strip_whitespace(x, dyslexia_mode)
x_backup <- x
# from here on case-insensitive
@ -493,11 +498,6 @@ exec_as.mo <- function(x,
x_backup[x %like_case% "^(fungus|fungi)$"] <- "(unknown fungus)" # will otherwise become the kingdom
x_backup[x_backup_untouched == "Fungi"] <- "Fungi" # is literally the kingdom
# remove spp and species
x_backup <- gsub(" +(spp.?|ssp.?|sp.? |ss ?.?|subsp.?|subspecies|biovar |serovar |species)", " ", x_backup, perl = TRUE)
x_backup <- gsub("( spp?.?| ss |subsp.?|subspecies|biovar|serovar|species)", "", x_backup, perl = TRUE)
x_backup <- strip_whitespace(x_backup, dyslexia_mode)
# Fill in fullnames and MO codes directly
known_names <- tolower(x_backup) %in% MO_lookup$fullname_lower
x[known_names] <- MO_lookup[match(tolower(x_backup)[known_names], MO_lookup$fullname_lower), property, drop = TRUE]
@ -717,7 +717,7 @@ exec_as.mo <- function(x,
# fewer than 3 chars and not looked for species, add as failure
x[i] <- lookup(mo == "UNKNOWN")
if (initial_search == TRUE) {
failures <- c(failures, x_backup[i])
failures <- c(failures, x_backup_untouched[i])
}
next
}
@ -900,7 +900,7 @@ exec_as.mo <- function(x,
# (at this point the latest reference_df has also been checked)
x[i] <- lookup(mo == "UNKNOWN")
if (initial_search == TRUE) {
failures <- c(failures, x_backup[i])
failures <- c(failures, x_backup_untouched[i])
}
next
}
@ -1425,7 +1425,7 @@ exec_as.mo <- function(x,
# no results found: make them UNKNOWN ----
x[i] <- lookup(mo == "UNKNOWN", uncertainty = -1)
if (initial_search == TRUE) {
failures <- c(failures, x_backup[i])
failures <- c(failures, x_backup_untouched[i])
}
}

View File

@ -165,6 +165,5 @@ create_MO.old_lookup <- function() {
create_intr_resistance <- function() {
# for mo_is_intrinsic_resistant() - saves a lot of time when executed on this vector
paste(AMR::microorganisms[match(AMR::intrinsic_resistant$microorganism, AMR::microorganisms$fullname), "mo", drop = TRUE],
AMR::antibiotics[match(AMR::intrinsic_resistant$antibiotic, AMR::antibiotics$name), "ab", drop = TRUE])
paste(AMR::intrinsic_resistant$mo, AMR::intrinsic_resistant$ab)
}

Binary file not shown.

View File

@ -279,15 +279,19 @@ if (changed_md5(av)) {
try(openxlsx::write.xlsx(av, "data-raw/antivirals.xlsx"), silent = TRUE)
}
if (changed_md5(intrinsic_resistant)) {
# give official names to ABs and MOs
intrinsicR <- data.frame(microorganism = mo_name(intrinsic_resistant$mo),
antibiotic = ab_name(intrinsic_resistant$ab),
stringsAsFactors = FALSE)
if (changed_md5(intrinsicR)) {
usethis::ui_info(paste0("Saving {usethis::ui_value('intrinsic_resistant')} to {usethis::ui_value('/data-raw/')}"))
write_md5(intrinsic_resistant)
try(saveRDS(intrinsic_resistant, "data-raw/intrinsic_resistant.rds", version = 2, compress = "xz"), silent = TRUE)
try(write.table(intrinsic_resistant, "data-raw/intrinsic_resistant.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
try(haven::write_sas(intrinsic_resistant, "data-raw/intrinsic_resistant.sas"), silent = TRUE)
try(haven::write_sav(intrinsic_resistant, "data-raw/intrinsic_resistant.sav"), silent = TRUE)
try(haven::write_dta(intrinsic_resistant, "data-raw/intrinsic_resistant.dta"), silent = TRUE)
try(openxlsx::write.xlsx(intrinsic_resistant, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE)
write_md5(intrinsicR)
try(saveRDS(intrinsicR, "data-raw/intrinsic_resistant.rds", version = 2, compress = "xz"), silent = TRUE)
try(write.table(intrinsicR, "data-raw/intrinsic_resistant.txt", sep = "\t", na = "", row.names = FALSE), silent = TRUE)
try(haven::write_sas(intrinsicR, "data-raw/intrinsic_resistant.sas"), silent = TRUE)
try(haven::write_sav(intrinsicR, "data-raw/intrinsic_resistant.sav"), silent = TRUE)
try(haven::write_dta(intrinsicR, "data-raw/intrinsic_resistant.dta"), silent = TRUE)
try(openxlsx::write.xlsx(intrinsicR, "data-raw/intrinsic_resistant.xlsx"), silent = TRUE)
}
if (changed_md5(dosage)) {

1
data-raw/intrinsicR.md5 Normal file
View File

@ -0,0 +1 @@
56b3cea0e28d8a54e0fcbd3e50af96fc

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -25,29 +25,27 @@
library(AMR)
library(dplyr)
int_resis <- data.frame(microorganism = microorganisms$mo, stringsAsFactors = FALSE)
int_resis <- data.frame(mo = microorganisms$mo, stringsAsFactors = FALSE)
for (i in seq_len(nrow(antibiotics))) {
int_resis$new <- as.rsi("S")
colnames(int_resis)[ncol(int_resis)] <- antibiotics$name[i]
colnames(int_resis)[ncol(int_resis)] <- antibiotics$ab[i]
}
int_resis <- eucast_rules(int_resis,
int_resis <- eucast_rules(int_resis,
eucast_rules_df = subset(AMR:::EUCAST_RULES_DF,
is.na(have_these_values) & reference.version == 3.3),
info = FALSE)
int_resis2 <- int_resis[, sapply(int_resis, function(x) any(!is.rsi(x) | x == "R"))] %>%
tidyr::pivot_longer(-microorganism) %>%
tidyr::pivot_longer(-mo) %>%
filter(value == "R") %>%
select(microorganism, antibiotic = name)
select(mo, ab = name)
# remove lab drugs
untreatable <- antibiotics[which(antibiotics$name %like% "-high|EDTA|polysorbate|macromethod|screening|/nacubactam"), "name", drop = TRUE]
untreatable <- antibiotics[which(antibiotics$name %like% "-high|EDTA|polysorbate|macromethod|screening|/nacubactam"), "ab", drop = TRUE]
int_resis2 <- int_resis2 %>%
filter(!antibiotic %in% untreatable) %>%
arrange(microorganism, antibiotic)
int_resis2$microorganism <- mo_name(int_resis2$microorganism, language = NULL)
filter(!ab %in% untreatable) %>%
arrange(mo, ab)
intrinsic_resistant <- as.data.frame(int_resis2, stringsAsFactors = FALSE)
usethis::use_data(intrinsic_resistant, internal = FALSE, overwrite = TRUE, version = 2, compress = "xz")

Binary file not shown.

View File

@ -44,7 +44,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="Released version">1.7.1.9070</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>
@ -225,20 +225,20 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">S.aureus</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">2</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># as.mo("sau") 11.0 12.0 18.0 14 15.0 59 25</span>
<span class="co"># as.mo("stau") 51.0 55.0 74.0 87 91.0 97 25</span>
<span class="co"># as.mo("STAU") 51.0 55.0 78.0 65 92.0 200 25</span>
<span class="co"># as.mo("staaur") 12.0 14.0 20.0 15 18.0 52 25</span>
<span class="co"># as.mo("STAAUR") 10.0 12.0 16.0 13 14.0 61 25</span>
<span class="co"># as.mo("S. aureus") 26.0 27.0 42.0 31 63.0 68 25</span>
<span class="co"># as.mo("S aureus") 25.0 28.0 39.0 32 39.0 78 25</span>
<span class="co"># as.mo("Staphylococcus aureus") 3.1 3.8 5.6 4 4.6 42 25</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 240.0 250.0 270.0 260 270.0 360 25</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 160.0 190.0 200.0 200 220.0 260 25</span>
<span class="co"># as.mo("MRSA") 11.0 12.0 18.0 12 14.0 51 25</span>
<span class="co"># as.mo("VISA") 21.0 22.0 32.0 23 54.0 69 25</span></code></pre></div>
<span class="co"># as.mo("sau") 12.0 12.0 17.0 14.0 15.0 56 25</span>
<span class="co"># as.mo("stau") 51.0 60.0 81.0 87.0 98.0 120 25</span>
<span class="co"># as.mo("STAU") 51.0 64.0 83.0 90.0 98.0 130 25</span>
<span class="co"># as.mo("staaur") 9.7 12.0 15.0 15.0 15.0 46 25</span>
<span class="co"># as.mo("STAAUR") 11.0 14.0 17.0 15.0 16.0 45 25</span>
<span class="co"># as.mo("S. aureus") 24.0 31.0 43.0 33.0 63.0 77 25</span>
<span class="co"># as.mo("S aureus") 26.0 28.0 45.0 34.0 62.0 76 25</span>
<span class="co"># as.mo("Staphylococcus aureus") 3.0 3.7 5.4 3.8 4.6 37 25</span>
<span class="co"># as.mo("Staphylococcus aureus (MRSA)") 240.0 250.0 270.0 260.0 270.0 310 25</span>
<span class="co"># as.mo("Sthafilokkockus aaureuz") 180.0 190.0 210.0 200.0 220.0 260 25</span>
<span class="co"># as.mo("MRSA") 10.0 13.0 20.0 15.0 17.0 73 25</span>
<span class="co"># as.mo("VISA") 20.0 23.0 38.0 26.0 49.0 150 25</span></code></pre></div>
<p><img src="benchmarks_files/figure-html/unnamed-chunk-4-1.png" width="750"></p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 200 milliseconds, this is only 5 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations are up to 66 times slower to determine.</p>
<p>In the table above, all measurements are shown in milliseconds (thousands of seconds). A value of 5 milliseconds means it can determine 200 input values per second. It case of 200 milliseconds, this is only 5 input values per second. It is clear that accepted taxonomic names are extremely fast, but some variations are up to 69 times slower to determine.</p>
<p>To improve performance, we implemented two important algorithms to save unnecessary calculations: <strong>repetitive results</strong> and <strong>already precalculated results</strong>.</p>
<div class="section level3">
<h3 id="repetitive-results">Repetitive results<a class="anchor" aria-label="anchor" href="#repetitive-results"></a>
@ -258,8 +258,8 @@
<span class="co"># what do these values look like? They are of class &lt;mo&gt;:</span>
<span class="fu"><a href="https://rdrr.io/r/utils/head.html" class="external-link">head</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
<span class="co"># Class &lt;mo&gt;</span>
<span class="co"># [1] B_STRPT_EQUI B_STPHY_CONS B_ESCHR_COLI B_ENTRC_FACM B_STPHY_CONS</span>
<span class="co"># [6] B_ESCHR_COLI</span>
<span class="co"># [1] B_STRPT_PNMN B_ESCHR_COLI B_STPHY_AURS B_STPHY_CONS B_ENTRC </span>
<span class="co"># [6] B_STPHY_HMNS</span>
<span class="co"># as the example_isolates data set has 2,000 rows, we should have 2 million items</span>
<span class="fu"><a href="https://rdrr.io/r/base/length.html" class="external-link">length</a></span><span class="op">(</span><span class="va">x</span><span class="op">)</span>
@ -275,8 +275,8 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># mo_name(x) 203 230 308 299 385 409 10</span></code></pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.299 seconds. That is 149 nanoseconds on average. You only lose time on your unique input values.</p>
<span class="co"># mo_name(x) 205 234 315 310 393 447 10</span></code></pre></div>
<p>So getting official taxonomic names of 2,000,000 (!!) items consisting of 90 unique values only takes 0.31 seconds. That is 155 nanoseconds on average. You only lose time on your unique input values.</p>
</div>
<div class="section level3">
<h3 id="precalculated-results">Precalculated results<a class="anchor" aria-label="anchor" href="#precalculated-results"></a>
@ -290,10 +290,10 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 8.02 8.23 8.77 8.88 9.17 9.32 10</span>
<span class="co"># B 22.20 22.80 37.70 26.50 37.70 78.20 10</span>
<span class="co"># C 2.15 2.20 2.39 2.39 2.49 2.74 10</span></code></pre></div>
<p>So going from <code>mo_name("Staphylococcus aureus")</code> to <code>"Staphylococcus aureus"</code> takes 0.0024 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<span class="co"># A 7.89 8.95 14.80 9.21 10.50 64.60 10</span>
<span class="co"># B 22.60 26.10 33.80 26.90 29.80 89.20 10</span>
<span class="co"># C 1.76 2.04 2.44 2.49 2.73 3.37 10</span></code></pre></div>
<p>So going from <code>mo_name("Staphylococcus aureus")</code> to <code>"Staphylococcus aureus"</code> takes 0.0025 seconds - it doesnt even start calculating <em>if the result would be the same as the expected resulting value</em>. That goes for all helper functions:</p>
<div class="sourceCode" id="cb5"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span class="va">run_it</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/microbenchmark/man/microbenchmark.html" class="external-link">microbenchmark</a></span><span class="op">(</span>A <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_species</a></span><span class="op">(</span><span class="st">"aureus"</span><span class="op">)</span>,
B <span class="op">=</span> <span class="fu"><a href="../reference/mo_property.html">mo_genus</a></span><span class="op">(</span><span class="st">"Staphylococcus"</span><span class="op">)</span>,
@ -307,14 +307,14 @@
<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">3</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># A 1.73 1.85 2.08 2.01 2.13 3.02 10</span>
<span class="co"># B 1.68 1.76 2.00 1.99 2.11 2.43 10</span>
<span class="co"># C 1.74 1.99 2.00 2.02 2.05 2.20 10</span>
<span class="co"># D 1.73 1.86 1.99 2.03 2.08 2.22 10</span>
<span class="co"># E 1.75 1.82 1.98 2.02 2.10 2.27 10</span>
<span class="co"># F 1.74 1.95 1.93 1.97 1.97 2.02 10</span>
<span class="co"># G 1.71 1.76 1.95 1.98 1.99 2.56 10</span>
<span class="co"># H 1.72 1.83 1.93 1.98 2.00 2.05 10</span></code></pre></div>
<span class="co"># A 1.62 1.67 1.81 1.71 1.75 2.45 10</span>
<span class="co"># B 1.59 1.62 1.94 1.75 2.15 3.08 10</span>
<span class="co"># C 1.61 1.64 1.74 1.70 1.73 2.09 10</span>
<span class="co"># D 1.58 1.66 1.87 1.69 2.07 2.63 10</span>
<span class="co"># E 1.59 1.61 1.70 1.64 1.72 2.15 10</span>
<span class="co"># F 1.57 1.60 1.69 1.66 1.71 2.07 10</span>
<span class="co"># G 1.56 1.60 1.75 1.67 1.73 2.21 10</span>
<span class="co"># H 1.60 1.62 1.67 1.64 1.70 1.81 10</span></code></pre></div>
<p>Of course, when running <code>mo_phylum("Firmicutes")</code> the function has zero knowledge about the actual microorganism, namely <em>S. aureus</em>. But since the result would be <code>"Firmicutes"</code> anyway, there is no point in calculating the result. And because this package contains all phyla of all known bacteria, it can just return the initial value immediately.</p>
</div>
<div class="section level3">
@ -349,18 +349,18 @@
times <span class="op">=</span> <span class="fl">100</span><span class="op">)</span>
<span class="fu"><a href="https://rdrr.io/r/base/print.html" class="external-link">print</a></span><span class="op">(</span><span class="va">run_it</span>, unit <span class="op">=</span> <span class="st">"ms"</span>, signif <span class="op">=</span> <span class="fl">4</span><span class="op">)</span>
<span class="co"># Unit: milliseconds</span>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># da 1.8950 1.9550 2.702 2.0530 2.465 46.650 100</span>
<span class="co"># de 1.9030 1.9750 3.182 2.1390 2.442 52.250 100</span>
<span class="co"># en 0.8658 0.8927 1.045 0.9821 1.132 1.727 100</span>
<span class="co"># es 1.9010 1.9960 4.028 2.2770 2.498 66.860 100</span>
<span class="co"># fr 1.7650 1.8400 3.124 1.9680 2.277 54.110 100</span>
<span class="co"># it 1.8780 1.9660 2.934 2.1150 2.479 64.780 100</span>
<span class="co"># nl 1.9200 1.9780 3.355 2.0880 2.466 57.900 100</span>
<span class="co"># pt 1.8540 1.9030 2.670 2.0280 2.386 47.620 100</span>
<span class="co"># ru 1.8070 1.8950 2.240 2.2520 2.432 3.715 100</span>
<span class="co"># sv 1.8310 1.8960 2.766 2.0890 2.359 57.690 100</span></code></pre></div>
<p>Currently supported languages are Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish.</p>
<span class="co"># expr min lq mean median uq max neval</span>
<span class="co"># da 1.9160 2.012 2.308 2.213 2.445 4.040 100</span>
<span class="co"># de 1.9130 2.057 3.165 2.358 2.495 44.140 100</span>
<span class="co"># en 0.8684 0.910 1.076 1.004 1.137 2.173 100</span>
<span class="co"># es 1.9060 2.066 3.304 2.335 2.595 60.500 100</span>
<span class="co"># fr 1.7950 1.888 2.169 2.104 2.338 3.366 100</span>
<span class="co"># it 1.8830 2.025 2.809 2.342 2.536 45.730 100</span>
<span class="co"># nl 1.9370 2.034 3.482 2.316 2.626 60.780 100</span>
<span class="co"># pt 1.8450 1.983 3.125 2.293 2.447 43.830 100</span>
<span class="co"># ru 1.8260 1.932 3.454 2.018 2.413 87.210 100</span>
<span class="co"># sv 1.8260 1.930 3.428 2.207 2.441 72.080 100</span></code></pre></div>
<p>Currently supported languages are Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish.</p>
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -44,7 +44,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="Released version">1.7.1.9072</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>
@ -790,7 +790,7 @@ If you are reading this page from within R, please <a href="https://msberends.gi
</h2>
<p>A data set with 134,956 rows and 2 columns, containing the following column names:<br><em>microorganism</em> and <em>antibiotic</em>.</p>
<p>This data set is in R available as <code>intrinsic_resistant</code>, after you load the <code>AMR</code> package.</p>
<p>It was last updated on 11 December 2021 14:59:42 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/intrinsic_resistant.html">here</a>.</p>
<p>It was last updated on 14 December 2021 17:16:54 UTC. Find more info about the structure of this data set <a href="https://msberends.github.io/AMR/reference/intrinsic_resistant.html">here</a>.</p>
<p><strong>Direct download links:</strong></p>
<ul>
<li>Download as <a href="https://github.com/msberends/AMR/raw/main/data-raw/../data-raw/intrinsic_resistant.rds" class="external-link">R file</a> (78 kB)<br>

View File

@ -17,7 +17,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="Released version">1.7.1.9070</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>

View File

@ -17,7 +17,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="Released version">1.7.1.9072</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>
@ -157,13 +157,13 @@
</div>
<div class="section level2">
<h2 class="page-header" data-toc-text="1.7.1.9072" id="amr-1719072">
<code>AMR</code> 1.7.1.9072<a class="anchor" aria-label="anchor" href="#amr-1719072"></a></h2>
<h2 class="page-header" data-toc-text="1.7.1.9073" id="amr-1719073">
<code>AMR</code> 1.7.1.9073<a class="anchor" aria-label="anchor" href="#amr-1719073"></a></h2>
<div class="section level3">
<h3 id="last-updated-december-1-7-1-9072"><small>Last updated: 14 December 2021</small><a class="anchor" aria-label="anchor" href="#last-updated-december-1-7-1-9072"></a></h3>
<h3 id="last-updated-december-1-7-1-9073"><small>Last updated: 14 December 2021</small><a class="anchor" aria-label="anchor" href="#last-updated-december-1-7-1-9073"></a></h3>
<p>All functions in this package are now all considered to be stable. Updates to the AMR interpretation rules (such as by EUCAST and CLSI), the microbial taxonomy, and the antibiotic dosages will all be updated every 6 to 12 months from now on.</p>
<div class="section level4">
<h4 id="breaking-changes-1-7-1-9072">Breaking changes<a class="anchor" aria-label="anchor" href="#breaking-changes-1-7-1-9072"></a></h4>
<h4 id="breaking-changes-1-7-1-9073">Breaking changes<a class="anchor" aria-label="anchor" href="#breaking-changes-1-7-1-9073"></a></h4>
<ul><li>Removed <code>p_symbol()</code> and all <code>filter_*()</code> functions (except for <code><a href="../reference/first_isolate.html">filter_first_isolate()</a></code>), which were all deprecated in a previous package version</li>
<li>Removed the <code>key_antibiotics()</code> and <code>key_antibiotics_equal()</code> functions, which were deprecated and superseded by <code><a href="../reference/key_antimicrobials.html">key_antimicrobials()</a></code> and <code><a href="../reference/key_antimicrobials.html">antimicrobials_equal()</a></code>
</li>
@ -171,7 +171,7 @@
<li>Renamed function <code>get_locale()</code> to <code><a href="../reference/translate.html">get_AMR_locale()</a></code> to prevent conflicts with other packages</li>
</ul></div>
<div class="section level4">
<h4 id="new-1-7-1-9072">New<a class="anchor" aria-label="anchor" href="#new-1-7-1-9072"></a></h4>
<h4 id="new-1-7-1-9073">New<a class="anchor" aria-label="anchor" href="#new-1-7-1-9073"></a></h4>
<ul><li><p>Support for the CLSI 2021 guideline for interpreting MIC/disk diffusion values, which are incorporated in the <code>rsi_translation</code> data set. This data set now more strictly follows the WHONET software as well.</p></li>
<li><p>Support for EUCAST Intrinsic Resistance and Unusual Phenotypes v3.3 (October 2021). This is now the default EUCAST guideline in the package (all older guidelines are still available) for <code><a href="../reference/eucast_rules.html">eucast_rules()</a></code>, <code><a href="../reference/mo_property.html">mo_is_intrinsic_resistant()</a></code> and <code><a href="../reference/mdro.html">mdro()</a></code>. The <code>intrinsic_resistant</code> data set was also updated accordingly.</p></li>
<li><p>Support for all antimicrobial drug (group) names and colloquial microorganism names in Danish, Dutch, English, French, German, Italian, Portuguese, Russian, Spanish and Swedish</p></li>
@ -186,7 +186,7 @@
<li><p>Function <code><a href="../reference/ab_property.html">ab_ddd_units()</a></code> to get units of DDDs (daily defined doses), deprecating the use of <code>ab_ddd(..., units = TRUE)</code> to be more consistent in data types of function output</p></li>
</ul></div>
<div class="section level4">
<h4 id="changed-1-7-1-9072">Changed<a class="anchor" aria-label="anchor" href="#changed-1-7-1-9072"></a></h4>
<h4 id="changed-1-7-1-9073">Changed<a class="anchor" aria-label="anchor" href="#changed-1-7-1-9073"></a></h4>
<ul><li>Updated the bacterial taxonomy to 5 October 2021 (according to <a href="https://lpsn.dsmz.de" class="external-link">LPSN</a>), including all 11 new staphylococcal species named since 1 January last year</li>
<li>The <code>antibiotics</code> data set now contains <strong>all ATC codes</strong> that are available through the <a href="https://www.whocc.no" class="external-link">WHOCC website</a>, regardless of drugs being present in more than one ATC group. This means that:
<ul><li>Some drugs now contain multiple ATC codes (e.g., metronidazole contains 5)</li>
@ -256,7 +256,7 @@
<code><a href="../reference/get_episode.html">get_episode()</a></code> and <code><a href="../reference/get_episode.html">is_new_episode()</a></code> can now cope with <code>NA</code>s</li>
</ul></div>
<div class="section level4">
<h4 id="other-1-7-1-9072">Other<a class="anchor" aria-label="anchor" href="#other-1-7-1-9072"></a></h4>
<h4 id="other-1-7-1-9073">Other<a class="anchor" aria-label="anchor" href="#other-1-7-1-9073"></a></h4>
<ul><li>This package is now being maintained by two epidemiologists and a data scientist from two different non-profit healthcare organisations.</li>
</ul></div>
</div>

View File

@ -17,7 +17,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="Released version">1.7.1.9070</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>

View File

@ -17,7 +17,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="Released version">1.7.1.9068</span>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">1.7.1.9073</span>
</span>
</div>
@ -165,12 +165,12 @@
<div id="format">
<h2>Format</h2>
<p>A <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with 134,956 observations and 2 variables:</p><ul><li><p><code>microorganism</code><br> Official taxonomic name of the microorganism, according to the LPSN</p></li>
<li><p><code>antibiotic</code><br> Official name of the antibiotic drug, according to the WHOCC</p></li>
<p>A <a href="https://rdrr.io/r/base/data.frame.html" class="external-link">data.frame</a> with 134,956 observations and 2 variables:</p><ul><li><p><code>mo</code><br> Microorganism ID</p></li>
<li><p><code>ab</code><br> Antibiotic ID</p></li>
</ul></div>
<div id="details">
<h2>Details</h2>
<p>The repository of this <code>AMR</code> package contains a file comprising this exact data set: <a href="https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt</a>. This file <strong>allows for machine reading EUCAST guidelines about intrinsic resistance</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.</p>
<p>The repository of this <code>AMR</code> package contains a file comprising this data set with full taxonomic and antibiotic names: <a href="https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt" class="external-link">https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt</a>. This file <strong>allows for machine reading EUCAST guidelines about intrinsic resistance</strong>, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.</p>
<p>This data set is based on <a href="https://www.eucast.org/expert_rules_and_intrinsic_resistance/" class="external-link">'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3</a> (2021).</p>
</div>
<div id="reference-data-publicly-available">

View File

@ -38,8 +38,8 @@ expect_true(all(microorganisms.codes$mo %in% microorganisms$mo))
expect_true(all(example_isolates$mo %in% microorganisms$mo))
expect_true(all(rsi_translation$mo %in% microorganisms$mo))
expect_true(all(rsi_translation$ab %in% antibiotics$ab))
expect_true(all(intrinsic_resistant$microorganism %in% microorganisms$fullname)) # also important for mo_is_intrinsic_resistant()
expect_true(all(intrinsic_resistant$antibiotic %in% antibiotics$name))
expect_true(all(intrinsic_resistant$mo %in% microorganisms$mo))
expect_true(all(intrinsic_resistant$ab %in% antibiotics$ab))
expect_false(any(is.na(microorganisms.codes$code)))
expect_false(any(is.na(microorganisms.codes$mo)))
expect_true(all(dosage$ab %in% antibiotics$ab))

View File

@ -7,8 +7,8 @@
\format{
A \link{data.frame} with 134,956 observations and 2 variables:
\itemize{
\item \code{microorganism}\cr Official taxonomic name of the microorganism, according to the LPSN
\item \code{antibiotic}\cr Official name of the antibiotic drug, according to the WHOCC
\item \code{mo}\cr Microorganism ID
\item \code{ab}\cr Antibiotic ID
}
}
\usage{
@ -18,7 +18,7 @@ intrinsic_resistant
Data set containing defined intrinsic resistance by EUCAST of all bug-drug combinations.
}
\details{
The repository of this \code{AMR} package contains a file comprising this exact data set: \url{https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt}. This file \strong{allows for machine reading EUCAST guidelines about intrinsic resistance}, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
The repository of this \code{AMR} package contains a file comprising this data set with full taxonomic and antibiotic names: \url{https://github.com/msberends/AMR/blob/main/data-raw/intrinsic_resistant.txt}. This file \strong{allows for machine reading EUCAST guidelines about intrinsic resistance}, which is almost impossible with the Excel and PDF files distributed by EUCAST. The file is updated automatically.
This data set is based on \href{https://www.eucast.org/expert_rules_and_intrinsic_resistance/}{'EUCAST Expert Rules' and 'EUCAST Intrinsic Resistance and Unusual Phenotypes' v3.3} (2021).
}

View File

@ -177,4 +177,4 @@ run_it <- microbenchmark(da = mo_name(CoNS, language = "da"),
print(run_it, unit = "ms", signif = 4)
```
Currently supported languages are `r AMR:::vector_and(names(AMR:::LANGUAGES_SUPPORTED))`.
Currently supported languages are `r AMR:::vector_and(names(AMR:::LANGUAGES_SUPPORTED), quotes = FALSE)`.