mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 16:42:10 +02:00
added Becker 2019
This commit is contained in:
25
man/as.mo.Rd
25
man/as.mo.Rd
@ -21,16 +21,16 @@ mo_uncertainties()
|
||||
|
||||
mo_renamed()
|
||||
|
||||
clean_mo_history()
|
||||
clean_mo_history(...)
|
||||
}
|
||||
\arguments{
|
||||
\item{x}{a character vector or a \code{data.frame} with one or two columns}
|
||||
|
||||
\item{Becker}{a logical to indicate whether \emph{Staphylococci} should be categorised into Coagulase Negative \emph{Staphylococci} ("CoNS") and Coagulase Positive \emph{Staphylococci} ("CoPS") instead of their own species, according to Karsten Becker \emph{et al.} [1]. Note that this does not include species that were newly named after this publication.
|
||||
\item{Becker}{a logical to indicate whether \emph{Staphylococci} should be categorised into coagulase-negative \emph{Staphylococci} ("CoNS") and coagulase-positive \emph{Staphylococci} ("CoPS") instead of their own species, according to Karsten Becker \emph{et al.} [1,2]. Note that this does not include species that were newly named after these publications, like \emph{S. caeli}.
|
||||
|
||||
This excludes \emph{Staphylococcus aureus} at default, use \code{Becker = "all"} to also categorise \emph{S. aureus} as "CoPS".}
|
||||
|
||||
\item{Lancefield}{a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [2]. These \emph{Streptococci} will be categorised in their first group, e.g. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L.
|
||||
\item{Lancefield}{a logical to indicate whether beta-haemolytic \emph{Streptococci} should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [3]. These \emph{Streptococci} will be categorised in their first group, e.g. \emph{Streptococcus dysgalactiae} will be group C, although officially it was also categorised into groups G and L.
|
||||
|
||||
This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D.}
|
||||
|
||||
@ -41,7 +41,7 @@ clean_mo_history()
|
||||
\item{...}{other parameters passed on to functions}
|
||||
}
|
||||
\value{
|
||||
Character (vector) with class \code{"mo"}. Unknown values will return \code{NA}.
|
||||
Character (vector) with class \code{"mo"}
|
||||
}
|
||||
\description{
|
||||
Use this function to determine a valid microorganism ID (\code{mo}). Determination is done using intelligent rules and the complete taxonomic kingdoms Bacteria, Chromista, Protozoa, Archaea and most microbial species from the kingdom Fungi (see Source). The input can be almost anything: a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), an abbreviation known in the field (like \code{"MRSA"}), or just a genus. Please see Examples.
|
||||
@ -60,18 +60,19 @@ A microbial ID from this package (class: \code{mo}) typically looks like these e
|
||||
| | | ----> subspecies, a 3-4 letter acronym
|
||||
| | ----> species, a 3-4 letter acronym
|
||||
| ----> genus, a 5-7 letter acronym, mostly without vowels
|
||||
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria), C (Chromista),
|
||||
F (Fungi), P (Protozoa) or PL (Plantae)
|
||||
----> taxonomic kingdom: A (Archaea), AN (Animalia), B (Bacteria),
|
||||
C (Chromista), F (Fungi), P (Protozoa) or
|
||||
PL (Plantae)
|
||||
}
|
||||
|
||||
Values that cannot be coered will be considered 'unknown' and have an MO code \code{UNKNOWN}.
|
||||
Values that cannot be coered will be considered 'unknown' and will get the MO code \code{UNKNOWN}.
|
||||
|
||||
Use the \code{\link{mo_property}_*} functions to get properties based on the returned code, see Examples.
|
||||
|
||||
The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \code{?microorganisms}).
|
||||
|
||||
\strong{Self-learning algoritm} \cr
|
||||
The \code{as.mo()} function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use \code{clean_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. Usually, any guess after the first try runs 90-95\% faster than the first try. The algorithm saves its previous findings to \code{~/.Rhistory_mo}.
|
||||
The \code{as.mo()} function gains experience from previously determined microbial IDs and learns from it. This drastically improves both speed and reliability. Use \code{clean_mo_history()} to reset the algorithms. Only experience from your current \code{AMR} package version is used. This is done because in the future the taxonomic tree (which is included in this package) may change for any organism and it consequently has to rebuild its knowledge. Usually, any guess after the first try runs 80-95\% faster than the first try. The algorithm saves its previous findings to \code{~/.Rhistory_mo}.
|
||||
|
||||
\strong{Intelligent rules} \cr
|
||||
This function uses intelligent rules to help getting fast and logical results. It tries to find matches in this order:
|
||||
@ -91,7 +92,7 @@ A couple of effects because of these rules:
|
||||
This means that looking up human pathogenic microorganisms takes less time than looking up human non-pathogenic microorganisms.
|
||||
|
||||
\strong{Uncertain results} \cr
|
||||
The algorithm can additionally use three different levels of uncertainty to guess valid results. The default is \code{allow_uncertain = TRUE}, which is uqual to uncertainty level 2. Using \code{allow_uncertain = FALSE} will skip all of these additional rules:
|
||||
The algorithm can additionally use three different levels of uncertainty to guess valid results. The default is \code{allow_uncertain = TRUE}, which is equal to uncertainty level 2. Using \code{allow_uncertain = FALSE} will skip all of these additional rules:
|
||||
\itemize{
|
||||
\item{(uncertainty level 1): It tries to look for only matching genera}
|
||||
\item{(uncertainty level 1): It tries to look for previously accepted (but now invalid) taxonomic names}
|
||||
@ -132,9 +133,11 @@ Group 2 probably contains all other microbial pathogens ever found in humans.
|
||||
|
||||
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870–926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
|
||||
|
||||
[2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 571–95. \url{https://dx.doi.org/10.1084/jem.57.4.571}
|
||||
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).}. 2019. Clin Microbiol Infect. 2019 Mar 11. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
|
||||
|
||||
[3] Catalogue of Life: Annual Checklist (public online taxonomic database), \url{www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
|
||||
[3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 571–95. \url{https://dx.doi.org/10.1084/jem.57.4.571}
|
||||
|
||||
[4] Catalogue of Life: Annual Checklist (public online taxonomic database), \url{www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
|
||||
}
|
||||
|
||||
\section{Catalogue of Life}{
|
||||
|
@ -7,13 +7,13 @@
|
||||
catalogue_of_life_version()
|
||||
}
|
||||
\value{
|
||||
a \code{list}, invisibly
|
||||
a \code{list}, which prints in pretty format
|
||||
}
|
||||
\description{
|
||||
This function returns information about the included data from the Catalogue of Life. It also shows if the included version is their latest annual release. The Catalogue of Life releases their annual release in March each year.
|
||||
}
|
||||
\details{
|
||||
The list item \code{is_latest_annual_release} is based on the system date.
|
||||
The list item \code{...$catalogue_of_life$is_latest_annual_release} is based on the system date.
|
||||
|
||||
For DSMZ, see \code{?microorganisms}.
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ septic_patients \%>\%
|
||||
S = count_S(cipr),
|
||||
n1 = count_all(cipr), # the actual total; sum of all three
|
||||
n2 = n_rsi(cipr), # same - analogous to n_distinct
|
||||
total = n()) # NOT the amount of tested isolates!
|
||||
total = n()) # NOT the number of tested isolates!
|
||||
|
||||
# Count co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
# so we can see that combination therapy does a lot more than mono therapy.
|
||||
|
@ -13,7 +13,7 @@
|
||||
\alias{filter_glycopeptides}
|
||||
\alias{filter_macrolides}
|
||||
\alias{filter_tetracyclines}
|
||||
\title{Filter on antibiotic class}
|
||||
\title{Filter isolates on result in antibiotic class}
|
||||
\usage{
|
||||
filter_ab_class(tbl, ab_class, result = NULL, scope = "any", ...)
|
||||
|
||||
@ -42,7 +42,7 @@ filter_tetracyclines(tbl, result = NULL, scope = "any", ...)
|
||||
\arguments{
|
||||
\item{tbl}{a data set}
|
||||
|
||||
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}}
|
||||
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. More specifically, this should be a text that can be found in a 4th level ATC group (chemical subgroup) or a 5th level ATC group (chemical substance), please see \href{https://www.whocc.no/atc/structure_and_principles/}{this explanation on the WHOCC website}.}
|
||||
|
||||
\item{result}{an antibiotic result: S, I or R (or a combination of more of them)}
|
||||
|
||||
@ -51,7 +51,7 @@ filter_tetracyclines(tbl, result = NULL, scope = "any", ...)
|
||||
\item{...}{parameters passed on to \code{\link[dplyr]{filter_at}}}
|
||||
}
|
||||
\description{
|
||||
Filter on specific antibiotic variables based on their class (ATC groups).
|
||||
Filter isolates on results in specific antibiotic variables based on their class (ATC groups). This makes it easy to get a list of isolates that were tested for e.g. any aminoglycoside.
|
||||
}
|
||||
\details{
|
||||
The \code{\link{antibiotics}} data set will be searched for \code{ab_class} in the columns \code{atc_group1} and \code{atc_group2} (case-insensitive). Next, \code{tbl} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set.
|
||||
@ -77,8 +77,14 @@ septic_patients \%>\% filter_aminoglycosides("R", "all")
|
||||
# filter on isolates that show resistance to
|
||||
# any aminoglycoside and any fluoroquinolone
|
||||
septic_patients \%>\%
|
||||
filter_aminoglycosides("R", "any") \%>\%
|
||||
filter_fluoroquinolones("R", "any")
|
||||
filter_aminoglycosides("R") \%>\%
|
||||
filter_fluoroquinolones("R")
|
||||
|
||||
# filter on isolates that show resistance to
|
||||
# all aminoglycosides and all fluoroquinolones
|
||||
septic_patients \%>\%
|
||||
filter_aminoglycosides("R", "all") \%>\%
|
||||
filter_fluoroquinolones("R", "all")
|
||||
}
|
||||
\keyword{fillter_class}
|
||||
\keyword{filter}
|
||||
|
@ -111,9 +111,11 @@ This package contains the complete taxonomic tree of almost all microorganisms (
|
||||
|
||||
[1] Becker K \emph{et al.} \strong{Coagulase-Negative Staphylococci}. 2014. Clin Microbiol Rev. 27(4): 870–926. \url{https://dx.doi.org/10.1128/CMR.00109-13}
|
||||
|
||||
[2] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 571–95. \url{https://dx.doi.org/10.1084/jem.57.4.571}
|
||||
[2] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the S. aureus complex, S. argenteus and S. schweitzeri: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).}. 2019. Clin Microbiol Infect. 2019 Mar 11. \url{https://doi.org/10.1016/j.cmi.2019.02.028}
|
||||
|
||||
[3] Catalogue of Life: Annual Checklist (public online taxonomic database), \url{www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
|
||||
[3] Lancefield RC \strong{A serological differentiation of human and other groups of hemolytic streptococci}. 1933. J Exp Med. 57(4): 571–95. \url{https://dx.doi.org/10.1084/jem.57.4.571}
|
||||
|
||||
[4] Catalogue of Life: Annual Checklist (public online taxonomic database), \url{www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}).
|
||||
}
|
||||
|
||||
\section{Read more on our website!}{
|
||||
|
@ -36,7 +36,7 @@ portion_df(data, translate_ab = getOption("get_antibiotic_names",
|
||||
\arguments{
|
||||
\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.}
|
||||
|
||||
\item{minimum}{the minimal amount of available isolates. Any number lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
||||
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
||||
|
||||
\item{as_percent}{a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.}
|
||||
|
||||
@ -52,7 +52,7 @@ portion_df(data, translate_ab = getOption("get_antibiotic_names",
|
||||
Double or, when \code{as_percent = TRUE}, a character.
|
||||
}
|
||||
\description{
|
||||
These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}.
|
||||
These functions can be used to calculate the (co-)resistance of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{dplyr}s \code{\link[dplyr]{summarise}} and support grouped variables, see \emph{Examples}.
|
||||
|
||||
\code{portion_R} and \code{portion_IR} can be used to calculate resistance, \code{portion_S} and \code{portion_SI} can be used to calculate susceptibility.\cr
|
||||
}
|
||||
@ -67,14 +67,14 @@ The old \code{\link{rsi}} function is still available for backwards compatibilit
|
||||
\if{html}{
|
||||
\cr\cr
|
||||
To calculate the probability (\emph{p}) of susceptibility of one antibiotic, we use this formula:
|
||||
\out{<div style="text-align: center">}\figure{mono_therapy.png}\out{</div>}
|
||||
\out{<div style="text-align: center;">}\figure{combi_therapy_2.png}\out{</div>}
|
||||
To calculate the probability (\emph{p}) of susceptibility of more antibiotics (i.e. combination therapy), we need to check whether one of them has a susceptible result (as numerator) and count all cases where all antibiotics were tested (as denominator). \cr
|
||||
\cr
|
||||
For two antibiotics:
|
||||
\out{<div style="text-align: center">}\figure{combi_therapy_2.png}\out{</div>}
|
||||
\out{<div style="text-align: center;">}\figure{combi_therapy_2.png}\out{</div>}
|
||||
\cr
|
||||
For three antibiotics:
|
||||
\out{<div style="text-align: center">}\figure{combi_therapy_3.png}\out{</div>}
|
||||
\out{<div style="text-align: center;">}\figure{combi_therapy_2.png}\out{</div>}
|
||||
\cr
|
||||
And so on.
|
||||
}
|
||||
@ -113,8 +113,9 @@ septic_patients \%>\%
|
||||
summarise(R = portion_R(cipr, as_percent = TRUE),
|
||||
I = portion_I(cipr, as_percent = TRUE),
|
||||
S = portion_S(cipr, as_percent = TRUE),
|
||||
n = n_rsi(cipr), # works like n_distinct in dplyr
|
||||
total = n()) # NOT the amount of tested isolates!
|
||||
n1 = count_all(cipr), # the actual total; sum of all three
|
||||
n2 = n_rsi(cipr), # same - analogous to n_distinct
|
||||
total = n()) # NOT the number of tested isolates!
|
||||
|
||||
# Calculate co-resistance between amoxicillin/clav acid and gentamicin,
|
||||
# so we can see that combination therapy does a lot more than mono therapy:
|
||||
|
@ -12,7 +12,7 @@ rsi(ab1, ab2 = NULL, interpretation = "IR", minimum = 30,
|
||||
|
||||
\item{interpretation}{antimicrobial interpretation to check for}
|
||||
|
||||
\item{minimum}{the minimal amount of available isolates. Any number lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
||||
\item{minimum}{the minimum allowed number of available (tested) isolates. Any isolate count lower than \code{minimum} will return \code{NA} with a warning. The default number of \code{30} isolates is advised by the Clinical and Laboratory Standards Institute (CLSI) as best practice, see Source.}
|
||||
|
||||
\item{as_percent}{a logical to indicate whether the output must be returned as a hundred fold with \% sign (a character). A value of \code{0.123456} will then be returned as \code{"12.3\%"}.}
|
||||
|
||||
|
Reference in New Issue
Block a user