1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 12:31:58 +02:00

(v0.9.0.9026) update documentation

This commit is contained in:
2020-02-17 14:38:01 +01:00
parent 11f00f8a0a
commit 5e2b294351
118 changed files with 997 additions and 2252 deletions

View File

@ -145,7 +145,7 @@ Using the `left_join()` function from the `dplyr` package, we can 'map' the gend
data <- data %>% left_join(patients_table)
```
The resulting data set contains `r format(nrow(data), big.mark = ",")` blood culture isolates. With the `head()` function we can preview the first 6 values of this data set:
The resulting data set contains `r format(nrow(data), big.mark = ",")` blood culture isolates. With the `head()` function we can preview the first 6 rows of this data set:
```{r preview data set 1, eval = FALSE}
head(data)
@ -163,14 +163,10 @@ We also created a package dedicated to data cleaning and checking, called the `c
For example, for the `gender` variable:
```{r freq gender 1, eval = FALSE}
```{r freq gender 1, results="asis"}
data %>% freq(gender) # this would be the same: freq(data$gender)
```
```{r freq gender 2, echo = FALSE, results = 'markup'}
data %>% freq(gender, markdown = FALSE, header = TRUE)
```
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:

View File

@ -30,13 +30,13 @@ What are EUCAST rules? The European Committee on Antimicrobial Susceptibility Te
> *EUCAST expert rules are a tabulated collection of expert knowledge on intrinsic resistances, exceptional resistance phenotypes and interpretive rules that may be applied to antimicrobial susceptibility testing in order to reduce errors and make appropriate recommendations for reporting particular resistances.*
In Europe, a lot of medical microbiological laboratories already apply these rules ([Brown *et al.*, 2015](https://www.eurosurveillance.org/content/10.2807/1560-7917.ES2015.20.2.21008)). Our package features their latest insights on intrinsic resistance and exceptional phenotypes (version 9.0, 2019). Moreover, the `eucast_rules()` function we use for this purpose can also apply additional rules, like forcing <help title="ATC: J01CA01">ampicillin</help> = R in isolates when <help title="ATC: J01CR02">amoxicillin/clavulanic acid</help> = R.
In Europe, a lot of medical microbiological laboratories already apply these rules ([Brown *et al.*, 2015](https://www.eurosurveillance.org/content/10.2807/1560-7917.ES2015.20.2.21008)). Our package features their latest insights on intrinsic resistance and exceptional phenotypes (version `r AMR:::EUCAST_VERSION_BREAKPOINTS`). Moreover, the `eucast_rules()` function we use for this purpose can also apply additional rules, like forcing <help title="ATC: J01CA01">ampicillin</help> = R in isolates when <help title="ATC: J01CR02">amoxicillin/clavulanic acid</help> = R.
## Examples
These rules can be used to discard impossible bug-drug combinations in your data. For example, *Klebsiella* produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, every strain of *Klebsiella* is resistant to ampicillin.
These rules can be used to discard impossible bug-drug combinations in your data. For example, *Klebsiella* produces beta-lactamase that prevents ampicillin (or amoxicillin) from working against it. In other words, practically every strain of *Klebsiella* is resistant to ampicillin.
Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, *Klebsiella*). EUCAST expert rules solves this:
Sometimes, laboratory data can still contain such strains with ampicillin being susceptible to ampicillin. This could be because an antibiogram is available before an identification is available, and the antibiogram is then not re-interpreted based on the identification (namely, *Klebsiella*). EUCAST expert rules solve this, that can be used with `eucast_rules()`:
```{r, warning = FALSE, message = FALSE}
oops <- data.frame(mo = c("Klebsiella",
@ -46,3 +46,33 @@ oops
eucast_rules(oops, info = FALSE)
```
EUCAST rules can not only be used for correction, they can also be used for filling in known resistance and susceptibility based on results of other antimicrobials drugs. This process is called *interpretive reading* and is part of the `eucast_rules()` function as well:
```{r, warning = FALSE, message = FALSE}
data <- data.frame(mo = c("Staphylococcus aureus",
"Enterococcus faecalis",
"Escherichia coli",
"Klebsiella pneumoniae",
"Pseudomonas aeruginosa"),
VAN = "-", # Vancomycin
AMX = "-", # Amoxicillin
COL = "-", # Colistin
CAZ = "-", # Ceftazidime
CXM = "-", # Cefuroxime
PEN = "S", # Penicillin G
FOX = "S", # Cefoxitin
stringsAsFactors = FALSE)
```
```{r, eval = FALSE}
data
```
```{r, echo = FALSE}
knitr::kable(data, align = "lccccccc")
```
```{r, eval = FALSE}
eucast_rules(data, info = FALSE)
```
```{r, echo = FALSE, message = FALSE}
knitr::kable(eucast_rules(data, info = FALSE), align = "lccccccc")
```