diff --git a/DESCRIPTION b/DESCRIPTION index 89fc22f1..9aa19876 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 0.8.0 -Date: 2019-10-15 +Version: 0.8.0.9000 +Date: 2019-10-16 Title: Antimicrobial Resistance Analysis Authors@R: c( person(role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index cd122d95..172eae0d 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,12 @@ -# AMR 0.8.0 +# AMR 0.8.0.9000 +Last updated: 16-Oct-2019 +### New + +### Changes + + +# AMR 0.8.0 ### 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`: diff --git a/docs/404.html b/docs/404.html index ddedb2ac..5d5331de 100644 --- a/docs/404.html +++ b/docs/404.html @@ -84,7 +84,7 @@
diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 768a238d..2cef744e 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 59dfd80e..dce1f69e 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -187,7 +187,7 @@AMR.Rmd
Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 13 October 2019.
+Note: values on this page will change with every website update since they are based on randomly created values and the page was written in R Markdown. However, the methodology remains unchanged. This page was generated on 16 October 2019.
So, we can draw at least two conclusions immediately. From a data scientists perspective, the data looks clean: only values M
and F
. From a researchers perspective: there are slightly more men. Nothing we didn’t already know.
The data is already quite clean, but we still need to transform some variables. The bacteria
column now consists of text, and we want to add more variables based on microbial IDs later on. So, we will transform this column to valid IDs. The mutate()
function of the dplyr
package makes this really easy:
data <- data %>%
@@ -438,14 +438,14 @@
# Pasteurella multocida (no changes)
# Staphylococcus (no changes)
# Streptococcus groups A, B, C, G (no changes)
-# Streptococcus pneumoniae (1,461 values changed)
+# Streptococcus pneumoniae (1,483 values changed)
# Viridans group streptococci (no changes)
#
# EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes (v3.1, 2016)
-# Table 01: Intrinsic resistance in Enterobacteriaceae (1,290 values changed)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1,268 values changed)
# Table 02: Intrinsic resistance in non-fermentative Gram-negative bacteria (no changes)
# Table 03: Intrinsic resistance in other Gram-negative bacteria (no changes)
-# Table 04: Intrinsic resistance in Gram-positive bacteria (2,724 values changed)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2,755 values changed)
# Table 08: Interpretive rules for B-lactam agents and Gram-positive cocci (no changes)
# Table 09: Interpretive rules for B-lactam agents and Gram-negative rods (no changes)
# Table 11: Interpretive rules for macrolides, lincosamides, and streptogramins (no changes)
@@ -453,24 +453,24 @@
# Table 13: Interpretive rules for quinolones (no changes)
#
# Other rules
-# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,293 values changed)
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (126 values changed)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,282 values changed)
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (122 values changed)
# Non-EUCAST: piperacillin = R where piperacillin/tazobactam = R (no changes)
# Non-EUCAST: piperacillin/tazobactam = S where piperacillin = S (no changes)
# Non-EUCAST: trimethoprim = R where trimethoprim/sulfa = R (no changes)
# Non-EUCAST: trimethoprim/sulfa = S where trimethoprim = S (no changes)
#
# --------------------------------------------------------------------------
-# EUCAST rules affected 6,534 out of 20,000 rows, making a total of 7,894 edits
+# EUCAST rules affected 6,530 out of 20,000 rows, making a total of 7,910 edits
# => added 0 test results
#
-# => changed 7,894 test results
-# - 126 test results changed from S to I
-# - 4,707 test results changed from S to R
-# - 1,073 test results changed from I to S
-# - 317 test results changed from I to R
-# - 1,653 test results changed from R to S
-# - 18 test results changed from R to I
+# => changed 7,910 test results
+# - 109 test results changed from S to I
+# - 4,678 test results changed from S to R
+# - 1,098 test results changed from I to S
+# - 322 test results changed from I to R
+# - 1,676 test results changed from R to S
+# - 27 test results changed from R to I
# --------------------------------------------------------------------------
#
# Use eucast_rules(..., verbose = TRUE) (on your original data) to get a data.frame with all specified edits instead.
So only 28.3% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 28.4% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
For future use, the above two syntaxes can be shortened with the filter_first_isolate()
function:
We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient X9, sorted on date:
+We made a slight twist to the CLSI algorithm, to take into account the antimicrobial susceptibility profile. Have a look at all isolates of patient I4, sorted on date:
isolate | @@ -525,8 +525,8 @@|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-01-31 | -X9 | +2010-02-10 | +I4 | B_ESCHR_COLI | R | S | @@ -536,10 +536,10 @@||||
2 | -2010-04-03 | -X9 | +2010-02-19 | +I4 | B_ESCHR_COLI | -I | +S | S | S | S | @@ -547,8 +547,8 @@|
3 | -2010-05-12 | -X9 | +2010-03-09 | +I4 | B_ESCHR_COLI | S | S | @@ -558,10 +558,10 @@||||
4 | -2010-08-29 | -X9 | +2010-04-06 | +I4 | B_ESCHR_COLI | -R | +I | S | R | S | @@ -569,8 +569,8 @@|
5 | -2011-01-07 | -X9 | +2010-07-14 | +I4 | B_ESCHR_COLI | S | S | @@ -580,30 +580,30 @@||||
6 | -2011-04-20 | -X9 | +2010-08-03 | +I4 | B_ESCHR_COLI | -S | -S | -S | -S | -TRUE | -|
7 | -2011-06-24 | -X9 | -B_ESCHR_COLI | -R | +I | S | R | R | FALSE | ||
7 | +2010-09-19 | +I4 | +B_ESCHR_COLI | +S | +S | +S | +S | +FALSE | +|||
8 | -2011-07-10 | -X9 | +2010-09-19 | +I4 | B_ESCHR_COLI | S | S | @@ -613,21 +613,21 @@||||
9 | -2011-11-07 | -X9 | +2010-10-05 | +I4 | B_ESCHR_COLI | S | S | S | -R | +S | FALSE |
10 | -2011-12-20 | -X9 | +2010-12-30 | +I4 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -635,7 +635,7 @@
Only 2 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
Only 1 isolates are marked as ‘first’ according to CLSI guideline. But when reviewing the antibiogram, it is obvious that some isolates are absolutely different strains and should be included too. This is why we weigh isolates, based on their antibiogram. The key_antibiotics()
function adds a vector with 18 key antibiotics: 6 broad spectrum ones, 6 small spectrum for Gram negatives and 6 small spectrum for Gram positives. These can be defined by the user.
If a column exists with a name like ‘key(…)ab’ the first_isolate()
function will automatically use it and determine the first weighted isolates. Mind the NOTEs in below output:
data <- data %>%
mutate(keyab = key_antibiotics(.)) %>%
@@ -646,7 +646,7 @@
# NOTE: Using column `patient_id` as input for `col_patient_id`.
# NOTE: Using column `keyab` as input for `col_keyantibiotics`. Use col_keyantibiotics = FALSE to prevent this.
# [Criterion] Inclusion based on key antibiotics, ignoring I
-# => Found 15,141 first weighted isolates (75.7% of total)
isolate | @@ -663,8 +663,8 @@|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-01-31 | -X9 | +2010-02-10 | +I4 | B_ESCHR_COLI | R | S | @@ -675,20 +675,20 @@||||||||
2 | -2010-04-03 | -X9 | +2010-02-19 | +I4 | B_ESCHR_COLI | -I | +S | S | S | S | FALSE | -FALSE | +TRUE | ||
3 | -2010-05-12 | -X9 | +2010-03-09 | +I4 | B_ESCHR_COLI | S | S | @@ -699,10 +699,10 @@||||||||
4 | -2010-08-29 | -X9 | +2010-04-06 | +I4 | B_ESCHR_COLI | -R | +I | S | R | S | @@ -711,8 +711,8 @@|||||
5 | -2011-01-07 | -X9 | +2010-07-14 | +I4 | B_ESCHR_COLI | S | S | @@ -723,71 +723,71 @@||||||||
6 | -2011-04-20 | -X9 | +2010-08-03 | +I4 | B_ESCHR_COLI | +I | S | -S | -S | -S | -TRUE | +R | +R | +FALSE | TRUE |
7 | -2011-06-24 | -X9 | +2010-09-19 | +I4 | B_ESCHR_COLI | -R | S | -R | -R | +S | +S | +S | FALSE | TRUE | |
8 | -2011-07-10 | -X9 | +2010-09-19 | +I4 | B_ESCHR_COLI | S | S | S | S | FALSE | -TRUE | +FALSE | |||
9 | -2011-11-07 | -X9 | +2010-10-05 | +I4 | B_ESCHR_COLI | S | S | S | -R | +S | +FALSE | FALSE | -TRUE | ||
10 | -2011-12-20 | -X9 | +2010-12-30 | +I4 | B_ESCHR_COLI | -R | +S | S | S | S | FALSE | -TRUE | +FALSE |
Instead of 2, now 8 isolates are flagged. In total, 75.7% of all isolates are marked ‘first weighted’ - 47.4% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
+Instead of 1, now 6 isolates are flagged. In total, 75.7% of all isolates are marked ‘first weighted’ - 47.3% more than when using the CLSI guideline. In real life, this novel algorithm will yield 5-10% more isolates than the classic CLSI guideline.
As with filter_first_isolate()
, there’s a shortcut for this new algorithm too:
So we end up with 15,141 isolates for analysis.
+So we end up with 15,143 isolates for analysis.
We can remove unneeded columns:
@@ -795,6 +795,7 @@date | patient_id | hospital | @@ -811,95 +812,101 @@||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2011-07-28 | -N6 | -Hospital C | +1 | +2012-05-14 | +G6 | +Hospital B | B_ESCHR_COLI | R | -R | -R | S | -F | +R | +R | +M | Gram-negative | Escherichia | coli | TRUE | |
2012-08-16 | -Q6 | -Hospital C | +3 | +2010-04-06 | +F7 | +Hospital B | B_ESCHR_COLI | +I | S | -S | -S | -S | -F | +R | +R | +M | Gram-negative | Escherichia | coli | TRUE |
2017-05-07 | -G5 | +5 | +2017-05-22 | +T6 | Hospital A | B_STPHY_AURS | -S | -S | -S | R | -M | +S | +S | +S | +F | Gram-positive | Staphylococcus | aureus | TRUE | |
2015-10-29 | -V10 | +6 | +2012-06-06 | +X7 | Hospital D | -B_ESCHR_COLI | -S | -S | -S | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -|||||
2013-08-21 | -U1 | -Hospital A | -B_ESCHR_COLI | -R | -S | -R | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -||||||||
2017-06-24 | -K6 | -Hospital A | B_STPHY_AURS | R | S | S | S | -M | +F | Gram-positive | Staphylococcus | aureus | TRUE | |||||||
7 | +2010-02-15 | +O1 | +Hospital A | +B_STPHY_AURS | +S | +S | +R | +S | +F | +Gram-positive | +Staphylococcus | +aureus | +TRUE | +|||||||
9 | +2016-11-25 | +C6 | +Hospital B | +B_ESCHR_COLI | +S | +S | +S | +S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +
Time for the analysis!
@@ -919,7 +926,7 @@Frequency table
Class: character
-Length: 15,141 (of which NA: 0 = 0%)
+Length: 15,143 (of which NA: 0 = 0%)
Unique: 4
Shortest: 16
Longest: 24
The functions portion_S()
, portion_SI()
, portion_I()
, portion_IR()
and portion_R()
can be used to determine the portion of a specific antimicrobial outcome. As per the EUCAST guideline of 2019, we calculate resistance as the portion of R (portion_R()
) and susceptibility as the portion of S and I (portion_SI()
). These functions can be used on their own:
Or can be used in conjuction with group_by()
and summarise()
, both from the dplyr
package:
data_1st %>%
group_by(hospital) %>%
@@ -986,19 +993,19 @@ Longest: 24
Hospital A
-0.4748959
+0.4672547
Hospital B
-0.4543224
+0.4670225
Hospital C
-0.4659041
+0.4648625
Hospital D
-0.4712529
+0.4669489
@@ -1016,23 +1023,23 @@ Longest: 24
Hospital A
-0.4748959
-4561
+0.4672547
+4535
Hospital B
-0.4543224
-5298
+0.4670225
+5246
Hospital C
-0.4659041
-2273
+0.4648625
+2291
Hospital D
-0.4712529
-3009
+0.4669489
+3071
@@ -1052,27 +1059,27 @@ Longest: 24
Escherichia
-0.9285141
-0.8966533
-0.9929050
+0.9247870
+0.8880458
+0.9928115
Klebsiella
-0.8225602
-0.9017744
-0.9866920
+0.8132569
+0.8986616
+0.9859783
Staphylococcus
-0.9250592
-0.9261110
-0.9968446
+0.9138518
+0.9185651
+0.9934538
Streptococcus
-0.6200873
+0.6290682
0.0000000
-0.6200873
+0.6290682
diff --git a/docs/articles/AMR_files/figure-html/plot 1-1.png b/docs/articles/AMR_files/figure-html/plot 1-1.png
index fca887cd..a144724e 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 1-1.png and b/docs/articles/AMR_files/figure-html/plot 1-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 3-1.png b/docs/articles/AMR_files/figure-html/plot 3-1.png
index b8ebcdbd..20422eb8 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 3-1.png and b/docs/articles/AMR_files/figure-html/plot 3-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 4-1.png b/docs/articles/AMR_files/figure-html/plot 4-1.png
index 1324b492..a48b12f0 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 4-1.png and b/docs/articles/AMR_files/figure-html/plot 4-1.png differ
diff --git a/docs/articles/AMR_files/figure-html/plot 5-1.png b/docs/articles/AMR_files/figure-html/plot 5-1.png
index 9283f3d8..a83c0cd7 100644
Binary files a/docs/articles/AMR_files/figure-html/plot 5-1.png and b/docs/articles/AMR_files/figure-html/plot 5-1.png differ
diff --git a/docs/articles/EUCAST.html b/docs/articles/EUCAST.html
index 6dc6f418..f526acd5 100644
--- a/docs/articles/EUCAST.html
+++ b/docs/articles/EUCAST.html
@@ -187,7 +187,7 @@
How to apply EUCAST rules
Matthijs S. Berends
- 13 October 2019
+ 16 October 2019
EUCAST.Rmd
diff --git a/docs/articles/MDR.html b/docs/articles/MDR.html
index 5c47c259..358937dc 100644
--- a/docs/articles/MDR.html
+++ b/docs/articles/MDR.html
@@ -187,7 +187,7 @@
How to determine multi-drug resistance (MDR)
Matthijs S. Berends
- 13 October 2019
+ 16 October 2019
MDR.Rmd
@@ -230,18 +230,18 @@
The data set looks like this now:
head(my_TB_data)
# rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-# 1 R S S I S S
-# 2 I R S R S R
-# 3 S S R R R R
-# 4 S R R S S S
-# 5 S R R S R R
-# 6 R S S R R S
+# 1 S S R S R S
+# 2 S R R S S R
+# 3 R R S S R S
+# 4 R R R S S S
+# 5 R R R R R R
+# 6 R R R I S R
# kanamycin
-# 1 R
-# 2 R
-# 3 I
+# 1 I
+# 2 S
+# 3 R
# 4 S
-# 5 S
+# 5 R
# 6 S
We can now add the interpretation of MDR-TB to our data set:
my_TB_data$mdr <- mdr_tb(my_TB_data)
@@ -275,40 +275,40 @@ Unique: 5
1
Mono-resistant
-3246
-64.92%
-3246
-64.92%
+3276
+65.52%
+3276
+65.52%
2
Negative
-681
-13.62%
-3927
-78.54%
+658
+13.16%
+3934
+78.68%
3
Multi-drug-resistant
-593
-11.86%
-4520
-90.40%
+616
+12.32%
+4550
+91.00%
4
Poly-resistant
-276
-5.52%
-4796
-95.92%
+256
+5.12%
+4806
+96.12%
5
Extensive drug-resistant
-204
-4.08%
+194
+3.88%
5000
100.00%
diff --git a/docs/articles/SPSS.html b/docs/articles/SPSS.html
index 6d83ebb3..fc505d82 100644
--- a/docs/articles/SPSS.html
+++ b/docs/articles/SPSS.html
@@ -187,7 +187,7 @@
How to import data from SPSS / SAS / Stata
Matthijs S. Berends
- 13 October 2019
+ 16 October 2019
SPSS.Rmd
diff --git a/docs/articles/WHONET.html b/docs/articles/WHONET.html
index 21c490ca..37e1556e 100644
--- a/docs/articles/WHONET.html
+++ b/docs/articles/WHONET.html
@@ -187,7 +187,7 @@
How to work with WHONET data
Matthijs S. Berends
- 13 October 2019
+ 16 October 2019
WHONET.Rmd
diff --git a/docs/articles/benchmarks.html b/docs/articles/benchmarks.html
index db624434..8016368f 100644
--- a/docs/articles/benchmarks.html
+++ b/docs/articles/benchmarks.html
@@ -187,7 +187,7 @@
Benchmarks
Matthijs S. Berends
- 13 October 2019
+ 16 October 2019
benchmarks.Rmd
@@ -221,36 +221,21 @@
times = 10)
print(S.aureus, unit = "ms", signif = 2)
# Unit: milliseconds
-# expr min lq mean median uq max
-# as.mo("sau") 9.5 9.7 15 10 11 34
-# as.mo("stau") 31.0 32.0 38 33 34 62
-# as.mo("STAU") 31.0 32.0 39 35 39 56
-# as.mo("staaur") 9.6 10.0 17 11 31 31
-# as.mo("STAAUR") 9.6 9.8 13 10 10 34
-# as.mo("S. aureus") 24.0 25.0 27 25 28 33
-# as.mo("S aureus") 24.0 25.0 31 25 43 51
-# as.mo("Staphylococcus aureus") 29.0 30.0 32 31 34 39
-# as.mo("Staphylococcus aureus (MRSA)") 550.0 580.0 610 600 620 680
-# as.mo("Sthafilokkockus aaureuz") 290.0 310.0 360 340 380 530
-# as.mo("MRSA") 9.6 10.0 16 10 30 32
-# as.mo("VISA") 19.0 20.0 21 20 21 22
-# as.mo("VRSA") 20.0 20.0 26 21 24 46
-# as.mo(22242419) 18.0 18.0 19 19 19 22
-# neval
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
-# 10
+# expr min lq mean median uq max neval
+# as.mo("sau") 9.9 10 14 11 12 35 10
+# as.mo("stau") 33.0 33 39 38 39 52 10
+# as.mo("STAU") 32.0 36 44 38 56 68 10
+# as.mo("staaur") 10.0 10 13 11 11 34 10
+# as.mo("STAAUR") 10.0 11 19 12 33 42 10
+# as.mo("S. aureus") 25.0 26 32 28 32 53 10
+# as.mo("S aureus") 24.0 25 31 27 30 52 10
+# as.mo("Staphylococcus aureus") 31.0 32 39 34 38 84 10
+# as.mo("Staphylococcus aureus (MRSA)") 610.0 640 680 680 710 770 10
+# as.mo("Sthafilokkockus aaureuz") 330.0 340 350 350 360 370 10
+# as.mo("MRSA") 9.8 10 13 11 12 34 10
+# as.mo("VISA") 20.0 22 29 24 31 57 10
+# as.mo("VRSA") 20.0 20 29 23 42 47 10
+# as.mo(22242419) 21.0 23 30 25 43 47 10
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 100 milliseconds, this is only 10 input values per second. The second input is the only one that has to be looked up thoroughly. All the others are known codes (the first one is a WHONET code) or common laboratory codes, or common full organism names like the last one. Full organism names are always preferred.
To achieve this speed, the as.mo
function also takes into account the prevalence of human pathogenic microorganisms. The downside is of course that less prevalent microorganisms will be determined less fast. See this example for the ID of Methanosarcina semesiae (B_MTHNSR_SEMS
), a bug probably never found before in humans:
That takes 15.8 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like Methanosarcina semesiae) are almost fast - these are the most probable input from most data sets.
+# 1437.00 10 +# 1488.00 10 +# 2169.00 10 +# 2245.00 10 +# 57.04 10 +That takes 14.3 times as much time on average. A value of 100 milliseconds means it can only determine ~10 different input values per second. We can conclude that looking up arbitrary codes of less prevalent microorganisms is the worst way to go, in terms of calculation performance. Full names (like Methanosarcina semesiae) are almost fast - these are the most probable input from most data sets.
In the figure below, we compare Escherichia coli (which is very common) with Prevotella brevis (which is moderately common) and with Methanosarcina semesiae (which is uncommon):
In reality, the as.mo()
functions learns from its own output to speed up determinations for next times. In above figure, this effect was disabled to show the difference with the boxplot below - when you would use as.mo()
yourself:
So transforming 500,000 values (!!) of 50 unique values only takes 0.64 seconds (641 ms). You only lose time on your unique input values.
+# mo_name(x) 645 661 683 672 686 771 10 +So transforming 500,000 values (!!) of 50 unique values only takes 0.67 seconds (671 ms). You only lose time on your unique input values.
So going from mo_name("Staphylococcus aureus")
to "Staphylococcus aureus"
takes 0.0009 seconds - it doesn’t even start calculating if the result would be the same as the expected resulting value. That goes for all helper functions:
run_it <- microbenchmark(A = mo_species("aureus"),
B = mo_genus("Staphylococcus"),
@@ -341,14 +326,14 @@
print(run_it, unit = "ms", signif = 3)
# Unit: milliseconds
# expr min lq mean median uq max neval
-# A 0.457 0.463 0.477 0.476 0.483 0.511 10
-# B 0.486 0.496 0.508 0.499 0.512 0.569 10
-# C 0.781 0.803 0.825 0.829 0.847 0.854 10
-# D 0.479 0.495 0.528 0.510 0.517 0.749 10
-# E 0.457 0.464 0.484 0.475 0.498 0.547 10
-# F 0.458 0.464 0.472 0.468 0.477 0.496 10
-# G 0.446 0.453 0.462 0.459 0.467 0.499 10
-# H 0.426 0.458 0.467 0.467 0.472 0.507 10
Of course, when running mo_phylum("Firmicutes")
the function has zero knowledge about the actual microorganism, namely S. aureus. But since the result would be "Firmicutes"
too, there is no point in calculating the result. And because this package ‘knows’ all phyla of all known bacteria (according to the Catalogue of Life), it can just return the initial value immediately.
Currently supported are German, Dutch, Spanish, Italian, French and Portuguese.
diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png index 0a8e05ae..b1ec4b1d 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-11-1.png differ diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png index 573a5c9a..3bc10897 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-5-1.png differ diff --git a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png index 99e3e3cd..e85fcf12 100644 Binary files a/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png and b/docs/articles/benchmarks_files/figure-html/unnamed-chunk-9-1.png differ diff --git a/docs/articles/index.html b/docs/articles/index.html index b6858dc1..676662c1 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -84,7 +84,7 @@ diff --git a/docs/articles/resistance_predict.html b/docs/articles/resistance_predict.html index 3c84e184..3ad919fe 100644 --- a/docs/articles/resistance_predict.html +++ b/docs/articles/resistance_predict.html @@ -187,7 +187,7 @@resistance_predict.Rmd
AMR
(for R)?AMR
is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 20,000 times from more than 40 countries (source: CRAN logs, 2019).
AMR
is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 60 countries (source: CRAN logs, 2019).
After installing this package, R knows ~70,000 microorganisms (distinct microbial species) and ~450 antibiotics by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.
We created this package for both routine analysis and academic research (as part of our PhD theses) at the Faculty of Medical Sciences of the University of Groningen, the Netherlands, and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and is free software (see Copyright).
Used to SPSS? Read our tutorial on how to import data from SPSS, SAS or Stata.
diff --git a/docs/news/index.html b/docs/news/index.html index 2230a9ef..fa69d25f 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -84,7 +84,7 @@Last updated: 15-Oct-2019
"testvalue"
could never be
Renamed data set septic_patients
to example_isolates
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:
also_single_tested
w
Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
also_single_tested
w
as.rsi()
on an MIC value (created with as.mic()
), a disk diffusion value (created with the new as.disk()
) or on a complete date set containing columns with MIC or disk diffusion values.mo_name()
as alias of mo_fullname()
@@ -585,9 +598,9 @@ Please
+as.mo()
to identify an MO code.as.mo(..., allow_uncertain = 3)
AMR 0.5.0 2018-11-30
-
+
-New
+New
- Repository moved to GitLab: https://gitlab.com/msberends/AMR
@@ -939,9 +952,9 @@ Using as.mo(..., allow_uncertain = 3)
AMR 0.4.0 2018-10-01
-
+
-New
+New
- The data set
microorganisms
now contains all microbial taxonomic data from ITIS (kingdoms Bacteria, Fungi and Protozoa), the Integrated Taxonomy Information System, available via https://itis.gov. The data set now contains more than 18,000 microorganisms with all known bacteria, fungi and protozoa according ITIS with genus, species, subspecies, family, order, class, phylum and subkingdom. The new data set microorganisms.old
contains all previously known taxonomic names from those kingdoms.
- New functions based on the existing function
mo_property
:
@@ -1074,9 +1087,9 @@ Using as.mo(..., allow_uncertain = 3)
AMR 0.3.0 2018-08-14
-
+
-New
+New
-
BREAKING:
rsi_df
was removed in favour of new functions portion_R
, portion_IR
, portion_I
, portion_SI
and portion_S
to selectively calculate resistance or susceptibility. These functions are 20 to 30 times faster than the old rsi
function. The old function still works, but is deprecated.
@@ -1211,9 +1224,9 @@ Using as.mo(..., allow_uncertain = 3)
AMR 0.2.0 2018-05-03
-
+
-New
+New
- Full support for Windows, Linux and macOS
- Full support for old R versions, only R-3.0.0 (April 2013) or later is needed (needed packages may have other dependencies)
@@ -1292,7 +1305,8 @@ Using as.mo(..., allow_uncertain = 3)
Contents
diff --git a/index.md b/index.md
index 0f0f5448..082371c7 100644
--- a/index.md
+++ b/index.md
@@ -6,7 +6,7 @@
### What is `AMR` (for R)?
-`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 20,000 times from more than 40 countries (source: [CRAN logs, 2019](https://cran-logs.rstudio.com)).
+`AMR` is a free and open-source [R package](https://www.r-project.org) to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. Since its first public release in early 2018, this package has been downloaded over 25,000 times from more than 60 countries (source: [CRAN logs, 2019](https://cran-logs.rstudio.com)).
After installing this package, R knows [**~70,000 microorganisms**](./reference/microorganisms.html) (distinct microbial species) and [**~450 antibiotics**](./reference/antibiotics.html) by name and code, and knows all about valid RSI and MIC values. It supports any data format, including WHONET/EARS-Net data.