diff --git a/DESCRIPTION b/DESCRIPTION index 9ae2f8ce..9c8ef195 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: AMR -Version: 0.7.1.9104 +Version: 0.7.1.9105 Date: 2019-10-12 Title: Antimicrobial Resistance Analysis Authors@R: c( diff --git a/NEWS.md b/NEWS.md index 1506ee0f..b9e60df9 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# AMR 0.7.1.9104 +# AMR 0.7.1.9105 Last updated: 12-Oct-2019 ### Breaking diff --git a/docs/404.html b/docs/404.html index 06b98a56..4cc0d7f9 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 460d4d35..cc41073a 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 4cc6940c..8648b43d 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -41,7 +41,7 @@ @@ -321,67 +321,67 @@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,411 values changed)
+# Streptococcus pneumoniae (1,451 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,351 values changed)
+# Table 01: Intrinsic resistance in Enterobacteriaceae (1,325 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,698 values changed)
+# Table 04: Intrinsic resistance in Gram-positive bacteria (2,722 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,150 values changed)
-# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (105 values changed)
+# Non-EUCAST: amoxicillin/clav acid = S where ampicillin = S (2,240 values changed)
+# Non-EUCAST: ampicillin = R where amoxicillin/clav acid = R (134 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,413 out of 20,000 rows, making a total of 7,715 edits
+# EUCAST rules affected 6,530 out of 20,000 rows, making a total of 7,872 edits
# => added 0 test results
#
-# => changed 7,715 test results
-# - 108 test results changed from S to I
-# - 4,673 test results changed from S to R
-# - 1,037 test results changed from I to S
-# - 329 test results changed from I to R
-# - 1,546 test results changed from R to S
-# - 22 test results changed from R to I
+# => changed 7,872 test results
+# - 104 test results changed from S to I
+# - 4,728 test results changed from S to R
+# - 1,044 test results changed from I to S
+# - 344 test results changed from I to R
+# - 1,620 test results changed from R to S
+# - 32 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.4% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 28.3% 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 A2, 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 H5, sorted on date:
isolate | @@ -525,10 +525,10 @@||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-02 | -A2 | +2010-04-02 | +H5 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -536,8 +536,8 @@||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2 | -2010-02-28 | -A2 | +2010-05-11 | +H5 | B_ESCHR_COLI | S | S | @@ -547,41 +547,41 @@|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3 | -2010-03-02 | -A2 | +2010-08-11 | +H5 | B_ESCHR_COLI | +R | S | -S | -S | +R | S | FALSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4 | -2010-03-08 | -A2 | +2010-08-26 | +H5 | B_ESCHR_COLI | +S | +S | R | S | -S | -S | FALSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5 | -2010-05-16 | -A2 | +2010-11-17 | +H5 | B_ESCHR_COLI | R | -R | +S | S | S | FALSE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6 | -2010-09-25 | -A2 | +2010-12-20 | +H5 | B_ESCHR_COLI | S | S | @@ -591,43 +591,43 @@|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7 | -2011-01-03 | -A2 | +2011-03-21 | +H5 | B_ESCHR_COLI | -R | S | -R | +S | +S | S | FALSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8 | -2011-01-21 | -A2 | +2011-04-16 | +H5 | +B_ESCHR_COLI | +S | +S | +S | +S | +TRUE | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | +2011-07-03 | +H5 | B_ESCHR_COLI | R | -R | +S | S | S | FALSE | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9 | -2011-05-24 | -A2 | -B_ESCHR_COLI | -S | -S | -R | -S | -TRUE | -||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10 | -2011-06-13 | -A2 | +2011-07-07 | +H5 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -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,216 first weighted isolates (76.1% of total) +# => Found 15,117 first weighted isolates (75.6% of total)
isolate | @@ -663,10 +663,10 @@||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2010-02-02 | -A2 | +2010-04-02 | +H5 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -675,47 +675,47 @@||||
2 | -2010-02-28 | -A2 | +2010-05-11 | +H5 | B_ESCHR_COLI | S | S | S | S | FALSE | +FALSE | +|||
3 | +2010-08-11 | +H5 | +B_ESCHR_COLI | +R | +S | +R | +S | +FALSE | TRUE | |||||
3 | -2010-03-02 | -A2 | -B_ESCHR_COLI | -S | -S | -S | -S | -FALSE | -FALSE | -|||||
4 | -2010-03-08 | -A2 | +2010-08-26 | +H5 | B_ESCHR_COLI | +S | +S | R | S | -S | -S | FALSE | TRUE | |
5 | -2010-05-16 | -A2 | +2010-11-17 | +H5 | B_ESCHR_COLI | R | -R | +S | S | S | FALSE | @@ -723,8 +723,8 @@|||
6 | -2010-09-25 | -A2 | +2010-12-20 | +H5 | B_ESCHR_COLI | S | S | @@ -735,46 +735,46 @@|||||||
7 | -2011-01-03 | -A2 | +2011-03-21 | +H5 | B_ESCHR_COLI | -R | S | -R | +S | +S | S | FALSE | -TRUE | +FALSE |
8 | -2011-01-21 | -A2 | +2011-04-16 | +H5 | B_ESCHR_COLI | -R | -R | S | S | -FALSE | +S | +S | +TRUE | TRUE |
9 | -2011-05-24 | -A2 | +2011-07-03 | +H5 | B_ESCHR_COLI | -S | -S | R | S | -TRUE | +S | +S | +FALSE | TRUE |
10 | -2011-06-13 | -A2 | +2011-07-07 | +H5 | B_ESCHR_COLI | -R | +S | S | S | S | @@ -783,11 +783,11 @@
Instead of 2, now 9 isolates are flagged. In total, 76.1% of all isolates are marked ‘first weighted’ - 47.7% 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 2, now 8 isolates are flagged. In total, 75.6% of all isolates are marked ‘first weighted’ - 47.2% 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,216 isolates for analysis.
+So we end up with 15,117 isolates for analysis.
We can remove unneeded columns:
@@ -795,7 +795,6 @@date | patient_id | hospital | @@ -812,62 +811,28 @@||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | -2013-11-09 | -N10 | -Hospital B | -B_STRPT_PNMN | -S | -S | -S | -R | -F | -Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -|||
2 | -2015-04-24 | -S9 | -Hospital D | -B_STPHY_AURS | -R | -R | -R | -S | -F | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||
3 | -2010-09-03 | -Y7 | -Hospital C | -B_ESCHR_COLI | -S | -S | -R | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -|||
4 | -2012-01-10 | -H4 | +2017-03-23 | +O1 | Hospital A | B_ESCHR_COLI | S | S | -R | +S | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +
2016-10-13 | +G10 | +Hospital D | +B_ESCHR_COLI | +I | +S | +S | S | M | Gram-negative | @@ -876,13 +841,12 @@TRUE | ||||||
5 | -2015-10-06 | +2017-11-09 | M7 | -Hospital C | +Hospital D | B_ESCHR_COLI | -S | -S | +R | +R | S | S | M | @@ -892,14 +856,28 @@TRUE | ||
7 | -2010-10-26 | -V9 | -Hospital C | +2016-03-31 | +P9 | +Hospital D | +B_ESCHR_COLI | +S | +S | +R | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +
2015-07-16 | +U2 | +Hospital B | B_STRPT_PNMN | -S | -S | -S | +R | +R | +R | R | F | Gram-positive | @@ -907,6 +885,21 @@pneumoniae | TRUE | ||
2014-10-22 | +B8 | +Hospital B | +B_STPHY_AURS | +S | +S | +S | +S | +M | +Gram-positive | +Staphylococcus | +aureus | +TRUE | +
Time for the analysis!
@@ -926,7 +919,7 @@Frequency table
Class: character
-Length: 15,216 (of which NA: 0 = 0%)
+Length: 15,117 (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) %>%
@@ -993,19 +986,19 @@ Longest: 24
Hospital A
-0.4673913
+0.4604743
Hospital B
-0.4702744
+0.4653298
Hospital C
-0.4699524
+0.4791855
Hospital D
-0.4635025
+0.4865761
Last updated: 12-Oct-2019
as.mo(..., allow_uncertain = 3)
Contents