diff --git a/DESCRIPTION b/DESCRIPTION index c5a7b19d..38aea241 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: AMR -Version: 1.7.1.9046 -Date: 2021-10-03 +Version: 1.7.1.9048 +Date: 2021-10-04 Title: Antimicrobial Resistance Data Analysis Description: Functions to simplify and standardise antimicrobial resistance (AMR) data analysis and to work with microbial and antimicrobial properties by diff --git a/NEWS.md b/NEWS.md index 61e9d4d8..1166ed5b 100755 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,5 @@ -# `AMR` 1.7.1.9046 -## Last updated: 3 October 2021 +# `AMR` 1.7.1.9048 +## Last updated: 4 October 2021 ### Breaking changes * Removed `p_symbol()` and all `filter_*()` functions (except for `filter_first_isolate()`), which were all deprecated in a previous package version diff --git a/data-raw/AMR_latest.tar.gz b/data-raw/AMR_latest.tar.gz index 41eb9178..847e34bc 100644 Binary files a/data-raw/AMR_latest.tar.gz and b/data-raw/AMR_latest.tar.gz differ diff --git a/docs/articles/AMR.html b/docs/articles/AMR.html index 17e963e0..2f9c29b4 100644 --- a/docs/articles/AMR.html +++ b/docs/articles/AMR.html @@ -44,7 +44,7 @@
@@ -191,7 +191,7 @@vignettes/AMR.Rmd
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 29 September 2021.
+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 04 October 2021.
So only 53.1% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
So only 52.8% is suitable for resistance analysis! We can now filter on it with the filter()
function, also from the dplyr
package:
data_1st <- data %>%
filter(first == TRUE)
data_1st <- data %>%
filter_first_isolate()
So we end up with 10,617 isolates for analysis. Now our data looks like:
+So we end up with 10,567 isolates for analysis. Now our data looks like:
head(data_1st)
2 | +2016-12-13 | +P9 | +Hospital D | +B_ESCHR_COLI | +S | +S | +S | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +||||||||||
3 | -2010-01-01 | -H4 | +2013-09-17 | +S3 | Hospital A | -B_ESCHR_COLI | +B_STRPT_PNMN | +S | +S | R | -S | -S | -S | -M | -Gram-negative | -Escherichia | -coli | +R | +F | +Gram-positive | +Streptococcus | +pneumoniae | TRUE |
4 | -2014-12-09 | -C5 | -Hospital B | -B_ESCHR_COLI | -S | -S | -S | -S | -M | -Gram-negative | -Escherichia | -coli | -TRUE | -||||||||||
6 | -2010-11-16 | -X9 | -Hospital A | -B_ESCHR_COLI | -R | -S | -S | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -||||||||||
8 | -2011-07-04 | -T1 | -Hospital D | -B_ESCHR_COLI | -S | -S | -R | -S | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -||||||||||
10 | -2012-05-19 | -M7 | -Hospital D | +2017-10-22 | +R4 | +Hospital C | B_STPHY_AURS | -R | -R | -R | S | -M | +S | +S | +S | +F | Gram-positive | Staphylococcus | aureus | TRUE | |||
14 | -2016-05-14 | -C2 | -Hospital D | +9 | +2014-05-28 | +Y8 | +Hospital B | B_ESCHR_COLI | R | -I | +S | R | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +|||||
11 | +2010-02-13 | +Y5 | +Hospital A | +B_ESCHR_COLI | +R | +S | +S | +S | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +||||||||||
12 | +2010-01-30 | +F3 | +Hospital C | +B_ESCHR_COLI | +R | +R | +S | R | M | Gram-negative | @@ -665,8 +665,8 @@ Longest: 1|||||||||||||
1 | Escherichia coli | -4,569 | -43.03% | -4,569 | -43.03% | +4,623 | +43.75% | +4,623 | +43.75% | ||||||||||||||
2 | Staphylococcus aureus | -2,718 | -25.60% | -7,287 | -68.64% | +2,765 | +26.17% | +7,388 | +69.92% | ||||||||||||||
3 | Streptococcus pneumoniae | -2,158 | -20.33% | -9,445 | -88.96% | +2,017 | +19.09% | +9,405 | +89.00% | ||||||||||||||
4 | Klebsiella pneumoniae | -1,172 | -11.04% | -10,617 | +1,162 | +11.00% | +10,567 | 100.00% | |||||||||||||||
2016-05-14 | -C2 | -Hospital D | +2013-09-17 | +S3 | +Hospital A | +B_STRPT_PNMN | +S | +S | +R | +R | +F | +Gram-positive | +Streptococcus | +pneumoniae | +TRUE | +||||||||
2010-01-30 | +F3 | +Hospital C | B_ESCHR_COLI | R | -I | R | +S | R | M | Gram-negative | @@ -770,28 +785,13 @@ Longest: 24coli | TRUE | |||||||||||
2013-08-08 | -C10 | -Hospital C | -B_STRPT_PNMN | -S | -S | -S | -R | -M | -Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -|||||||||||
2017-08-12 | -H8 | -Hospital D | +2011-10-02 | +B9 | +Hospital C | B_STRPT_PNMN | -S | -S | +I | +I | S | R | M | @@ -801,42 +801,12 @@ Longest: 24TRUE | |||||||||
2012-09-19 | -S7 | -Hospital C | -B_STPHY_AURS | -R | -S | -S | -R | -F | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||||||||||
2016-07-27 | -I10 | -Hospital C | +2017-09-14 | +Y3 | +Hospital A | B_STRPT_PNMN | -S | -S | R | R | -M | -Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -||||||||
2013-11-25 | -P4 | -Hospital D | -B_STRPT_PNMN | -S | -S | S | R | F | @@ -845,6 +815,36 @@ Longest: 24pneumoniae | TRUE | |||||||||||||
2013-01-07 | +L2 | +Hospital C | +B_STRPT_PNMN | +R | +R | +S | +R | +M | +Gram-positive | +Streptococcus | +pneumoniae | +TRUE | +|||||||||||
2015-06-10 | +O6 | +Hospital D | +B_ESCHR_COLI | +R | +R | +S | +R | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +
If you want to get a quick glance of the number of isolates in different bug/drug combinations, you can use the bug_drug_combinations()
function:
As per the EUCAST guideline of 2019, we calculate resistance as the proportion of R (proportion_R()
, equal to resistance()
) and susceptibility as the proportion of S and I (proportion_SI()
, equal to susceptibility()
). These functions can be used on their own:
data_1st %>% resistance(AMX)
-# [1] 0.5429029
Or can be used in conjunction with group_by()
and summarise()
, both from the dplyr
package:
data_1st %>%
@@ -987,19 +987,19 @@ Longest: 24
Hospital A
-0.5478773
+0.5483971
Hospital B
-0.5516767
+0.5501101
Hospital C
-0.5306768
+0.5632754
Hospital D
-0.5297098
+0.5369668
@@ -1018,23 +1018,23 @@ Longest: 24
Hospital A
-0.5478773
-3227
+0.5483971
+3213
Hospital B
-0.5516767
-3638
+0.5501101
+3632
Hospital C
-0.5306768
-1581
+0.5632754
+1612
Hospital D
-0.5297098
-2171
+0.5369668
+2110
@@ -1055,27 +1055,27 @@ Longest: 24
Escherichia
-0.7699715
-0.8721821
-0.9748304
+0.7637897
+0.8656716
+0.9781527
Klebsiella
-0.8233788
-0.9155290
-0.9872014
+0.8356282
+0.8975904
+0.9845095
Staphylococcus
-0.7969095
-0.8863135
-0.9790287
+0.7949367
+0.8900542
+0.9804702
Streptococcus
-0.5338276
+0.5389192
0.0000000
-0.5338276
+0.5389192
@@ -1090,33 +1090,33 @@ Longest: 24
summarise(across(penicillins(), resistance, as_percent = TRUE)) %>%
# format the antibiotic column names, using so-called snake case,
# so 'Amoxicillin/clavulanic acid' becomes 'amoxicillin_clavulanic_acid'
- rename_with(.fn = ab_name, .cols = penicillins(), snake_case = TRUE)
hospital | -Amoxicillin | -Amoxicillin/clavulanic acid | +amoxicillin | +amoxicillin_clavulanic_acid |
---|---|---|---|---|
Hospital A | 54.8% | -26.7% | +27.0% | |
Hospital B | -55.2% | -26.9% | +55.0% | +26.1% |
Hospital C | -53.1% | +56.3% | 26.9% | |
Hospital D | -53.0% | -25.4% | +53.7% | +25.3% |
mic_values <- random_mic(size = 100)
mic_values
# Class <mic>
-# [1] 0.005 0.125 32 0.0625 0.5 0.125 16 0.25 0.025
-# [10] <=0.001 <=0.001 0.0625 0.01 1 2 32 0.01 8
-# [19] 0.005 32 0.005 32 128 0.125 0.125 2 <=0.001
-# [28] 4 8 0.005 0.002 0.5 0.002 0.5 64 0.125
-# [37] 0.01 0.002 0.0625 128 0.5 1 0.125 0.0625 0.002
-# [46] 32 0.025 0.005 8 0.002 <=0.001 8 1 16
-# [55] <=0.001 0.25 0.125 0.025 4 8 0.0625 16 4
-# [64] 64 <=0.001 128 0.125 0.5 4 32 <=0.001 128
-# [73] 16 64 16 0.125 4 2 0.002 0.025 8
-# [82] 4 2 0.01 4 0.125 <=0.001 0.002 0.01 0.5
-# [91] 32 128 0.01 1 0.125 4 0.002 0.25 0.25
-# [100] 16
+# [1] 0.5 0.125 0.002 2 0.0625 128 64 0.002 0.002
+# [10] 8 0.025 256 0.0625 0.25 128 256 0.0625 4
+# [19] 0.025 256 64 256 4 <=0.001 128 0.0625 0.025
+# [28] 256 0.25 0.25 0.01 0.002 0.125 16 0.002 2
+# [37] 0.01 2 8 8 0.125 64 4 128 32
+# [46] 0.25 32 1 1 256 128 128 64 4
+# [55] 128 128 128 0.025 1 4 16 0.01 0.005
+# [64] 0.025 2 0.002 0.25 0.0625 0.005 0.005 16 8
+# [73] 32 0.002 0.01 256 256 1 8 32 8
+# [82] 0.125 0.002 0.005 32 16 8 256 32 0.5
+# [91] 4 0.25 1 0.25 2 2 0.125 0.25 16
+# [100] 4
# base R:
plot(mic_values)
# base R:
plot(disk_values, mo = "E. coli", ab = "cipro")
vignettes/datasets.Rmd
datasets.Rmd
NEWS.md
- AMR
1.7.1.9046AMR
1.7.1.9048