mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 07:11:57 +02:00
163 new trade names, added ab_tradenames
This commit is contained in:
@ -21,37 +21,42 @@ This R package was intended to make microbial epidemiology easier. Most function
|
||||
|
||||
This `AMR` package basically does four important things:
|
||||
|
||||
1. It **cleanses existing data**, by transforming it to reproducible and profound *classes*, making the most efficient use of R. These function all use artificial intelligence to get expected results:
|
||||
1. It **cleanses existing data**, by transforming it to reproducible and profound *classes*, making the most efficient use of R. These functions all use artificial intelligence to guess results that you would expect:
|
||||
|
||||
* Use `as.bactid` to get an ID of a microorganism. It takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" and "esccol". Moreover, it can group all coagulase negative and positive *Staphylococci*, and can transform *Streptococci* into Lancefield groups. This package has a database of ~2500 different (potential) human pathogenic microorganisms.
|
||||
* Use `as.bactid` to get an ID of a microorganism. The IDs are quite obvious - the ID of *E. coli* is "ESCCOL" and the ID of *S. aureus* is "STAAUR". This `as.bactid` function takes almost any text as input that looks like the name or code of a microorganism like "E. coli", "esco" and "esccol". Even `as.bactid("MRSA")` will return the ID of *S. aureus*. Moreover, it can group all coagulase negative and positive *Staphylococci*, and can transform *Streptococci* into Lancefield groups. To find bacteria based on your input, this package contains a freely available database of ~2,650 different (potential) human pathogenic microorganisms.
|
||||
* Use `as.rsi` to transform values to valid antimicrobial results. It produces just S, I or R based on your input and warns about invalid values. Even values like "<=0.002; S" (combined MIC/RSI) will result in "S".
|
||||
* Use `as.mic` to cleanse your MIC values. It produces a so-called factor (in SPSS calls this *ordinal*) with valid MIC values as levels. A value like "<=0.002; S" (combined MIC/RSI) will result in "<=0.002".
|
||||
* Use `as.atc` to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values "Furabid", "Furadantine", "nitro" will return the ATC code of Nitrofurantoine.
|
||||
* Use `as.mic` to cleanse your MIC values. It produces a so-called factor (called *ordinal* in SPSS) with valid MIC values as levels. A value like "<=0.002; S" (combined MIC/RSI) will result in "<=0.002".
|
||||
* Use `as.atc` to get the ATC code of an antibiotic as defined by the WHO. This package contains a database with most LIS codes, official names, DDDs and even trade names of antibiotics. For example, the values "Furabid", "Furadantine", "nitro" all return the ATC code of Nitrofurantoine.
|
||||
|
||||
2. It **enhances existing data** and **adds new data** from data sets included in this package.
|
||||
|
||||
* Use `EUCAST_rules` to apply [EUCAST expert rules to isolates](http://www.eucast.org/expert_rules_and_intrinsic_resistance/).
|
||||
* Use `MDRO` (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines with or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.
|
||||
* Data set `microorganisms` contains the family, genus, species, subspecies, colloqual name and Gram stain of almost 2500 microorganisms. This enables e.g. resistance analysis of different antibiotics per Gram stain.
|
||||
* Data set `antibiotics` contains the ATC code, LIS codes, official name, trivial name, trade name and DDD of both oral and parenteral administration.
|
||||
* Use `first_isolate` to identify the first isolates of every patient [using guidelines from the CLSI](https://clsi.org/standards/products/microbiology/documents/m39/) (Clinical and Laboratory Standards Institute). * You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
|
||||
|
||||
* Use `first_isolate` to identify the first isolates of every patient [using guidelines from the CLSI](https://clsi.org/standards/products/microbiology/documents/m39/) (Clinical and Laboratory Standards Institute).
|
||||
* You can also identify first *weighted* isolates of every patient, an adjusted version of the CLSI guideline. This takes into account key antibiotics of every strain and compares them.
|
||||
* Use `MDRO` (abbreviation of Multi Drug Resistant Organisms) to check your isolates for exceptional resistance with country-specific guidelines or EUCAST rules. Currently, national guidelines for Germany and the Netherlands are supported.
|
||||
* The data set `microorganisms` contains the family, genus, species, subspecies, colloquial name and Gram stain of almost 2,650 microorganisms (2,207 bacteria, 285 fungi/yeasts, 153 parasites, 1 other). This enables resistance analysis of e.g. different antibiotics per Gram stain. The package also contains functions to look up values in this data set like `mo_genus`, `mo_family` or `mo_gramstain`. Since it uses `as.bactid` internally, AI is supported. For example, `mo_genus("MRSA")` and `mo_genus("S. aureus")` will both return `"Staphylococcus"`. These functions can be used to add new variables to your data.
|
||||
* The data set `antibiotics` contains the ATC code, LIS codes, official name, trivial name and DDD of both oral and parenteral administration. It also contains a total of 298 trade names. Use functions like `ab_official` and `ab_tradenames` to look up values. As the `mo_*` functions use `as.bactid` internally, the `ab_*` functions use `as.atc` internally so it uses AI to guess your expected result. For example, `ab_official("Fluclox")`, `ab_official("Floxapen")` and `ab_official("J01CF05")` will all return `"Flucloxacillin"`. These functions can again be used to add new variables to your data.
|
||||
|
||||
3. It **analyses the data** with convenient functions that use well-known methods.
|
||||
|
||||
* Calculate the resistance (and even co-resistance) of microbial isolates with the `portion_R`, `portion_IR`, `portion_I`, `portion_SI` and `portion_S` functions, that can also be used with the `dplyr` package (e.g. in conjunction with `summarise`)
|
||||
* Calculate the resistance (and even co-resistance) of microbial isolates with the `portion_R`, `portion_IR`, `portion_I`, `portion_SI` and `portion_S` functions. Similarly, the *amount* of isolates can be determined with the `count_R`, `count_IR`, `count_I`, `count_SI` and `count_S` functions. All these functions can be used [with the `dplyr` package](https://dplyr.tidyverse.org/#usage) (e.g. in conjunction with [`summarise`](https://dplyr.tidyverse.org/reference/summarise.html))
|
||||
* Plot AMR results with `geom_rsi`, a function made for the `ggplot2` package
|
||||
* Predict antimicrobial resistance for the nextcoming years using logistic regression models with the `resistance_predict` function
|
||||
* Conduct descriptive statistics to enhance base R: calculate kurtosis, skewness and create frequency tables
|
||||
|
||||
4. It **teaches the user** how to use all the above actions, by showing many examples in the help pages. The package contains an example data set called `septic_patients`. This data set, consisting of 2000 blood culture isolates from anonymised septic patients between 2001 and 2017 in the Northern Netherlands, is real and genuine data.
|
||||
4. It **teaches the user** how to use all the above actions.
|
||||
|
||||
* The package contains extensive help pages with many examples.
|
||||
* It also contains an example data set called `septic_patients`. This data set contains:
|
||||
* 2,000 blood culture isolates from anonymised septic patients between 2001 and 2017 in the Northern Netherlands
|
||||
* Results of 40 antibiotics (each antibiotic in its own column) with a total of 38,414 antimicrobial results
|
||||
* Real and genuine data
|
||||
|
||||
|
||||
----
|
||||
```{r, echo = FALSE}
|
||||
# this will print "2018" in 2018, and "2018-yyyy" after 2018.
|
||||
yrs <- c(2018:format(Sys.Date(), "%Y"))
|
||||
yrs <- c(min(yrs), max(yrs))
|
||||
yrs <- paste(unique(yrs), collapse = "-")
|
||||
yrs <- paste(unique(c(2018, format(Sys.Date(), "%Y"))), collapse = "-")
|
||||
```
|
||||
AMR, (c) `r yrs`, `r packageDescription("AMR")$URL`
|
||||
|
||||
|
@ -1,89 +0,0 @@
|
||||
## ----setup, include = FALSE, results = 'markup'--------------------------
|
||||
knitr::opts_chunk$set(
|
||||
collapse = TRUE,
|
||||
comment = "#"
|
||||
)
|
||||
library(dplyr)
|
||||
library(AMR)
|
||||
|
||||
## ---- echo = TRUE, results = 'hide'--------------------------------------
|
||||
# just using base R
|
||||
freq(septic_patients$sex)
|
||||
|
||||
# using base R to select the variable and pass it on with a pipe from the dplyr package
|
||||
septic_patients$sex %>% freq()
|
||||
|
||||
# do it all with pipes, using the `select` function from the dplyr package
|
||||
septic_patients %>%
|
||||
select(sex) %>%
|
||||
freq()
|
||||
|
||||
# or the preferred way: using a pipe to pass the variable on to the freq function
|
||||
septic_patients %>% freq(sex) # this also shows 'age' in the title
|
||||
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
freq(septic_patients$sex)
|
||||
|
||||
## ---- echo = TRUE, results = 'hide'--------------------------------------
|
||||
my_patients <- septic_patients %>% left_join_microorganisms()
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
colnames(microorganisms)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
dim(septic_patients)
|
||||
dim(my_patients)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
my_patients %>% freq(genus, species)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
# # get age distribution of unique patients
|
||||
septic_patients %>%
|
||||
distinct(patient_id, .keep_all = TRUE) %>%
|
||||
freq(age, nmax = 5)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
freq(hospital_id)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
freq(hospital_id, sort.count = TRUE)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
select(amox) %>%
|
||||
freq()
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
select(date) %>%
|
||||
freq(nmax = 5)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
my_df <- septic_patients %>% freq(age)
|
||||
class(my_df)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
dim(my_df)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
freq(amox, na.rm = FALSE)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
freq(hospital_id, row.names = FALSE)
|
||||
|
||||
## ---- echo = TRUE--------------------------------------------------------
|
||||
septic_patients %>%
|
||||
freq(hospital_id, markdown = TRUE)
|
||||
|
||||
## ---- echo = FALSE-------------------------------------------------------
|
||||
# this will print "2018" in 2018, and "2018-yyyy" after 2018.
|
||||
yrs <- c(2018:format(Sys.Date(), "%Y"))
|
||||
yrs <- c(min(yrs), max(yrs))
|
||||
yrs <- paste(unique(yrs), collapse = "-")
|
||||
|
@ -181,9 +181,7 @@ septic_patients %>%
|
||||
----
|
||||
```{r, echo = FALSE}
|
||||
# this will print "2018" in 2018, and "2018-yyyy" after 2018.
|
||||
yrs <- c(2018:format(Sys.Date(), "%Y"))
|
||||
yrs <- c(min(yrs), max(yrs))
|
||||
yrs <- paste(unique(yrs), collapse = "-")
|
||||
yrs <- paste(unique(c(2018, format(Sys.Date(), "%Y"))), collapse = "-")
|
||||
```
|
||||
AMR, (c) `r yrs`, `r packageDescription("AMR")$URL`
|
||||
|
||||
|
Reference in New Issue
Block a user