diff --git a/404.html b/404.html index 19574612..57f7beaf 100644 --- a/404.html +++ b/404.html @@ -36,7 +36,7 @@ AMR (for R) - 1.8.2.9138 + 1.8.2.9139
So only 62.2% is suitable for resistance analysis! We can now filter +
So only 61.5% is suitable for resistance analysis! We can now filter
on it with the filter()
function, also from the
dplyr
package:
So we end up with 12 431 isolates for analysis. Now our data looks +
So we end up with 12 293 isolates for analysis. Now our data looks like:
head(data_1st)
1 | -2014-12-01 | -V4 | +2011-02-12 | +O4 | Hospital A | -B_ESCHR_COLI | -R | -I | -I | -R | -F | -Gram-negative | -Escherichia | -coli | -TRUE | -||||
2 | -2010-08-12 | -I7 | -Hospital C | -B_STPHY_AURS | -R | -S | -S | -S | -M | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -||||||
3 | -2012-07-28 | -V1 | -Hospital B | B_STRPT_PNMN | -S | -S | -R | +I | +I | +I | R | F | Gram-positive | @@ -728,30 +696,30 @@ like:TRUE | |||||
6 | -2015-05-14 | -N5 | +2 | +2011-03-08 | +W5 | Hospital C | -B_STPHY_AURS | -I | -I | -I | -S | -M | -Gram-positive | -Staphylococcus | -aureus | -TRUE | -|||
7 | -2011-03-07 | -X4 | -Hospital D | B_ESCHR_COLI | I | I | -S | +I | +I | +F | +Gram-negative | +Escherichia | +coli | +TRUE | +|||||
3 | +2015-09-22 | +R6 | +Hospital B | +B_ESCHR_COLI | +R | +R | +R | I | F | Gram-negative | @@ -760,19 +728,51 @@ like:TRUE | ||||||||
8 | -2016-11-12 | -T7 | -Hospital A | -B_KLBSL_PNMN | -R | +6 | +2017-10-13 | +F8 | +Hospital D | +B_ESCHR_COLI | +I | S | I | S | +M | +Gram-negative | +Escherichia | +coli | +TRUE | +
7 | +2013-03-22 | +H3 | +Hospital D | +B_STRPT_PNMN | +R | +R | +I | +R | +M | +Gram-positive | +Streptococcus | +pneumoniae | +TRUE | +||||||
8 | +2014-11-05 | +Y10 | +Hospital D | +B_ESCHR_COLI | +R | +R | +S | +R | F | Gram-negative | -Klebsiella | -pneumoniae | +Escherichia | +coli | TRUE | ||||
1 | Escherichia coli | -5,970 | -48.03% | -5,970 | -48.03% | +5,873 | +47.78% | +5,873 | +47.78% | ||||||||||
2 | Staphylococcus aureus | -3,335 | -26.83% | -9,305 | -74.85% | +3,225 | +26.23% | +9,098 | +74.01% | ||||||||||
3 | Streptococcus pneumoniae | -1,817 | -14.62% | -11,122 | -89.47% | +1,844 | +15.00% | +10,942 | +89.01% | ||||||||||
4 | Klebsiella pneumoniae | -1,309 | -10.53% | -12,431 | +1,351 | +10.99% | +12,293 | 100.00% | |||||||||||
2014-12-01 | -V4 | +2011-02-12 | +O4 | Hospital A | -B_ESCHR_COLI | +B_STRPT_PNMN | +I | +I | +I | +R | +F | +Gram-positive | +Streptococcus | +pneumoniae | +TRUE | +||||
2013-03-22 | +H3 | +Hospital D | +B_STRPT_PNMN | +R | R | I | -I | +R | +M | +Gram-positive | +Streptococcus | +pneumoniae | +TRUE | +||||||
2014-11-05 | +Y10 | +Hospital D | +B_ESCHR_COLI | +R | +R | +S | R | F | Gram-negative | @@ -924,71 +954,41 @@ antibiotic class they are in:TRUE | |||||||||
2012-07-28 | -V1 | +2013-09-13 | +A8 | Hospital B | B_STRPT_PNMN | S | S | R | R | -F | +M | Gram-positive | Streptococcus | pneumoniae | TRUE | ||||
2016-08-30 | -Q3 | +2016-08-04 | +S3 | Hospital D | -B_STRPT_PNMN | -R | -R | +B_STPHY_AURS | R | +I | +I | R | F | Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -||
2013-03-03 | -F7 | -Hospital B | -B_STPHY_AURS | -I | -S | -I | -R | -M | -Gram-positive | Staphylococcus | aureus | TRUE | |||||||
2010-10-30 | -H10 | -Hospital A | -B_STRPT_PNMN | -I | -I | -S | -R | -M | -Gram-positive | -Streptococcus | -pneumoniae | -TRUE | -|||||||
2011-04-07 | -D8 | +2013-05-16 | +K6 | Hospital C | B_ESCHR_COLI | -S | +I | S | R | R | @@ -1020,50 +1020,50 @@ different bug/drug combinations, you can use the|||||||||
E. coli | AMC | -2855 | -1161 | -1954 | -5970 | +2744 | +1216 | +1913 | +5873 | ||||||||||
E. coli | AMX | -1518 | -1282 | -3170 | -5970 | +1504 | +1272 | +3097 | +5873 | ||||||||||
E. coli | CIP | -2087 | -1796 | -2087 | -5970 | +2018 | +1818 | +2037 | +5873 | ||||||||||
E. coli | GEN | -2119 | -1854 | -1997 | -5970 | +2067 | +1812 | +1994 | +5873 | ||||||||||
K. pneumoniae | AMC | -615 | -256 | -438 | -1309 | +599 | +275 | +477 | +1351 | ||||||||||
K. pneumoniae | AMX | 0 | 0 | -1309 | -1309 | +1351 | +1351 |
proportion_SI()
, equa
own:
data_1st %>% resistance(AMX)
-#> [1] 0.5810474
Or can be used in conjunction with group_by()
and
summarise()
, both from the dplyr
package:
@@ -1159,19 +1159,19 @@ own:Hospital A -0.5871733 +0.5836502 Hospital B -0.5822430 +0.5788257 Hospital C -0.5788635 +0.5675105 @@ -1196,23 +1196,23 @@ all isolates available for every group (i.e. values S, I or R): Hospital D -0.5717638 +0.5893679 Hospital A -0.5871733 -3711 +0.5836502 +3682 Hospital B -0.5822430 -4280 +0.5788257 +4326 Hospital C -0.5788635 -1883 +0.5675105 +1896 @@ -1237,27 +1237,27 @@ therapies very easily: Hospital D -0.5717638 -2557 +0.5893679 +2389 Escherichia -0.6726968 -0.6654941 -0.8934673 +0.6742721 +0.6604802 +0.8923889 Klebsiella -0.6653934 -0.6608098 -0.8800611 +0.6469282 +0.6565507 +0.8793486 Staphylococcus -0.6773613 -0.6587706 -0.8917541 +0.6731783 +0.6536434 +0.8862016 @@ -1285,23 +1285,23 @@ classes, use a antibiotic class selector such as Streptococcus -0.4777105 +0.4766811 0.0000000 -0.4777105 +0.4766811 Hospital A -58.7% -36.2% +58.4% +36.1% Hospital B -58.2% -35.9% +57.9% +36.2% Hospital C -57.9% -34.9% +56.8% +34.6% @@ -1417,16 +1417,18 @@ classes) Hospital D -57.2% -34.5% +58.9% +35.8% <mic>
and<disk>
:mic_values <- random_mic(size = 100) mic_values #> Class 'mic' -#> [1] 0.0625 0.125 16 0.025 0.005 128 8 4 0.002 32 -#> [11] 64 0.5 0.025 0.01 8 0.002 0.5 1 0.125 0.001 -#> [21] 0.005 0.025 0.005 0.125 0.001 128 0.01 2 64 128 -#> [31] 8 1 1 128 8 4 16 0.5 0.25 0.25 -#> [41] 16 256 0.002 8 0.025 0.5 128 8 256 64 -#> [51] 0.025 128 0.025 0.001 1 0.002 0.125 0.001 256 0.01 -#> [61] 64 0.0625 0.025 16 0.5 0.125 256 1 1 128 -#> [71] 32 0.01 0.01 0.0625 128 4 16 0.005 256 8 -#> [81] 8 0.005 0.01 0.025 32 64 1 0.005 128 0.25 -#> [91] 16 0.001 0.5 0.001 0.25 0.0625 2 2 0.001 0.125
# base R:
plot(mic_values)
<mic>
and <disk>
:
But we could also be more specific, by generating MICs that are likely to be found in E. coli for ciprofloxacin:
-mic_values <- random_mic(size = 100, mo = "E. coli", ab = "cipro")
-#> [1] "here"
mic_values <- random_mic(size = 100, mo = "E. coli", ab = "cipro")
For the plot()
and autoplot()
function, we
can define the microorganism and an antimicrobial agent the same way.
This will add the interpretation of those values according to a chosen
@@ -1461,10 +1462,10 @@ plotting:
disk_values <- random_disk(size = 100, mo = "E. coli", ab = "cipro")
disk_values
#> Class 'disk'
-#> [1] 27 29 20 31 27 23 30 27 19 24 31 20 19 28 23 25 17 22 20 24 24 28 17 29 26
-#> [26] 29 31 23 23 30 18 29 30 23 21 19 25 24 22 18 28 25 24 18 25 25 27 24 24 27
-#> [51] 27 18 18 25 22 27 30 24 31 26 19 30 21 22 23 19 23 23 22 26 22 29 29 29 29
-#> [76] 26 26 24 30 17 30 17 25 27 17 27 20 23 17 21 17 27 18 23 30 19 22 20 30 17
+#> [1] 23 21 21 24 27 18 21 29 31 18 17 26 21 21 27 25 28 31 30 17 29 21 18 30 25
+#> [26] 28 31 17 25 23 22 17 27 24 30 31 24 24 25 27 18 31 20 21 29 30 17 21 20 19
+#> [51] 25 21 17 17 26 25 30 26 19 18 21 28 27 21 30 29 21 17 30 28 26 27 23 31 27
+#> [76] 31 31 26 24 30 31 22 20 17 17 23 31 27 17 28 27 18 27 29 24 24 28 20 19 26
# base R:
plot(disk_values, mo = "E. coli", ab = "cipro")
head(my_TB_data)
#> rifampicin isoniazid gatifloxacin ethambutol pyrazinamide moxifloxacin
-#> 1 S I I I R R
-#> 2 I S I R I S
-#> 3 I S I R R I
-#> 4 I I R R S I
-#> 5 S S R S R R
+#> 1 R S S S I S
+#> 2 I R S R I S
+#> 3 I R R I S R
+#> 4 R R S R S I
+#> 5 S S S S I S
#> 6 R I I S S I
#> kanamycin
-#> 1 R
-#> 2 S
-#> 3 I
-#> 4 R
+#> 1 I
+#> 2 I
+#> 3 S
+#> 4 S
#> 5 S
#> 6 I
We can now add the interpretation of MDR-TB to our data set. You can @@ -438,40 +438,40 @@ Unique: 5
"S"
,
# get microbial ID based on given organism
mutate(mo = as.mo(Organism)) %>%
# transform everything from "AMP_ND10" to "CIP_EE" to the new `sir` class
- mutate_at(vars(AMP_ND10:CIP_EE), as.sir)
-#> Warning: There was 1 warning in `mutate()`.
-#> ℹ In argument: `AMP_ND10 = (function (x, ...) ...`.
-#> Caused by warning:
-#> ! The 'rsi' class has been replaced with 'sir'. Transform your 'rsi' columns
-#> to 'sir' with as.sir(), e.g.:
-#> your_data %>% mutate_if(is.rsi, as.sir)
+ mutate_at(vars(AMP_ND10:CIP_EE), as.sir)
No errors or warnings, so all values are transformed succesfully.
We also created a package dedicated to data cleaning and checking,
called the cleaner
package. Its freq()
@@ -358,11 +352,14 @@ Longest: 40
Frequency table
-Class: factor > ordered > rsi (numeric)
+
Class: factor > ordered > sir (numeric)
Length: 500
Levels: 3: S < I < R
Available: 481 (96.2%, NA: 19 = 3.8%)
Unique: 3
Drug: Amoxicillin/clavulanic acid (AMC, J01CR02)
+Drug group: Beta-lactams/penicillins
+%SI: 78.59%
diff --git a/articles/datasets.html b/articles/datasets.html index 66ba0947..77fa1eac 100644 --- a/articles/datasets.html +++ b/articles/datasets.html @@ -38,7 +38,7 @@ AMR (for R) - 1.8.2.9138 + 1.8.2.9139 |
---|