example_isolates
data set to better reflect realitymo_info()
+clean
to cleaner
, as this package was renamed accordingly upon CRAN requestalso_single_tested
w
New
Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
Function rsi_df()
to transform a data.frame
to a data set containing only the microbial interpretation (S, I, R), the antibiotic, the percentage of S/I/R and the number of available isolates. This is a convenient combination of the existing functions count_df()
and portion_df()
to immediately show resistance percentages and number of available isolates:
septic_patients %>%
select(AMX, CIP) %>%
rsi_df()
@@ -533,7 +536,7 @@ Since this is a major change, usage of the old also_single_tested
w
Changed
-- Column names of output
count_df()
and portion_df()
are now lowercase
+- Column names of output
count_df()
and portion_df()
are now lowercase
- Fixed bug in translation of microorganism names
- Fixed bug in determining taxonomic kingdoms
- Algorithm improvements for
as.ab()
and as.mo()
to understand even more severely misspelled input
@@ -611,7 +614,7 @@ Please guess_ab_col()
microorganisms.old
data set, which leads to better results finding when using the as.mo()
functionportion_df()
and count_df()
this means that their new parameter combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.portion_df()
and count_df()
this means that their new parameter combine_SI
is TRUE at default. Our plotting function ggplot_rsi()
also reflects this change since it uses count_df()
internally.age()
function gained a new parameter exact
to determine ages with decimalsguess_mo()
, guess_atc()
, EUCAST_rules()
, interpretive_reading()
, rsi()
as.mo(..., allow_uncertain = 3)
Contents
AMR
is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with microbial and antimicrobial properties by using evidence-based methods. It supports any table format, including WHONET/EARS-Net data.
We created this package for both academic research and routine analysis at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). This R package is actively maintained and free software; you can freely use and distribute it for both personal and commercial (but not patent) purposes under the terms of the GNU General Public License version 2.0 (GPL-2), as published by the Free Software Foundation.
This package can be used for:
Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life
Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life
Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines
Determining first isolates to be used for AMR analysis
Calculating antimicrobial resistance
For suggestions, comments or questions, please contact us at:
Matthijs S. Berends
-m.s.berends [at] umcg [dot] nl
+m.s.berends at umcg dot nl
Department of Medical Microbiology, University of Groningen
University Medical Center Groningen
Post Office Box 30001
-9700 RB Groningen
+9700 RB Groningen
The Netherlands
If you have found a bug, please file a new issue at:
https://gitlab.com/msberends/AMR/issues
These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
-NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
+NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our example_isolates
data set.
This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our example_isolates data set.
WHONET
@@ -242,35 +242,34 @@
A data.frame
with 500 observations and 53 variables:
Identification number
ID of the sample
Specimen number
ID of the specimen
Organism
Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using as.mo
.
Country
Country of origin
Laboratory
Name of laboratory
Last name
Last name of patient
First name
Initial of patient
Sex
Gender of patient
Age
Age of patient
Age category
Age group, can also be looked up using age_groups
Date of admission
Date of hospital admission
Specimen date
Date when specimen was received at laboratory
Specimen type
Specimen type or group
Specimen type (Numeric)
Translation of "Specimen type"
Reason
Reason of request with Differential Diagnosis
Isolate number
ID of isolate
Organism type
Type of microorganism, can also be looked up using mo_type
Serotype
Serotype of microorganism
Beta-lactamase
Microorganism produces beta-lactamase?
ESBL
Microorganism produces extended spectrum beta-lactamase?
Carbapenemase
Microorganism produces carbapenemase?
MRSA screening test
Microorganism is possible MRSA?
Inducible clindamycin resistance
Clindamycin can be induced?
Comment
Other comments
Date of data entry
Date this data was entered in WHONET
AMP_ND10:CIP_EE
27 different antibiotics. You can lookup the abbreviatons in the antibiotics
data set, or use e.g. ab_name("AMP")
to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using as.rsi
.
A data.frame
with 500 observations and 53 variables:
Identification number
ID of the sample
Specimen number
ID of the specimen
Organism
Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using as.mo()
.
Country
Country of origin
Laboratory
Name of laboratory
Last name
Last name of patient
First name
Initial of patient
Sex
Gender of patient
Age
Age of patient
Age category
Age group, can also be looked up using age_groups()
Date of admission
Date of hospital admission
Specimen date
Date when specimen was received at laboratory
Specimen type
Specimen type or group
Specimen type (Numeric)
Translation of "Specimen type"
Reason
Reason of request with Differential Diagnosis
Isolate number
ID of isolate
Organism type
Type of microorganism, can also be looked up using mo_type()
Serotype
Serotype of microorganism
Beta-lactamase
Microorganism produces beta-lactamase?
ESBL
Microorganism produces extended spectrum beta-lactamase?
Carbapenemase
Microorganism produces carbapenemase?
MRSA screening test
Microorganism is possible MRSA?
Inducible clindamycin resistance
Clindamycin can be induced?
Comment
Other comments
Date of data entry
Date this data was entered in WHONET
AMP_ND10:CIP_EE
27 different antibiotics. You can lookup the abbreviatons in the antibiotics data set, or use e.g. ab_name("AMP")
to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using as.rsi()
.
Use these functions to return a specific property of an antibiotic from the antibiotics
data set. All input values will be evaluated internally with as.ab
.
Use these functions to return a specific property of an antibiotic from the antibiotics data set. All input values will be evaluated internally with as.ab()
.
ab_name(x, language = get_locale(), tolower = FALSE, ...) @@ -264,11 +264,11 @@x -+ any (vector of) text that can be coerced to a valid microorganism code with
as.ab
any (vector of) text that can be coerced to a valid microorganism code with
as.ab()
language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.tolower @@ -276,7 +276,7 @@... -+ other parameters passed on to
as.ab
other parameters passed on to
as.ab()
administration @@ -288,7 +288,7 @@@@ -296,10 +296,10 @@ property -+ one of the column names of one of the
antibiotics
data setone of the column names of one of the antibiotics data set
An integer
in case of ab_cid
A named list
in case of ab_info
and multiple ab_synonyms
/ab_tradenames
A double
in case of ab_ddd
A character
in all other cases
An integer
in case of ab_cid()
A named list
in case of ab_info()
and multiple ab_synonyms()
/ab_tradenames()
A double
in case of ab_ddd()
A character
in all other cases
On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
# all properties: diff --git a/docs/reference/age.html b/docs/reference/age.html index 9ea062995..caa74f6da 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -85,7 +85,7 @@ @@ -244,15 +244,15 @@x -+ date(s), will be coerced with
as.POSIXlt
date(s), will be coerced with
as.POSIXlt()
reference -+ reference date(s) (defaults to today), will be coerced with
as.POSIXlt
and cannot be lower thanx
reference date(s) (defaults to today), will be coerced with
as.POSIXlt()
and cannot be lower thanx
exact -+ a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of year-to-date (YTD) of
x
by the number of days in a year ofreference
(either 365 or 366).a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of year-to-date (YTD) of
x
by the number of days in the year ofreference
(either 365 or 366).na.rm @@ -270,7 +270,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+To split ages into groups, use the
age_groups
function.To split ages into groups, use the
age_groups()
function.Examples
# 10 random birth dates diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index 77b2a19fd..54a07cab4 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -85,7 +85,7 @@ @@ -244,7 +244,7 @@x -+ age, e.g. calculated with
age
age, e.g. calculated with
age()
split_at @@ -263,7 +263,7 @@To split ages, the input can be:
- +The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).
A numeric vector. A vector of e.g.
c(10, 20)
will split on 0-9, 10-19 and 20+. A value of only50
will split on 0-49 and 50+. - The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).A character:
"children"
or"kids"
, equivalent of:c(0, 1, 2, 4, 6, 13, 18)
. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.- @@ -279,7 +279,7 @@
"elderly"
or"seniors"
, equivalent of:c(65, 75, 85)
. This will split on 0-64, 65-74, 75-84, 85+.On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+To determine ages, based on one or more reference dates, use the
age
function.To determine ages, based on one or more reference dates, use the
age()
function.Examples
ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21) diff --git a/docs/reference/antibiotics.html b/docs/reference/antibiotics.html index d2ffc7e3a..085317567 100644 --- a/docs/reference/antibiotics.html +++ b/docs/reference/antibiotics.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-Two data sets containing all antibiotics/antimycotics and antivirals. Use
+as.ab
or one of theab_property
functions to retrieve values from theantibiotics
data set. Three identifiers are included in this data set: an antibiotic ID (ab
, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc
) as defined by the WHO, and a Compound ID (cid
) as found in PubChem. Other properties in this data set are derived from one or more of these codes.Two data sets containing all antibiotics/antimycotics and antivirals. Use
as.ab()
or one of theab_property()
functions to retrieve values from the antibiotics data set. Three identifiers are included in this data set: an antibiotic ID (ab
, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (atc
) as defined by the WHO, and a Compound ID (cid
) as found in PubChem. Other properties in this data set are derived from one or more of these codes.antibiotics @@ -244,35 +244,39 @@Format
-For the
antibiotics
data set: adata.frame
with 452 observations and 13 variables:-
+ab
- -
Antibiotic ID as used in this package (like
AMC
), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where availableatc
- -
ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like
J01CR02
cid
- -
Compound ID as found in PubChem
name
- -
Official name as used by WHONET/EARS-Net or the WHO
group
- -
A short and concise group name, based on WHONET and WHOCC definitions
atc_group1
- -
Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like
"Macrolides, lincosamides and streptogramins"
atc_group2
- -
Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like
"Macrolides"
abbr
- -
List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)
synonyms
- -
Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
oral_ddd
- -
Defined Daily Dose (DDD), oral treatment
oral_units
- -
Units of
oral_ddd
iv_ddd
- -
Defined Daily Dose (DDD), parenteral treatment
iv_units
- +
Units of
iv_ddd
For the antibiotics data set: a
-data.frame
with 452 observations and 13 variables:+
-- +
ab
Antibiotic ID as used in this package (likeAMC
), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available- +
atc
ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, likeJ01CR02
- +
cid
Compound ID as found in PubChem- +
name
Official name as used by WHONET/EARS-Net or the WHO- +
group
A short and concise group name, based on WHONET and WHOCC definitions- +
atc_group1
Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like"Macrolides, lincosamides and streptogramins"
- +
atc_group2
Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like"Macrolides"
- +
abbr
List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)- +
synonyms
Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID- +
oral_ddd
Defined Daily Dose (DDD), oral treatment- +
oral_units
Units oforal_ddd
- +
iv_ddd
Defined Daily Dose (DDD), parenteral treatment- +
iv_units
Units ofiv_ddd
For the
antivirals
data set: adata.frame
with 102 observations and 9 variables:-
+atc
- -
ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC
cid
- -
Compound ID as found in PubChem
name
- -
Official name as used by WHONET/EARS-Net or the WHO
atc_group
- -
Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC
synonyms
- -
Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID
oral_ddd
- -
Defined Daily Dose (DDD), oral treatment
oral_units
- -
Units of
oral_ddd
iv_ddd
- -
Defined Daily Dose (DDD), parenteral treatment
iv_units
- -
Units of
iv_ddd
For the antivirals data set: a
+ +data.frame
with 102 observations and 9 variables:+
+- +
atc
ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC- +
cid
Compound ID as found in PubChem- +
name
Official name as used by WHONET/EARS-Net or the WHO- +
atc_group
Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC- +
synonyms
Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID- +
oral_ddd
Defined Daily Dose (DDD), oral treatment- +
oral_units
Units oforal_ddd
- +
iv_ddd
Defined Daily Dose (DDD), parenteral treatment- +
iv_units
Units ofiv_ddd
Source
World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): https://www.whocc.no/atc_ddd_index/
@@ -290,7 +294,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
-NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
+NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
Read more on our website!
@@ -298,7 +302,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral druOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-Use this function to determine the antibiotic code of one or more antibiotics. The data set
+antibiotics
will be searched for abbreviations, official names and synonyms (brand names).Use this function to determine the antibiotic code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and synonyms (brand names).
as.ab(x, ...) @@ -256,11 +256,11 @@Value
-Character (vector) with class
+"ab"
. Unknown values will returnNA
.Character (vector) with class
ab
. Unknown values will returnNA
.Details
-All entries in the
-antibiotics
data set have three different identifiers: a human readable EARS-Net code (columnab
, used by ECDC and WHONET), an ATC code (columnatc
, used by WHO), and a CID code (columncid
, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.Use the
+ab_property
functions to get properties based on the returned antibiotic ID, see Examples.All entries in the antibiotics data set have three different identifiers: a human readable EARS-Net code (column
+ab
, used by ECDC and WHONET), an ATC code (columnatc
, used by WHO), and a CID code (columncid
, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem.Use the
ab_property()
functions to get properties based on the returned antibiotic ID, see Examples.Source
@@ -276,7 +276,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral drugs and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, https://www.whocc.no) and the Pharmaceuticals Community Register of the European Commission (http://ec.europa.eu/health/documents/community-register/html/atc.htm).These have become the gold standard for international drug utilisation monitoring and research.
The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest.
-NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
+NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See https://www.whocc.no/copyright_disclaimer/.
Read more on our website!
@@ -284,7 +284,7 @@ This package contains all ~550 antibiotic, antimycotic and antiviral druOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+
antibiotics
for the dataframe that is being used to determine ATCs.antibiotics for the dataframe that is being used to determine ATCs.
Examples
# These examples all return "ERY", the ID of Erythromycin: diff --git a/docs/reference/as.disk.html b/docs/reference/as.disk.html index 61fa87ea5..125956fda 100644 --- a/docs/reference/as.disk.html +++ b/docs/reference/as.disk.html @@ -85,7 +85,7 @@ @@ -259,7 +259,7 @@Ordered integer factor with new class
disk
Details
-Interpret disk values as RSI values with
+as.rsi
. It supports guidelines from EUCAST and CLSI.Interpret disk values as RSI values with
as.rsi()
. It supports guidelines from EUCAST and CLSI.Read more on our website!
@@ -267,7 +267,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
# interpret disk values diff --git a/docs/reference/as.mic.html b/docs/reference/as.mic.html index 88811896f..fc94688b7 100644 --- a/docs/reference/as.mic.html +++ b/docs/reference/as.mic.html @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-This transforms a vector to a new class
+mic
, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated asNA
with a warning.This transforms a vector to a new class
mic
, which is an orderedfactor
with valid MIC values as levels. Invalid MIC values will be translated asNA
with a warning.as.mic(x, na.rm = FALSE) @@ -256,10 +256,10 @@Value
-Ordered factor with new class
+mic
Ordered
factor
with new classmic
Details
-Interpret MIC values as RSI values with
+as.rsi
. It supports guidelines from EUCAST and CLSI.To interpret MIC values as RSI values, use
as.rsi()
on MIC values. It supports guidelines from EUCAST and CLSI.Read more on our website!
@@ -267,7 +267,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
mic_data <- as.mic(c(">=32", "1.0", "1", "1.00", 8, "<=0.128", "8", "16", "16")) diff --git a/docs/reference/as.mo.html b/docs/reference/as.mo.html index bb52836f1..90e8042a0 100644 --- a/docs/reference/as.mo.html +++ b/docs/reference/as.mo.html @@ -85,7 +85,7 @@ @@ -234,11 +234,17 @@--Use this function to determine a valid microorganism ID (
+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"Staphylococcus aureus"
), an abbreviated name (like"S. aureus"
), an abbreviation known in the field (like"MRSA"
), or just a genus. Please see Examples.Use this function to determine a valid microorganism ID (
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"Staphylococcus aureus"
), an abbreviated name (like"S. aureus"
), an abbreviation known in the field (like"MRSA"
), or just a genus. Please see Examples.as.mo(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, - reference_df = get_mo_source(), ...) +as.mo( + x, + Becker = FALSE, + Lancefield = FALSE, + allow_uncertain = TRUE, + reference_df = get_mo_source(), + ... +) is.mo(x) @@ -255,25 +261,25 @@x -+ a character vector or a
data.frame
with one or two columnsa character vector or a
data.frame
with one or two columnsBecker -a logical to indicate whether Staphylococci should be categorised into coagulase-negative Staphylococci ("CoNS") and coagulase-positive Staphylococci ("CoPS") instead of their own species, according to Karsten Becker et al. [1,2]. Note that this does not include species that were newly named after these publications, like S. caeli.
+a logical to indicate whether Staphylococci should be categorised into coagulase-negative Staphylococci ("CoNS") and coagulase-positive Staphylococci ("CoPS") instead of their own species, according to Karsten Becker et al. (1,2). Note that this does not include species that were newly named after these publications, like S. caeli.
This excludes Staphylococcus aureus at default, use
Becker = "all"
to also categorise S. aureus as "CoPS".Lancefield -a logical to indicate whether beta-haemolytic Streptococci should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield [3]. These Streptococci will be categorised in their first group, e.g. Streptococcus dysgalactiae will be group C, although officially it was also categorised into groups G and L.
+a logical to indicate whether beta-haemolytic Streptococci should be categorised into Lancefield groups instead of their own species, according to Rebecca C. Lancefield (3). These Streptococci will be categorised in their first group, e.g. Streptococcus dysgalactiae will be group C, although officially it was also categorised into groups G and L.
This excludes Enterococci at default (who are in group D), use
Lancefield = "all"
to also categorise all Enterococci as group D.allow_uncertain -+ a number between 0 (or "none") and 3 (or "all"), or TRUE (= 2) or FALSE (= 0) to indicate whether the input should be checked for less probable results, see Details
a number between
0
(or"none"
) and3
(or"all"
), orTRUE
(=2
) orFALSE
(=0
) to indicate whether the input should be checked for less probable results, please see Detailsreference_df -+ a
data.frame
to use for extra reference when translatingx
to a validmo
. Seeset_mo_source
andget_mo_source
to automate the usage of your own codes (e.g. used in your analysis or organisation).a
data.frame
to use for extra reference when translatingx
to a validmo
. Seeset_mo_source()
andget_mo_source()
to automate the usage of your own codes (e.g. used in your analysis or organisation).... @@ -283,12 +289,14 @@Value
-Character (vector) with class
+"mo"
A
character
vector with classmo
Details
-General info
-A microorganism ID from this package (class:mo
) typically looks like these examples:- Code Full name + +General info
+ + +A microorganism ID from this package (class:
mo
) typically looks like these examples:Code Full name --------------- -------------------------------------- B_KLBSL Klebsiella B_KLBSL_PNMN Klebsiella pneumoniae @@ -303,26 +311,27 @@ A microorganism ID from this package (class:mo
) typically looks liValues that cannot be coered will be considered 'unknown' and will get the MO code
-UNKNOWN
.Use the
-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
-microorganisms
).The
as.mo()
function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:+
+Use the
+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 microorganisms).
+The
as.mo()
function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order:
Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;
Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;
- -
Breakdown of input values to identify possible matches.
This will lead to the effect that e.g.
-"E. coli"
(a highly prevalent microorganism found in humans) will return the microbial ID of Escherichia coli and not Entamoeba coli (a less prevalent microorganism in humans), although the latter would alphabetically come first.Coping with uncertain results
-
-In addition, theas.mo()
function can differentiate four levels of uncertainty to guess valid results:+ +
Coping with uncertain results
+ + +In addition, the
as.mo()
function can differentiate four levels of uncertainty to guess valid results:-
Uncertainty level 0: no additional rules are applied;
Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;
Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;
Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.
This leads to e.g.:
-+
This leads to e.g.:
-
"Streptococcus group B (known as S. agalactiae)"
. The text between brackets will be removed and a warning will be thrown that the result Streptococcus group B (B_STRPT_GRPB
) needs review.
"S. aureus - please mind: MRSA"
. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result Staphylococcus aureus (B_STPHY_AURS
) needs review.- @@ -330,35 +339,45 @@ In addition, the
"Fluoroquinolone-resistant Neisseria gonorrhoeae"
. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result Neisseria gonorrhoeae (B_NESSR_GNRR
) needs review.as.mo()
function can differentiate four levels ofThe level of uncertainty can be set using the argument
allow_uncertain
. The default isallow_uncertain = TRUE
, which is equal to uncertainty level 2. Usingallow_uncertain = FALSE
is equal to uncertainty level 0 and will skip all rules. You can also use e.g.as.mo(..., allow_uncertain = 1)
to only allow up to level 1 uncertainty.There are three helper functions that can be run after then
as.mo()
function:-
+- -
Use
mo_uncertainties()
to get adata.frame
with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as(n - 0.5 * L) / n
, where n is the number of characters of the returned full name of the microorganism, and L is the Levenshtein distance between that full name and the user input.- -
Use
mo_failures()
to get a vector with all values that could not be coerced to a valid value.- -
Use
mo_renamed()
to get adata.frame
with all values that could be coerced based on an old, previously accepted taxonomic name.- +
Use
mo_uncertainties()
to get adata.frame
with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \((n - 0.5 * L) / n\), where n is the number of characters of the returned full name of the microorganism, and L is the Levenshtein distance between that full name and the user input.- +
Use
mo_failures()
to get avector
with all values that could not be coerced to a valid value.- +
Use
mo_renamed()
to get adata.frame
with all values that could be coerced based on an old, previously accepted taxonomic name.Microbial prevalence of pathogens in humans
+ +
-The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as theprevalence
columns in themicroorganisms
andmicroorganisms.old
data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.Microbial prevalence of pathogens in humans
+ + +The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the
prevalence
columns in the microorganisms and microorganisms.old data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence.Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is Enterococcus, Staphylococcus or Streptococcus. This group consequently contains all common Gram-negative bacteria, such as Pseudomonas and Legionella and all species within the order Enterobacteriales.
Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is Aspergillus, Bacteroides, Candida, Capnocytophaga, Chryseobacterium, Cryptococcus, Elisabethkingia, Flavobacterium, Fusobacterium, Giardia, Leptotrichia, Mycoplasma, Prevotella, Rhodotorula, Treponema, Trichophyton or Ureaplasma.
Group 3 (least prevalent microorganisms) consists of all other microorganisms.
-Self-learning algorithm
+ +
-Theas.mo()
function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Useclear_mo_history()
to reset the algorithms. Only experience from your currentAMR
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.Self-learning algorithm
+ + +The
as.mo()
function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Useclear_mo_history()
to reset the algorithms. Only experience from your currentAMR
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.
This resets with every update of this
+AMR
package since results are saved to your local package library folder.Source
-[1] Becker K et al. Coagulase-Negative Staphylococci. 2014. Clin Microbiol Rev. 27(4): 870–926. https://dx.doi.org/10.1128/CMR.00109-13
-[2] Becker K et al. 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. https://doi.org/10.1016/j.cmi.2019.02.028
-[3] Lancefield RC A serological differentiation of human and other groups of hemolytic streptococci. 1933. J Exp Med. 57(4): 571–95. https://dx.doi.org/10.1084/jem.57.4.571
-[4] Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
+catalogue_of_life_version()
).+
+- +
Becker K et al. Coagulase-Negative Staphylococci. 2014. Clin Microbiol Rev. 27(4): 870–926. https://dx.doi.org/10.1128/CMR.00109-13
- +
Becker K et al. 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. https://doi.org/10.1016/j.cmi.2019.02.028
- +
Lancefield RC A serological differentiation of human and other groups of hemolytic streptococci. 1933. J Exp Med. 57(4): 571–95. https://dx.doi.org/10.1084/jem.57.4.571
- +
Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
catalogue_of_life_version()
).Catalogue of Life
-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Read more on our website!
@@ -366,8 +385,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+
microorganisms
for thedata.frame
that is being used to determine ID's.
-Themo_property
functions (likemo_genus
,mo_gramstain
) to get properties based on the returned code.microorganisms for the
+data.frame
that is being used to determine ID's.The
mo_property()
functions (likemo_genus()
,mo_gramstain()
) to get properties based on the returned code.Examples
# \donttest{ diff --git a/docs/reference/as.rsi.html b/docs/reference/as.rsi.html index 52caf178d..01ebdf8b5 100644 --- a/docs/reference/as.rsi.html +++ b/docs/reference/as.rsi.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class
+rsi
, which is an ordered factor with levelsS < I < R
. Invalid antimicrobial interpretations will be translated asNA
with a warning.Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class
rsi
, which is an ordered factor with levelsS < I < R
. Invalid antimicrobial interpretations will be translated asNA
with a warning.as.rsi(x, ...) @@ -246,8 +246,7 @@ as.rsi(x, mo, ab, guideline = "EUCAST", ...) # S3 method for data.frame -as.rsi(x, col_mo = NULL, guideline = "EUCAST", - ...) +as.rsi(x, col_mo = NULL, guideline = "EUCAST", ...) is.rsi(x) @@ -258,7 +257,7 @@x -+ vector of values (for class
mic
: an MIC value in mg/L, for classdisk
: a disk diffusion radius in millimeters)vector of values (for class
mic
: an MIC value in mg/L, for classdisk
: a disk diffusion radius in millimeters)... @@ -266,11 +265,11 @@mo -+ a microorganism code, generated with
as.mo
a microorganism code, generated with
as.mo()
ab -+ an antimicrobial code, generated with
as.ab
an antimicrobial code, generated with
as.ab()
guideline @@ -278,11 +277,11 @@col_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.@@ -292,21 +291,20 @@ threshold -+ maximum fraction of invalid antimicrobial interpretations of
x
, see Examplesmaximum fraction of invalid antimicrobial interpretations of
x
, please see ExamplesDetails
Run
-unique(AMR::rsi_translation$guideline)
for a list of all supported guidelines.After using
-as.rsi
, you can useeucast_rules
to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.The function
+is.rsi.eligible
returnsTRUE
when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), andFALSE
otherwise. The threshold of 5% can be set with thethreshold
parameter.After using
+as.rsi()
, you can useeucast_rules()
to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism.The function
is.rsi.eligible()
returnsTRUE
when a columns contains at most 5% invalid antimicrobial interpretations (not S and/or I and/or R), andFALSE
otherwise. The threshold of 5% can be set with thethreshold
parameter.Interpretation of S, I and R
-In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
-+
In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
S - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
I - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
R - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
@@ -314,7 +312,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
rsi_data <- as.rsi(c(rep("S", 474), rep("I", 36), rep("R", 370))) diff --git a/docs/reference/atc_online.html b/docs/reference/atc_online.html index 730425d6d..c6c633525 100644 --- a/docs/reference/atc_online.html +++ b/docs/reference/atc_online.html @@ -51,7 +51,8 @@ - + @@ -85,7 +86,7 @@ @@ -234,11 +235,16 @@--Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
+
This function requires an internet connection.Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit.
+This function requires an internet connection.
atc_online_property(atc_code, property, administration = "O", - url = "https://www.whocc.no/atc_ddd_index/?code=%s&showdescription=no") +atc_online_property( + atc_code, + property, + administration = "O", + url = "https://www.whocc.no/atc_ddd_index/?code=%s&showdescription=no" +) atc_online_groups(atc_code, ...) @@ -290,7 +296,7 @@Abbreviations of return values when using
property = "U"
(unit):
"g"
= gram- -
"mg"
= milligram- +
"mcg"
= microgram`"mcg"`` = microgram
"U"
= unit
"TU"
= thousand units- diff --git a/docs/reference/availability.html b/docs/reference/availability.html index 6d1646ccb..fc0c2082b 100644 --- a/docs/reference/availability.html +++ b/docs/reference/availability.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@
"MU"
= million units-Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g.
+resistance
.Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g.
resistance()
.availability(tbl, width = NULL)@@ -244,7 +244,7 @@tbl -+ a
data.frame
orlist
a
data.frame
orlist
width @@ -254,10 +254,10 @@Value
-+
data.frame
with column names oftbl
as row names
data.frame
with column names oftbl
as row namesDetails
-The function returns a
+data.frame
with columns"resistant"
and"visual_resistance"
. The values in that columns are calculated withresistance
.The function returns a
data.frame
with columns"resistant"
and"visual_resistance"
. The values in that columns are calculated withresistance()
.Read more on our website!
diff --git a/docs/reference/bug_drug_combinations.html b/docs/reference/bug_drug_combinations.html index 274b406a4..cb62482f4 100644 --- a/docs/reference/bug_drug_combinations.html +++ b/docs/reference/bug_drug_combinations.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,18 +234,25 @@-Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use
+format
on the result to prettify it to a publicable/printable format, see Examples.Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use
format()
on the result to prettify it to a publicable/printable format, see Examples.bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) # S3 method for bug_drug_combinations -format(x, - translate_ab = "name (ab, atc)", language = get_locale(), - minimum = 30, combine_SI = TRUE, combine_IR = FALSE, - add_ab_group = TRUE, remove_intrinsic_resistant = FALSE, - decimal.mark = getOption("OutDec"), big.mark = ifelse(decimal.mark == - ",", ".", ","), ...)+format( + x, + translate_ab = "name (ab, atc)", + language = get_locale(), + minimum = 30, + combine_SI = TRUE, + combine_IR = FALSE, + add_ab_group = TRUE, + remove_intrinsic_resistant = FALSE, + decimal.mark = getOption("OutDec"), + big.mark = ifelse(decimal.mark == ",", ".", ","), + ... +)Arguments
@@ -256,11 +263,11 @@
col_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.FUN -+ the function to call on the
mo
column to transform the microorganism IDs, defaults tomo_shortname
the function to call on the
mo
column to transform the microorganism IDs, defaults tomo_shortname()
... @@ -268,11 +275,11 @@translate_ab -+ a character of length 1 containing column names of the
antibiotics
data seta character of length 1 containing column names of the antibiotics data set
language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.minimum @@ -312,10 +319,10 @@M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition, 2014, Clinical and Laboratory Standards Institute (CLSI). https://clsi.org/standards/products/microbiology/documents/m39/.
Value
-The function
+bug_drug_combinations
returns adata.frame
with columns "mo", "ab", "S", "I", "R" and "total".The function
bug_drug_combinations()
returns adata.frame
with columns "mo", "ab", "S", "I", "R" and "total".Details
-The function
+format
calculates the resistance per bug-drug combination. Usecombine_IR = FALSE
(default) to test R vs. S+I andcombine_IR = TRUE
to test R+I vs. S.The function
format()
calculates the resistance per bug-drug combination. Usecombine_IR = FALSE
(default) to test R vs. S+I andcombine_IR = TRUE
to test R+I vs. S.The language of the output can be overwritten with
options(AMR_locale)
, please see translate.Read more on our website!
diff --git a/docs/reference/catalogue_of_life.html b/docs/reference/catalogue_of_life.html index 08e5ff570..2d1a97ca8 100644 --- a/docs/reference/catalogue_of_life.html +++ b/docs/reference/catalogue_of_life.html @@ -85,7 +85,7 @@ @@ -245,7 +245,7 @@-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Included taxa
@@ -268,8 +268,8 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+Data set
microorganisms
for the actual data.
-Functionas.mo()
to use the data for intelligent determination of microorganisms.Data set microorganisms for the actual data.
+Functionas.mo()
to use the data for intelligent determination of microorganisms.Examples
# Get version info of included data set @@ -295,7 +295,7 @@ Functiondiff --git a/docs/reference/p_symbol.html b/docs/reference/p_symbol.html index 36779c4d4..fbbd17ad8 100644 --- a/docs/reference/p_symbol.html +++ b/docs/reference/p_symbol.html @@ -6,7 +6,7 @@ -as.mo()
to use the data for intel mo_ref("E. coli") # [1] "Castellani et al., 1919" -# Do not get mistaken - the package only includes microorganisms +# Do not get mistaken - this package is about microorganisms mo_kingdom("C. elegans") # [1] "Bacteria" # Bacteria?! mo_name("C. elegans") diff --git a/docs/reference/catalogue_of_life_version.html b/docs/reference/catalogue_of_life_version.html index 77ceae90d..82c8f543d 100644 --- a/docs/reference/catalogue_of_life_version.html +++ b/docs/reference/catalogue_of_life_version.html @@ -85,7 +85,7 @@ @@ -242,10 +242,10 @@Value
-a
+list
, which prints in pretty formata
list
, which prints in pretty formatDetails
-For DSMZ, see
+?microorganisms
.For DSMZ, see microorganisms.
Catalogue of Life
@@ -260,7 +260,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
library(dplyr) diff --git a/docs/reference/count.html b/docs/reference/count.html index e342195ef..22307f5ac 100644 --- a/docs/reference/count.html +++ b/docs/reference/count.html @@ -6,7 +6,7 @@ -Count isolates — count • AMR (for R) +Count available isolates — count • AMR (for R) @@ -50,8 +50,8 @@ - - + @@ -86,7 +86,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible( @@ -229,14 +229,14 @@ count_resistant() should be used to count resistant isolates, count_susceptible(@@ -235,7 +235,7 @@ This is the fastest way to have your organisation (or analysis) specific codes pdiff --git a/docs/reference/mo_source.html b/docs/reference/mo_source.html index 161ded70b..7e9f0944c 100644 --- a/docs/reference/mo_source.html +++ b/docs/reference/mo_source.html @@ -51,7 +51,7 @@ - @@ -86,7 +86,7 @@ This is the fastest way to have your organisation (or analysis) specific codes p-Count isolates
+Count available isolates
count.Rd
-These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in
-dplyr
ssummarise
and support grouped variables, see Examples.+
count_resistant()
should be used to count resistant isolates,count_susceptible()
should be used to count susceptible isolates.These functions can be used to count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in
+summarise()
and support grouped variables, see Examples.
count_resistant()
should be used to count resistant isolates,count_susceptible()
should be used to count susceptible isolates.count_resistant(..., only_all_tested = FALSE) @@ -257,31 +257,36 @@ count_resistant() should be used to count resistant isolates, count_susceptible( n_rsi(..., only_all_tested = FALSE) -count_df(data, translate_ab = "name", language = get_locale(), - combine_SI = TRUE, combine_IR = FALSE)+count_df( + data, + translate_ab = "name", + language = get_locale(), + combine_SI = TRUE, + combine_IR = FALSE +)Arguments
@@ -310,15 +310,15 @@
... -+ one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with
as.rsi
if needed.one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with
as.rsi()
if needed.only_all_tested -+ (for combination therapies, i.e. using more than one variable for
...
) a logical to indicate that isolates must be tested for all antibiotics, see section Combination therapy below(for combination therapies, i.e. using more than one variable for
...
): a logical to indicate that isolates must be tested for all antibiotics, see section Combination therapy belowdata -+ a
data.frame
containing columns with classrsi
(seeas.rsi
)a
data.frame
containing columns with classrsi
(seeas.rsi()
)translate_ab -+ a column name of the
antibiotics
data set to translate the antibiotic abbreviations to, usingab_property
a column name of the antibiotics data set to translate the antibiotic abbreviations to, using
ab_property()
language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.combine_SI @@ -295,33 +300,30 @@ count_resistant() should be used to count resistant isolates, count_susceptible(Value
-Integer
+An
integer
Details
-These functions are meant to count isolates. Use the
+resistance
/susceptibility
functions to calculate microbial resistance/susceptibility.These functions are meant to count isolates. Use the
resistance()
/susceptibility()
functions to calculate microbial resistance/susceptibility.The function
-count_resistant()
is equal to the functioncount_R()
. The functioncount_susceptible()
is equal to the functioncount_SI()
.The function
-n_rsi()
is an alias ofcount_all()
. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal ton_distinct()
. Their function is equal tocount_susceptible(...) + count_resistant(...)
.The function
+count_df()
takes any variable fromdata
that has an"rsi"
class (created withas.rsi()
) and counts the number of S's, I's and R's. The functionrsi_df()
works exactly likecount_df()
, but adds the percentage of S, I and R.The function
+n_rsi()
is an alias ofcount_all()
. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal ton_distinct()
. Their function is equal tocount_susceptible(...) + count_resistant(...)
.The function
count_df()
takes any variable fromdata
that has anrsi
class (created withas.rsi()
) and counts the number of S's, I's and R's. The functionrsi_df()
works exactly likecount_df()
, but adds the percentage of S, I and R.Interpretation of S, I and R
-In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
-+
In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
S - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
I - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
R - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Combination therapy
-When using more than one variable for
-...
(= combination therapy)), useonly_all_tested
to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about howsusceptibility
works to calculate the %SI:--------------------------------------------------------------------- +When using more than one variable for
...
(= combination therapy)), useonly_all_tested
to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about howsusceptibility()
works to calculate the %SI:-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE ----------------------- ----------------------- Drug A Drug B include as include as include as include as @@ -339,11 +341,11 @@ count_resistant() should be used to count resistant isolates, count_susceptible( ---------------------------------------------------------------------Please note that, in combination therapies, for
only_all_tested = TRUE
applies that:- count_S() + count_I() + count_R() = count_all() +Please note that, in combination therapies, for
only_all_tested = TRUE
applies that:count_S() + count_I() + count_R() = count_all() proportion_S() + proportion_I() + proportion_R() = 1 -and that, in combination therapies, for
only_all_tested = FALSE
applies that:- count_S() + count_I() + count_R() >= count_all() ++ +and that, in combination therapies, for
only_all_tested = FALSE
applies that:count_S() + count_I() + count_R() >= count_all() proportion_S() + proportion_I() + proportion_R() >= 1@@ -355,7 +357,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+
proportion_*
to calculate microbial resistance and susceptibility.
proportion_*
to calculate microbial resistance and susceptibility.Examples
# example_isolates is a data set available in the AMR package. diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index 48fafcd24..f4a2dbfff 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -86,7 +86,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied @@ -239,8 +239,14 @@ To improve the interpretation of the antibiogram before EUCAST rules are appliedTo improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details.
-eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints", - "expert", "other", "all"), verbose = FALSE, ...)+eucast_rules( + x, + col_mo = NULL, + info = TRUE, + rules = c("breakpoints", "expert", "other", "all"), + verbose = FALSE, + ... +)Arguments
@@ -251,7 +257,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
@@ -276,20 +282,20 @@ To improve the interpretation of the antibiogram before EUCAST rules are appliedcol_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.info @@ -267,7 +273,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied... -+ column name of an antibiotic, see section Antibiotics
column name of an antibiotic, please see section Antibiotics below
- +Leclercq et al. EUCAST expert rules in antimicrobial susceptibility testing. Clin Microbiol Infect. 2013;19(2):141-60.
EUCAST Expert Rules. Version 2.0, 2012.
- Leclercq et al. EUCAST expert rules in antimicrobial susceptibility testing. Clin Microbiol Infect. 2013;19(2):141-60.
- https://doi.org/10.1111/j.1469-0691.2011.03703.x
+https://doi.org/10.1111/j.1469-0691.2011.03703.x- +http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf
EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016.
- http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf- +http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx
EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019.
- http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsxValue
-The input of
+x
, possibly with edited values of antibiotics. Or, ifverbose = TRUE
, adata.frame
with all original and new values of the affected bug-drug combinations.The input of
x
, possibly with edited values of antibiotics. Or, ifverbose = TRUE
, adata.frame
with all original and new values of the affected bug-drug combinations.Details
-Note: This function does not translate MIC values to RSI values. Use
as.rsi
for that.
+Note: This function does not translate MIC values to RSI values. Use
as.rsi()
for that.
Note: When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance.Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are:
- @@ -299,94 +305,96 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;
Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;
Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;
- -
Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;
- -
Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.
To not use these rules, please use
+eucast_rules(..., rules = c("breakpoints", "expert"))
.- + +
Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S. +To not use these rules, please use
eucast_rules(..., rules = c("breakpoints", "expert"))
.The file containing all EUCAST rules is located here: https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv.
Antibiotics
-To define antibiotics column names, leave as it is to determine it automatically with
-guess_ab_col
or input a text (case-insensitive), or useNULL
to skip a column (e.g.TIC = NULL
to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.The following antibiotics are used for the functions
+eucast_rules
andmdro
. These are shown below in the format 'antimicrobial ID: name (ATC code)', sorted by name:To define antibiotics column names, leave as it is to determine it automatically with
+guess_ab_col()
or input a text (case-insensitive), or useNULL
to skip a column (e.g.TIC = NULL
to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.The following antibiotics are used for the functions
eucast_rules()
andmdro()
. These are shown below in the format 'antimicrobial ID: name (ATC code)', sorted by name:AMK: amikacin (J01GB06), - AMX: amoxicillin (J01CA04), - AMC: amoxicillin/clavulanic acid (J01CR02), - AMP: ampicillin (J01CA01), - SAM: ampicillin/sulbactam (J01CR01), - AZM: azithromycin (J01FA10), - AZL: azlocillin (J01CA09), - ATM: aztreonam (J01DF01), - CAP: capreomycin (J04AB30), - RID: cefaloridine (J01DB02), - CZO: cefazolin (J01DB04), - FEP: cefepime (J01DE01), - CTX: cefotaxime (J01DD01), - CTT: cefotetan (J01DC05), - FOX: cefoxitin (J01DC01), - CPT: ceftaroline (J01DI02), - CAZ: ceftazidime (J01DD02), - CRO: ceftriaxone (J01DD04), - CXM: cefuroxime (J01DC02), - CED: cephradine (J01DB09), - CHL: chloramphenicol (J01BA01), - CIP: ciprofloxacin (J01MA02), - CLR: clarithromycin (J01FA09), - CLI: clindamycin (J01FF01), - COL: colistin (J01XB01), - DAP: daptomycin (J01XX09), - DOR: doripenem (J01DH04), - DOX: doxycycline (J01AA02), - ETP: ertapenem (J01DH03), - ERY: erythromycin (J01FA01), - ETH: ethambutol (J04AK02), - FLC: flucloxacillin (J01CF05), - FOS: fosfomycin (J01XX01), - FUS: fusidic acid (J01XC01), - GAT: gatifloxacin (J01MA16), - GEN: gentamicin (J01GB03), - GEH: gentamicin-high (no ATC code), - IPM: imipenem (J01DH51), - INH: isoniazid (J04AC01), - KAN: kanamycin (J01GB04), - LVX: levofloxacin (J01MA12), - LIN: lincomycin (J01FF02), - LNZ: linezolid (J01XX08), - MEM: meropenem (J01DH02), - MTR: metronidazole (J01XD01), - MEZ: mezlocillin (J01CA10), - MNO: minocycline (J01AA08), - MFX: moxifloxacin (J01MA14), - NAL: nalidixic acid (J01MB02), - NEO: neomycin (J01GB05), - NET: netilmicin (J01GB07), - NIT: nitrofurantoin (J01XE01), - NOR: norfloxacin (J01MA06), - NOV: novobiocin (QJ01XX95), - OFX: ofloxacin (J01MA01), - OXA: oxacillin (J01CF04), - PEN: penicillin G (J01CE01), - PIP: piperacillin (J01CA12), - TZP: piperacillin/tazobactam (J01CR05), - PLB: polymyxin B (J01XB02), - PRI: pristinamycin (J01FG01), - PZA: pyrazinamide (J04AK01), - QDA: quinupristin/dalfopristin (J01FG02), - RIB: rifabutin (J04AB04), - RIF: rifampicin (J04AB02), - RFP: rifapentine (J04AB05), - RXT: roxithromycin (J01FA06), - SIS: sisomicin (J01GB08), - STH: streptomycin-high (no ATC code), - TEC: teicoplanin (J01XA02), - TLV: telavancin (J01XA03), - TCY: tetracycline (J01AA07), - TIC: ticarcillin (J01CA13), - TCC: ticarcillin/clavulanic acid (J01CR03), - TGC: tigecycline (J01AA12), - TOB: tobramycin (J01GB01), - TMP: trimethoprim (J01EA01), - SXT: trimethoprim/sulfamethoxazole (J01EE01), - VAN: vancomycin (J01XA01).
+AMX: amoxicillin (J01CA04), +AMC: amoxicillin/clavulanic acid (J01CR02), +AMP: ampicillin (J01CA01), +SAM: ampicillin/sulbactam (J01CR01), +AZM: azithromycin (J01FA10), +AZL: azlocillin (J01CA09), +ATM: aztreonam (J01DF01), +CAP: capreomycin (J04AB30), +RID: cefaloridine (J01DB02), +CZO: cefazolin (J01DB04), +FEP: cefepime (J01DE01), +CTX: cefotaxime (J01DD01), +CTT: cefotetan (J01DC05), +FOX: cefoxitin (J01DC01), +CPT: ceftaroline (J01DI02), +CAZ: ceftazidime (J01DD02), +CRO: ceftriaxone (J01DD04), +CXM: cefuroxime (J01DC02), +CED: cephradine (J01DB09), +CHL: chloramphenicol (J01BA01), +CIP: ciprofloxacin (J01MA02), +CLR: clarithromycin (J01FA09), +CLI: clindamycin (J01FF01), +COL: colistin (J01XB01), +DAP: daptomycin (J01XX09), +DOR: doripenem (J01DH04), +DOX: doxycycline (J01AA02), +ETP: ertapenem (J01DH03), +ERY: erythromycin (J01FA01), +ETH: ethambutol (J04AK02), +FLC: flucloxacillin (J01CF05), +FOS: fosfomycin (J01XX01), +FUS: fusidic acid (J01XC01), +GAT: gatifloxacin (J01MA16), +GEN: gentamicin (J01GB03), +GEH: gentamicin-high (no ATC code), +IPM: imipenem (J01DH51), +INH: isoniazid (J04AC01), +KAN: kanamycin (J01GB04), +LVX: levofloxacin (J01MA12), +LIN: lincomycin (J01FF02), +LNZ: linezolid (J01XX08), +MEM: meropenem (J01DH02), +MTR: metronidazole (J01XD01), +MEZ: mezlocillin (J01CA10), +MNO: minocycline (J01AA08), +MFX: moxifloxacin (J01MA14), +NAL: nalidixic acid (J01MB02), +NEO: neomycin (J01GB05), +NET: netilmicin (J01GB07), +NIT: nitrofurantoin (J01XE01), +NOR: norfloxacin (J01MA06), +NOV: novobiocin (QJ01XX95), +OFX: ofloxacin (J01MA01), +OXA: oxacillin (J01CF04), +PEN: penicillin G (J01CE01), +PIP: piperacillin (J01CA12), +TZP: piperacillin/tazobactam (J01CR05), +PLB: polymyxin B (J01XB02), +PRI: pristinamycin (J01FG01), +PZA: pyrazinamide (J04AK01), +QDA: quinupristin/dalfopristin (J01FG02), +RIB: rifabutin (J04AB04), +RIF: rifampicin (J04AB02), +RFP: rifapentine (J04AB05), +RXT: roxithromycin (J01FA06), +SIS: sisomicin (J01GB08), +STH: streptomycin-high (no ATC code), +TEC: teicoplanin (J01XA02), +TLV: telavancin (J01XA03), +TCY: tetracycline (J01AA07), +TIC: ticarcillin (J01CA13), +TCC: ticarcillin/clavulanic acid (J01CR03), +TGC: tigecycline (J01AA12), +TOB: tobramycin (J01GB01), +TMP: trimethoprim (J01EA01), +SXT: trimethoprim/sulfamethoxazole (J01EE01), +VAN: vancomycin (J01XA01).Read more on our website!
diff --git a/docs/reference/example_isolates.html b/docs/reference/example_isolates.html index 03917626e..5db020555 100644 --- a/docs/reference/example_isolates.html +++ b/docs/reference/example_isolates.html @@ -85,7 +85,7 @@ @@ -242,19 +242,18 @@Format
-A
data.frame
with 2,000 observations and 49 variables:-
+date
- -
date of receipt at the laboratory
hospital_id
- -
ID of the hospital, from A to D
ward_icu
- -
logical to determine if ward is an intensive care unit
ward_clinical
- -
logical to determine if ward is a regular clinical ward
ward_outpatient
- -
logical to determine if ward is an outpatient clinic
age
- -
age of the patient
gender
- -
gender of the patient
patient_id
- -
ID of the patient
mo
- -
ID of microorganism created with
as.mo
, see alsomicroorganisms
PEN:RIF
- - -
40 different antibiotics with class
rsi
(seeas.rsi
); these column names occur inantibiotics
data set and can be translated withab_name
A
data.frame
with 2,000 observations and 49 variables:+
- +
date
date of receipt at the laboratory- +
hospital_id
ID of the hospital, from A to D- +
ward_icu
logical to determine if ward is an intensive care unit- +
ward_clinical
logical to determine if ward is a regular clinical ward- +
ward_outpatient
logical to determine if ward is an outpatient clinic- +
age
age of the patient- +
gender
gender of the patient- +
patient_id
ID of the patient- +
mo
ID of microorganism created withas.mo()
, see also microorganisms- +
PEN:RIF
40 different antibiotics with classrsi
(seeas.rsi()
); these column names occur in antibiotics data set and can be translated withab_name()
Read more on our website!
diff --git a/docs/reference/filter_ab_class.html b/docs/reference/filter_ab_class.html index 25359ca93..2fbb21bdf 100644 --- a/docs/reference/filter_ab_class.html +++ b/docs/reference/filter_ab_class.html @@ -85,7 +85,7 @@ @@ -272,7 +272,7 @@ab_class -+ an antimicrobial class, like
"carbapenems"
, as can be found inAMR::antibiotics$group
an antimicrobial class, like
"carbapenems"
, as can be found inAMR::antibiotics$group
result @@ -290,7 +290,7 @@Details
-The
+group
column inantibiotics
data set will be searched forab_class
(case-insensitive). If no results are found, theatc_group1
andatc_group2
columns will be searched. Next,x
will be checked for column names with a value in any abbreviations, codes or official names found in theantibiotics
data set.The
group
column in antibiotics data set will be searched forab_class
(case-insensitive). If no results are found, theatc_group1
andatc_group2
columns will be searched. Next,x
will be checked for column names with a value in any abbreviations, codes or official names found in the antibiotics data set.Examples
library(dplyr) diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 565ce03f6..405b293ad 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -85,7 +85,7 @@ @@ -237,26 +237,50 @@Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type.
-first_isolate(x, col_date = NULL, col_patient_id = NULL, - col_mo = NULL, col_testcode = NULL, col_specimen = NULL, - col_icu = NULL, col_keyantibiotics = NULL, episode_days = 365, - testcodes_exclude = NULL, icu_exclude = FALSE, - specimen_group = NULL, type = "keyantibiotics", ignore_I = TRUE, - points_threshold = 2, info = TRUE, include_unknown = FALSE, ...) +first_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + col_testcode = NULL, + col_specimen = NULL, + col_icu = NULL, + col_keyantibiotics = NULL, + episode_days = 365, + testcodes_exclude = NULL, + icu_exclude = FALSE, + specimen_group = NULL, + type = "keyantibiotics", + ignore_I = TRUE, + points_threshold = 2, + info = TRUE, + include_unknown = FALSE, + ... +) -filter_first_isolate(x, col_date = NULL, col_patient_id = NULL, - col_mo = NULL, ...) +filter_first_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + ... +) -filter_first_weighted_isolate(x, col_date = NULL, - col_patient_id = NULL, col_mo = NULL, col_keyantibiotics = NULL, - ...)+filter_first_weighted_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + col_keyantibiotics = NULL, + ... +)Arguments
x -+ a
data.frame
containing isolates.a
data.frame
containing isolates.col_date @@ -268,7 +292,7 @@col_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.col_testcode @@ -284,7 +308,7 @@col_keyantibiotics -+ column name of the key antibiotics to determine first weighted isolates, see
key_antibiotics
. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Usecol_keyantibiotics = FALSE
to prevent this.column name of the key antibiotics to determine first weighted isolates, see
key_antibiotics()
. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Usecol_keyantibiotics = FALSE
to prevent this.episode_days @@ -324,28 +348,29 @@... -+ parameters passed on to the
first_isolate
functionparameters passed on to the
first_isolate()
functionSource
-Methodology of this function is based on: M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition, 2014, Clinical and Laboratory Standards Institute (CLSI). https://clsi.org/standards/products/microbiology/documents/m39/.
+Methodology of this function is based on:
+M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition, 2014, Clinical and Laboratory Standards Institute (CLSI). https://clsi.org/standards/products/microbiology/documents/m39/.
Value
-Logical vector
+A
logical
vectorDetails
WHY THIS IS SO IMPORTANT
+To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [1](https://www.ncbi.nlm.nih.gov/pubmed/17304462). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all S. aureus isolates would be overestimated, because you included this MRSA more than once. It would be selection bias.
-To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [1]. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all S. aureus isolates would be overestimated, because you included this MRSA more than once. It would be selection bias.All isolates with a microbial ID of
-NA
will be excluded as first isolate.The functions
filter_first_isolate
andfilter_first_weighted_isolate
are helper functions to quickly filter on first isolates. The functionfilter_first_isolate
is essentially equal to:- x %>% +The functions
filter_first_isolate()
andfilter_first_weighted_isolate()
are helper functions to quickly filter on first isolates. The functionfilter_first_isolate()
is essentially equal to:x %>% mutate(only_firsts = first_isolate(x, ...)) %>% filter(only_firsts == TRUE) %>% select(-only_firsts) -The function
filter_first_weighted_isolate
is essentially equal to:- x %>% ++ +The function
filter_first_weighted_isolate()
is essentially equal to:x %>% mutate(keyab = key_antibiotics(.)) %>% mutate(only_weighted_firsts = first_isolate(x, col_keyantibiotics = "keyab", ...)) %>% @@ -357,11 +382,13 @@ To conduct an analysis of antimicrobial resistance, you should only include the -There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
-1. Using
-type = "keyantibiotics"
and parameterignore_I
- Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. Withignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in thekey_antibiotics
function.2. Using
+type = "points"
and parameterpoints_threshold
- A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceedspoints_threshold
, which default to2
, an isolate will be (re)selected as a first weighted isolate.There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
+
+- +
Using
+type = "keyantibiotics"
and parameterignore_I
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With
ignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in thekey_antibiotics()
function.- +
Using
+type = "points"
and parameterpoints_threshold
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds
points_threshold
, which default to2
, an isolate will be (re)selected as a first weighted isolate.Read more on our website!
@@ -369,7 +396,7 @@ To conduct an analysis of antimicrobial resistance, you should only include theOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
# `example_isolates` is a dataset available in the AMR package. diff --git a/docs/reference/g.test.html b/docs/reference/g.test.html index b3f4246ef..059034597 100644 --- a/docs/reference/g.test.html +++ b/docs/reference/g.test.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,11 +234,10 @@--+
g.test
performs chi-squared contingency table tests and goodness-of-fit tests, just likechisq.test
but is more reliable [1]. A G-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a G-test of goodness-of-fit), or to see whether the proportions of one variable are different for different values of the other variable (called a G-test of independence).
g.test()
performs chi-squared contingency table tests and goodness-of-fit tests, just likechisq.test()
but is more reliable 1. A G-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a G-test of goodness-of-fit), or to see whether the proportions of one variable are different for different values of the other variable (called a G-test of independence).g.test(x, y = NULL, p = rep(1/length(x), length(x)), - rescale.p = FALSE)+g.test(x, y = NULL, p = rep(1/length(x), length(x)), rescale.p = FALSE)Arguments
@@ -268,8 +267,8 @@
Source
-This code is almost identical to
chisq.test
, except that:-
- +
The calculation of the statistic was changed to
2 * sum(x * log(x / E))
The code for this function is identical to that of
chisq.test()
, except that:+
@@ -301,33 +300,33 @@The calculation of the statistic was changed to \(2 * sum(x * log(x / E))\)
Yates' continuity correction was removed as it does not apply to a G-test
The possibility to simulate p values with
simulate.p.value
was removedIf
x
is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries ofx
must be non-negative integers. Otherwise,x
andy
must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals.The p-value is computed from the asymptotic chi-squared distribution of the test statistic.
In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the G-test) but rather that for Fisher's exact test.
-In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by
-p
, each sample being of sizen = sum(x)
. This simulation is done in R and may be slow.G-test of goodness-of-fit (likelihood ratio test)
+In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by
p
, each sample being of sizen = sum(x)
. This simulation is done in R and may be slow.G-test of goodness-of-fit (likelihood ratio test)
-Use the G-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross).
-If the expected number of observations in any category is too small, the G-test may give inaccurate results, and you should use an exact test instead (
-fisher.test
).The G-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (
-chisq.test
); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.G-test of independence
+If the expected number of observations in any category is too small, the G-test may give inaccurate results, and you should use an exact test instead (
+fisher.test()
).The G-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (
+ +chisq.test()
); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar.G-test of independence
-Use the G-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable.
It is also possible to do a G-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together.
-Fisher's exact test (
-fisher.test
) is an exact test, where the G-test is still only an approximation. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.The G-test of independence is an alternative to the chi-square test of independence (
-chisq.test
), and they will give approximately the same results.How the test works
+Fisher's exact test (
+fisher.test()
) is an exact test, where the G-test is still only an approximation. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions.The G-test of independence is an alternative to the chi-square test of independence (
- +chisq.test()
), and they will give approximately the same results.How the test works
-Unlike the exact test of goodness-of-fit (
+ +fisher.test
), the G-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the G-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.Unlike the exact test of goodness-of-fit (
fisher.test()
), the G-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the G-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic.The G-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a G-statistic is:
--
G <- 2 * sum(x * log(x / E))
where
-E
are the expected values. Since this is chi-square distributed, the p value can be calculated with:+
p <- stats::pchisq(G, df, lower.tail = FALSE)
\(G = 2 * sum(x * log(x / E))\)
+where
E
are the expected values. Since this is chi-square distributed, the p value can be calculated in R with:p <- stats::pchisq(G, df, lower.tail = FALSE) ++where
df
are the degrees of freedom.If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use G-tests for each category, of course.
+Read more on our website!
@@ -335,10 +334,10 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
References
-[1] McDonald, J.H. 2014. Handbook of Biological Statistics (3rd ed.). Sparky House Publishing, Baltimore, Maryland. http://www.biostathandbook.com/gtestgof.html.
+1 McDonald, J.H. 2014. Handbook of Biological Statistics (3rd ed.). Sparky House Publishing, Baltimore, Maryland. http://www.biostathandbook.com/gtestgof.html.
See also
- +Examples
# = EXAMPLE 1 = @@ -380,9 +379,6 @@
- Source
- Value
- Details
-- G-test of goodness-of-fit (likelihood ratio test)
-- G-test of independence
-- How the test works
- Read more on our website!
- References
- See also
diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index fb78880db..60b7ff6c3 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -85,7 +85,7 @@ @@ -234,43 +234,73 @@--Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal
+ggplot2
functions.Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal ggplot2 functions.
ggplot_rsi(data, position = NULL, x = "antibiotic", - fill = "interpretation", facet = NULL, breaks = seq(0, 1, 0.1), - limits = NULL, translate_ab = "name", combine_SI = TRUE, - combine_IR = FALSE, language = get_locale(), nrow = NULL, - colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = - "#ff6961", R = "#ff6961"), datalabels = TRUE, datalabels.size = 2.5, - datalabels.colour = "gray15", title = NULL, subtitle = NULL, - caption = NULL, x.title = "Antimicrobial", y.title = "Proportion", - ...) +ggplot_rsi( + data, + position = NULL, + x = "antibiotic", + fill = "interpretation", + facet = NULL, + breaks = seq(0, 1, 0.1), + limits = NULL, + translate_ab = "name", + combine_SI = TRUE, + combine_IR = FALSE, + language = get_locale(), + nrow = NULL, + colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = "#ff6961", R = + "#ff6961"), + datalabels = TRUE, + datalabels.size = 2.5, + datalabels.colour = "gray15", + title = NULL, + subtitle = NULL, + caption = NULL, + x.title = "Antimicrobial", + y.title = "Proportion", + ... +) -geom_rsi(position = NULL, x = c("antibiotic", "interpretation"), - fill = "interpretation", translate_ab = "name", - language = get_locale(), combine_SI = TRUE, combine_IR = FALSE, - ...) +geom_rsi( + position = NULL, + x = c("antibiotic", "interpretation"), + fill = "interpretation", + translate_ab = "name", + language = get_locale(), + combine_SI = TRUE, + combine_IR = FALSE, + ... +) facet_rsi(facet = c("interpretation", "antibiotic"), nrow = NULL) scale_y_percent(breaks = seq(0, 1, 0.1), limits = NULL) -scale_rsi_colours(colours = c(S = "#61a8ff", SI = "#61a8ff", I = - "#61f7ff", IR = "#ff6961", R = "#ff6961")) +scale_rsi_colours( + colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = "#ff6961", R = + "#ff6961") +) theme_rsi() -labels_rsi_count(position = NULL, x = "antibiotic", - translate_ab = "name", combine_SI = TRUE, combine_IR = FALSE, - datalabels.size = 3, datalabels.colour = "gray15")+labels_rsi_count( + position = NULL, + x = "antibiotic", + translate_ab = "name", + combine_SI = TRUE, + combine_IR = FALSE, + datalabels.size = 3, + datalabels.colour = "gray15" +)Arguments
data -+ a
data.frame
with column(s) of class"rsi"
(seeas.rsi
)a
data.frame
with column(s) of classrsi
(seeas.rsi()
)position @@ -298,7 +328,7 @@translate_ab -+ a column name of the
antibiotics
data set to translate the antibiotic abbreviations to, usingab_property
a column name of the antibiotics data set to translate the antibiotic abbreviations to, using
ab_property()
combine_SI @@ -310,7 +340,7 @@language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.nrow @@ -318,11 +348,11 @@colours -+ a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be
FALSE
to use defaultggplot2
colours.a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be
FALSE
to use default [ggplot2][ggplot2::ggplot()
colours.datalabels -+ show datalabels using
labels_rsi_count
show datalabels using
labels_rsi_count()
datalabels.size @@ -354,21 +384,23 @@... -+ other parameters passed on to
geom_rsi
other parameters passed on to
geom_rsi()
Details
-At default, the names of antibiotics will be shown on the plots using
-ab_name
. This can be set with thetranslate_ab
parameter. Seecount_df
.The functions
-
-geom_rsi
will take any variable from the data that has anrsi
class (created withas.rsi
) usingrsi_df
and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.-
facet_rsi
creates 2d plots (at default based on S/I/R) usingfacet_wrap
.-
scale_y_percent
transforms the y axis to a 0 to 100% range usingscale_continuous
.-
scale_rsi_colours
sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, usingscale_brewer
.-
theme_rsi
is aggplot theme
with minimal distraction.-
labels_rsi_count
print datalabels on the bars with percentage and amount of isolates usinggeom_text
+
ggplot_rsi
is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (%>%
). See Examples.At default, the names of antibiotics will be shown on the plots using
ab_name()
. This can be set with thetranslate_ab
parameter. Seecount_df()
.The functions
+ + ++
geom_rsi()
will take any variable from the data that has anrsi
class (created withas.rsi()
) usingrsi_df()
and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.+
facet_rsi()
creates 2d plots (at default based on S/I/R) usingggplot2::facet_wrap()
.+
scale_y_percent()
transforms the y axis to a 0 to 100% range usingggplot2::scale_continuous()
.+
scale_rsi_colours()
sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, usingggplot2::scale_brewer()
.+
theme_rsi()
is a [ggplot2 theme][ggplot2::theme()
with minimal distraction.+
labels_rsi_count()
print datalabels on the bars with percentage and amount of isolates usingggplot2::geom_text()
+
ggplot_rsi()
is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (%>%
). See Examples.Read more on our website!
diff --git a/docs/reference/guess_ab_col.html b/docs/reference/guess_ab_col.html index ed78a93a0..4a279f99d 100644 --- a/docs/reference/guess_ab_col.html +++ b/docs/reference/guess_ab_col.html @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-This tries to find a column name in a data set based on information from the
+antibiotics
data set. Also supports WHONET abbreviations.This tries to find a column name in a data set based on information from the antibiotics data set. Also supports WHONET abbreviations.
guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE)@@ -244,11 +244,11 @@x -+ a
data.frame
search_string -+ a text to search
x
for, will be checked withas.ab
if this value is not a column inx
a text to search
x
for, will be checked withas.ab()
if this value is not a column inx
verbose @@ -261,7 +261,7 @@A column name of
x
, orNULL
when no result is found.Details
-You can look for an antibiotic (trade) name or abbreviation and it will search
+x
and theantibiotics
data set for any column containing a name or code of that antibiotic. Longer columns names take precendence over shorter column names.You can look for an antibiotic (trade) name or abbreviation and it will search
x
and the antibiotics data set for any column containing a name or code of that antibiotic. Longer columns names take precendence over shorter column names.Read more on our website!
diff --git a/docs/reference/index.html b/docs/reference/index.html index c5cb42912..5de7a7bbc 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -84,7 +84,7 @@ @@ -348,7 +348,7 @@-
inner_join_microorganisms()
left_join_microorganisms()
right_join_microorganisms()
full_join_microorganisms()
semi_join_microorganisms()
anti_join_microorganisms()
+ Join a table with
microorganisms
Join a table with microorganisms
@@ -372,7 +372,7 @@ - + Symbol of a p value
Symbol of a p-value
@@ -398,7 +398,7 @@ -
count_resistant()
count_susceptible()
count_R()
count_IR()
count_I()
count_SI()
count_S()
count_all()
n_rsi()
count_df()
+ Count isolates
Count available isolates
@@ -560,7 +560,7 @@ diff --git a/docs/reference/join.html b/docs/reference/join.html index b27f061ef..ac2c22d1c 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -6,7 +6,7 @@ - - +
p.symbol()
portion_R()
portion_IR()
portion_I()
portion_SI()
portion_S()
p.symbol()
portion_R()
portion_IR()
portion_I()
portion_SI()
portion_S()
portion_df()
Deprecated functions
Join a table with +microorganisms
— join • AMR (for R)Join a table with microorganisms — join • AMR (for R) @@ -50,8 +50,8 @@ - - + + @@ -85,7 +85,7 @@ @@ -228,13 +228,13 @@-Join the dataset
+microorganisms
easily to an existing table or character vector.Join the data set microorganisms easily to an existing table or character vector.
inner_join_microorganisms(x, by = NULL, suffix = c("2", ""), ...) @@ -258,7 +258,7 @@by -+ a variable to join by - if left empty will search for a column with class
mo
(created withas.mo
) or will be"mo"
if that column name exists inx
, could otherwise be a column name ofx
with values that exist inmicroorganisms$mo
(likeby = "bacteria_id"
), or another column inmicroorganisms
(but then it should be named, likeby = c("my_genus_species" = "fullname")
)a variable to join by - if left empty will search for a column with class
mo
(created withas.mo()
) or will be"mo"
if that column name exists inx
, could otherwise be a column name ofx
with values that exist inmicroorganisms$mo
(likeby = "bacteria_id"
), or another column in microorganisms (but then it should be named, likeby = c("my_genus_species" = "fullname")
)suffix @@ -266,13 +266,13 @@... -+ other parameters to pass on to
dplyr::join
.other parameters to pass on to
dplyr::join()
Details
-Note: As opposed to the
+join
functions ofdplyr
, characters vectors are supported and at default existing columns will get a suffix"2"
and the newly joined columns will not get a suffix. Seejoin
for more information.Note: As opposed to the
dplyr::join()
functions ofdplyr
,characters
vectors are supported and at default existing columns will get a suffix"2"
and the newly joined columns will not get a suffix. Seedplyr::join()
for more information.Read more on our website!
diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html index f79575eab..ca78ccffe 100644 --- a/docs/reference/key_antibiotics.html +++ b/docs/reference/key_antibiotics.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,28 +234,42 @@--These function can be used to determine first isolates (see
+first_isolate
). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates.These function can be used to determine first isolates (see
first_isolate()
). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates.key_antibiotics(x, col_mo = NULL, universal_1 = guess_ab_col(x, - "amoxicillin"), universal_2 = guess_ab_col(x, - "amoxicillin/clavulanic acid"), universal_3 = guess_ab_col(x, - "cefuroxime"), universal_4 = guess_ab_col(x, - "piperacillin/tazobactam"), universal_5 = guess_ab_col(x, - "ciprofloxacin"), universal_6 = guess_ab_col(x, - "trimethoprim/sulfamethoxazole"), GramPos_1 = guess_ab_col(x, - "vancomycin"), GramPos_2 = guess_ab_col(x, "teicoplanin"), +key_antibiotics( + x, + col_mo = NULL, + universal_1 = guess_ab_col(x, "amoxicillin"), + universal_2 = guess_ab_col(x, "amoxicillin/clavulanic acid"), + universal_3 = guess_ab_col(x, "cefuroxime"), + universal_4 = guess_ab_col(x, "piperacillin/tazobactam"), + universal_5 = guess_ab_col(x, "ciprofloxacin"), + universal_6 = guess_ab_col(x, "trimethoprim/sulfamethoxazole"), + GramPos_1 = guess_ab_col(x, "vancomycin"), + GramPos_2 = guess_ab_col(x, "teicoplanin"), GramPos_3 = guess_ab_col(x, "tetracycline"), GramPos_4 = guess_ab_col(x, "erythromycin"), - GramPos_5 = guess_ab_col(x, "oxacillin"), GramPos_6 = guess_ab_col(x, - "rifampin"), GramNeg_1 = guess_ab_col(x, "gentamicin"), + GramPos_5 = guess_ab_col(x, "oxacillin"), + GramPos_6 = guess_ab_col(x, "rifampin"), + GramNeg_1 = guess_ab_col(x, "gentamicin"), GramNeg_2 = guess_ab_col(x, "tobramycin"), - GramNeg_3 = guess_ab_col(x, "colistin"), GramNeg_4 = guess_ab_col(x, - "cefotaxime"), GramNeg_5 = guess_ab_col(x, "ceftazidime"), - GramNeg_6 = guess_ab_col(x, "meropenem"), warnings = TRUE, ...) + GramNeg_3 = guess_ab_col(x, "colistin"), + GramNeg_4 = guess_ab_col(x, "cefotaxime"), + GramNeg_5 = guess_ab_col(x, "ceftazidime"), + GramNeg_6 = guess_ab_col(x, "meropenem"), + warnings = TRUE, + ... +) -key_antibiotics_equal(y, z, type = c("keyantibiotics", "points"), - ignore_I = TRUE, points_threshold = 2, info = FALSE)+key_antibiotics_equal( + y, + z, + type = c("keyantibiotics", "points"), + ignore_I = TRUE, + points_threshold = 2, + info = FALSE +)Arguments
@@ -266,19 +280,19 @@
col_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.universal_1, universal_2, universal_3, universal_4, universal_5, universal_6 -+ column names of broad-spectrum antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col
.column names of broad-spectrum antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col()
.GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6 -+ column names of antibiotics for Gram-positives, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col
.column names of antibiotics for Gram-positives, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col()
.GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6 -+ column names of antibiotics for Gram-negatives, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col
.column names of antibiotics for Gram-negatives, case-insensitive. At default, the columns containing these antibiotics will be guessed with
guess_ab_col()
.warnings @@ -312,22 +326,49 @@Details
-The function
-key_antibiotics
returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared usingkey_antibiotics_equal
, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."
). Thefirst_isolate
function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible S. aureus (MSSA) found within the same episode (seeepisode
parameter offirst_isolate
). Without key antibiotic comparison it would not.At default, the antibiotics that are used for Gram-positive bacteria are:
-
- amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin.At default, the antibiotics that are used for Gram-negative bacteria are:
+
- amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem.The function
+key_antibiotics()
returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared usingkey_antibiotics_equal()
, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."
). Thefirst_isolate()
function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible S. aureus (MSSA) found within the same episode (seeepisode
parameter offirst_isolate()
). Without key antibiotic comparison it would not.At default, the antibiotics that are used for Gram-positive bacteria are:
+
-- +
Amoxicillin
- +
Amoxicillin/clavulanic acid
- +
Cefuroxime
- +
Piperacillin/tazobactam
- +
Ciprofloxacin
- +
Trimethoprim/sulfamethoxazole
- +
Vancomycin
- +
Teicoplanin
- +
Tetracycline
- +
Erythromycin
- +
Oxacillin
- +
Rifampin
The function
+key_antibiotics_equal
checks the characters returned bykey_antibiotics
for equality, and returns a logical vector.At default the antibiotics that are used for Gram-negative bacteria are:
+
+ +- +
Amoxicillin
- +
Amoxicillin/clavulanic acid
- +
Cefuroxime
- +
Piperacillin/tazobactam
- +
Ciprofloxacin
- +
Trimethoprim/sulfamethoxazole
- +
Gentamicin
- +
Tobramycin
- +
Colistin
- +
Cefotaxime
- +
Ceftazidime
- +
Meropenem
The function
key_antibiotics_equal()
checks the characters returned bykey_antibiotics()
for equality, and returns alogical
vector.Key antibiotics
-There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
-1. Using
-type = "keyantibiotics"
and parameterignore_I
- Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. Withignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in thekey_antibiotics
function.2. Using
+type = "points"
and parameterpoints_threshold
- A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceedspoints_threshold
, which default to2
, an isolate will be (re)selected as a first weighted isolate.There are two ways to determine whether isolates can be included as first weighted isolates which will give generally the same results:
+
+- +
Using
+type = "keyantibiotics"
and parameterignore_I
Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With
ignore_I = FALSE
, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in thekey_antibiotics()
function.- +
Using
+type = "points"
and parameterpoints_threshold
A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds
points_threshold
, which default to2
, an isolate will be (re)selected as a first weighted isolate.Read more on our website!
@@ -335,7 +376,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
# `example_isolates` is a dataset available in the AMR package. diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 29b192872..68b766cc0 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -85,7 +85,7 @@ @@ -253,7 +253,7 @@x -+ a vector of values, a
matrix
or adata frame
a vector of values, a
matrix
or adata frame
na.rm @@ -268,7 +268,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-Convenient wrapper around
+grep
to match a pattern:a %like% b
. It always returns alogical
vector and is always case-insensitive (usea %like_case% b
for case-sensitive matching). Also,pattern
(b
) can be as long asx
(a
) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.Convenient wrapper around
base::grep()
to match a pattern:a %like% b
. It always returns alogical
vector and is always case-insensitive (usea %like_case% b
for case-sensitive matching). Also,pattern
(b) can be as long asx
(a) to compare items of each index in both vectors, or can both have the same length to iterate over all cases.like(x, pattern, ignore.case = TRUE) @@ -274,10 +274,10 @@Idea from the
like
function from thedata.table
package, but made it case insensitive at default and let it support multiple patterns. Also, if the regex fails the first time, it tries again withperl = TRUE
.Value
-A
+logical
vectorA
logical
vectorDetails
-Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools > Modify Keyboard Shortcuts...).
+Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like
Ctrl+Shift+L
orCmd+Shift+L
(seeTools
>Modify Keyboard Shortcuts...
).Read more on our website!
@@ -285,7 +285,7 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
# simple test diff --git a/docs/reference/mdro.html b/docs/reference/mdro.html index f1d5c40dc..a36960441 100644 --- a/docs/reference/mdro.html +++ b/docs/reference/mdro.html @@ -85,7 +85,7 @@ @@ -237,9 +237,16 @@Determine which isolates are multidrug-resistant organisms (MDRO) according to international and national guidelines.
-mdro(x, guideline = NULL, col_mo = NULL, info = TRUE, - pct_required_classes = 0.5, combine_SI = TRUE, verbose = FALSE, - ...) +mdro( + x, + guideline = "CMI2012", + col_mo = NULL, + info = TRUE, + pct_required_classes = 0.5, + combine_SI = TRUE, + verbose = FALSE, + ... +) brmo(x, guideline = "BRMO", ...) @@ -260,15 +267,15 @@guideline -+ a specific guideline to follow. When left empty, the publication by Magiorakos et al. (2012, Clinical Microbiology and Infection) will be followed, see Details.
a specific guideline to follow. When left empty, the publication by Magiorakos et al. (2012, Clinical Microbiology and Infection) will be followed, please see Details.
col_mo -+ column name of the IDs of the microorganisms (see
as.mo
), defaults to the first column of classmo
. Values will be coerced usingas.mo
.column name of the IDs of the microorganisms (see
as.mo()
), defaults to the first column of classmo
. Values will be coerced usingas.mo()
.info -+ print progress
a logical to indicate whether progress should be printed to the console
pct_required_classes @@ -284,32 +291,41 @@... -+ column name of an antibiotic, see section Antibiotics
column name of an antibiotic, please see section Antibiotics below
Source
-Please see Details for the list of publications used for this function.
+Please see Details for the list of publications used for this function.
Value
-
- -
CMI 2012 paper - function
mdr_cmi2012()
ormdro()
:
Ordered factor with levelsNegative < Multi-drug-resistant (MDR) < Extensively drug-resistant (XDR) < Pandrug-resistant (PDR)
- -
TB guideline - function
mdr_tb()
ormdro(..., guideline = "TB")
:
Ordered factor with levelsNegative < Mono-resistant < Poly-resistant < Multi-drug-resistant < Extensively drug-resistant
- -
German guideline - function
mrgn()
ormdro(..., guideline = "MRGN")
:
Ordered factor with levelsNegative < 3MRGN < 4MRGN
- +
Everything else:
Ordered factor with levelsNegative < Positive, unconfirmed < Positive
. The value"Positive, unconfirmed"
means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests- +
CMI 2012 paper - function
mdr_cmi2012()
ormdro()
:
+Orderedfactor
with levelsNegative
<Multi-drug-resistant (MDR)
<Extensively drug-resistant (XDR)
<Pandrug-resistant (PDR)
- +
TB guideline - function
mdr_tb()
ormdro(..., guideline = "TB")
:
+Orderedfactor
with levelsNegative
<Mono-resistant
<Poly-resistant
<Multi-drug-resistant
<Extensively drug-resistant
- +
German guideline - function
mrgn()
ormdro(..., guideline = "MRGN")
:
+Orderedfactor
with levelsNegative
<3MRGN
<4MRGN
Everything else:
+Orderedfactor
with levelsNegative
<Positive, unconfirmed
<Positive
. The value"Positive, unconfirmed"
means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) testsDetails
For the
pct_required_classes
argument, values above 1 will be divided by 100. This is to support both fractions (0.75
or3/4
) and percentages (75
).Currently supported guidelines are (case-insensitive):
-
- -
guideline = "CMI2012"
: Magiorakos AP, Srinivasan A et al. "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (link)- -
guideline = "EUCAST"
: The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)- -
guideline = "TB"
: The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (link)- -
guideline = "MRGN"
: The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6- +
guideline = "BRMO"
: The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (link)- +
guideline = "CMI2012"
+Magiorakos AP, Srinivasan A et al. "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (link)- +
guideline = "EUCAST"
+The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (link)- +
guideline = "TB"
+The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (link)- +
guideline = "MRGN"
+The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6
guideline = "BRMO"
+The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) ZKH" (link)Please suggest your own (country-specific) guidelines by letting us know: https://gitlab.com/msberends/AMR/issues/new.
@@ -318,100 +334,99 @@ -To define antibiotics column names, leave as it is to determine it automatically with
-guess_ab_col
or input a text (case-insensitive), or useNULL
to skip a column (e.g.TIC = NULL
to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.The following antibiotics are used for the functions
+eucast_rules
andmdro
. These are shown below in the format 'antimicrobial ID: name (ATC code)', sorted by name:To define antibiotics column names, leave as it is to determine it automatically with
+guess_ab_col()
or input a text (case-insensitive), or useNULL
to skip a column (e.g.TIC = NULL
to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning.The following antibiotics are used for the functions
eucast_rules()
andmdro()
. These are shown below in the format 'antimicrobial ID: name (ATC code)', sorted by name:AMK: amikacin (J01GB06), - AMX: amoxicillin (J01CA04), - AMC: amoxicillin/clavulanic acid (J01CR02), - AMP: ampicillin (J01CA01), - SAM: ampicillin/sulbactam (J01CR01), - AZM: azithromycin (J01FA10), - AZL: azlocillin (J01CA09), - ATM: aztreonam (J01DF01), - CAP: capreomycin (J04AB30), - RID: cefaloridine (J01DB02), - CZO: cefazolin (J01DB04), - FEP: cefepime (J01DE01), - CTX: cefotaxime (J01DD01), - CTT: cefotetan (J01DC05), - FOX: cefoxitin (J01DC01), - CPT: ceftaroline (J01DI02), - CAZ: ceftazidime (J01DD02), - CRO: ceftriaxone (J01DD04), - CXM: cefuroxime (J01DC02), - CED: cephradine (J01DB09), - CHL: chloramphenicol (J01BA01), - CIP: ciprofloxacin (J01MA02), - CLR: clarithromycin (J01FA09), - CLI: clindamycin (J01FF01), - COL: colistin (J01XB01), - DAP: daptomycin (J01XX09), - DOR: doripenem (J01DH04), - DOX: doxycycline (J01AA02), - ETP: ertapenem (J01DH03), - ERY: erythromycin (J01FA01), - ETH: ethambutol (J04AK02), - FLC: flucloxacillin (J01CF05), - FOS: fosfomycin (J01XX01), - FUS: fusidic acid (J01XC01), - GAT: gatifloxacin (J01MA16), - GEN: gentamicin (J01GB03), - GEH: gentamicin-high (no ATC code), - IPM: imipenem (J01DH51), - INH: isoniazid (J04AC01), - KAN: kanamycin (J01GB04), - LVX: levofloxacin (J01MA12), - LIN: lincomycin (J01FF02), - LNZ: linezolid (J01XX08), - MEM: meropenem (J01DH02), - MTR: metronidazole (J01XD01), - MEZ: mezlocillin (J01CA10), - MNO: minocycline (J01AA08), - MFX: moxifloxacin (J01MA14), - NAL: nalidixic acid (J01MB02), - NEO: neomycin (J01GB05), - NET: netilmicin (J01GB07), - NIT: nitrofurantoin (J01XE01), - NOR: norfloxacin (J01MA06), - NOV: novobiocin (QJ01XX95), - OFX: ofloxacin (J01MA01), - OXA: oxacillin (J01CF04), - PEN: penicillin G (J01CE01), - PIP: piperacillin (J01CA12), - TZP: piperacillin/tazobactam (J01CR05), - PLB: polymyxin B (J01XB02), - PRI: pristinamycin (J01FG01), - PZA: pyrazinamide (J04AK01), - QDA: quinupristin/dalfopristin (J01FG02), - RIB: rifabutin (J04AB04), - RIF: rifampicin (J04AB02), - RFP: rifapentine (J04AB05), - RXT: roxithromycin (J01FA06), - SIS: sisomicin (J01GB08), - STH: streptomycin-high (no ATC code), - TEC: teicoplanin (J01XA02), - TLV: telavancin (J01XA03), - TCY: tetracycline (J01AA07), - TIC: ticarcillin (J01CA13), - TCC: ticarcillin/clavulanic acid (J01CR03), - TGC: tigecycline (J01AA12), - TOB: tobramycin (J01GB01), - TMP: trimethoprim (J01EA01), - SXT: trimethoprim/sulfamethoxazole (J01EE01), - VAN: vancomycin (J01XA01).
+AMX: amoxicillin (J01CA04), +AMC: amoxicillin/clavulanic acid (J01CR02), +AMP: ampicillin (J01CA01), +SAM: ampicillin/sulbactam (J01CR01), +AZM: azithromycin (J01FA10), +AZL: azlocillin (J01CA09), +ATM: aztreonam (J01DF01), +CAP: capreomycin (J04AB30), +RID: cefaloridine (J01DB02), +CZO: cefazolin (J01DB04), +FEP: cefepime (J01DE01), +CTX: cefotaxime (J01DD01), +CTT: cefotetan (J01DC05), +FOX: cefoxitin (J01DC01), +CPT: ceftaroline (J01DI02), +CAZ: ceftazidime (J01DD02), +CRO: ceftriaxone (J01DD04), +CXM: cefuroxime (J01DC02), +CED: cephradine (J01DB09), +CHL: chloramphenicol (J01BA01), +CIP: ciprofloxacin (J01MA02), +CLR: clarithromycin (J01FA09), +CLI: clindamycin (J01FF01), +COL: colistin (J01XB01), +DAP: daptomycin (J01XX09), +DOR: doripenem (J01DH04), +DOX: doxycycline (J01AA02), +ETP: ertapenem (J01DH03), +ERY: erythromycin (J01FA01), +ETH: ethambutol (J04AK02), +FLC: flucloxacillin (J01CF05), +FOS: fosfomycin (J01XX01), +FUS: fusidic acid (J01XC01), +GAT: gatifloxacin (J01MA16), +GEN: gentamicin (J01GB03), +GEH: gentamicin-high (no ATC code), +IPM: imipenem (J01DH51), +INH: isoniazid (J04AC01), +KAN: kanamycin (J01GB04), +LVX: levofloxacin (J01MA12), +LIN: lincomycin (J01FF02), +LNZ: linezolid (J01XX08), +MEM: meropenem (J01DH02), +MTR: metronidazole (J01XD01), +MEZ: mezlocillin (J01CA10), +MNO: minocycline (J01AA08), +MFX: moxifloxacin (J01MA14), +NAL: nalidixic acid (J01MB02), +NEO: neomycin (J01GB05), +NET: netilmicin (J01GB07), +NIT: nitrofurantoin (J01XE01), +NOR: norfloxacin (J01MA06), +NOV: novobiocin (QJ01XX95), +OFX: ofloxacin (J01MA01), +OXA: oxacillin (J01CF04), +PEN: penicillin G (J01CE01), +PIP: piperacillin (J01CA12), +TZP: piperacillin/tazobactam (J01CR05), +PLB: polymyxin B (J01XB02), +PRI: pristinamycin (J01FG01), +PZA: pyrazinamide (J04AK01), +QDA: quinupristin/dalfopristin (J01FG02), +RIB: rifabutin (J04AB04), +RIF: rifampicin (J04AB02), +RFP: rifapentine (J04AB05), +RXT: roxithromycin (J01FA06), +SIS: sisomicin (J01GB08), +STH: streptomycin-high (no ATC code), +TEC: teicoplanin (J01XA02), +TLV: telavancin (J01XA03), +TCY: tetracycline (J01AA07), +TIC: ticarcillin (J01CA13), +TCC: ticarcillin/clavulanic acid (J01CR03), +TGC: tigecycline (J01AA12), +TOB: tobramycin (J01GB01), +TMP: trimethoprim (J01EA01), +SXT: trimethoprim/sulfamethoxazole (J01EE01), +VAN: vancomycin (J01XA01).Interpretation of S, I and R
-In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
-+
In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
S - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
I - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
R - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
diff --git a/docs/reference/microorganisms.codes.html b/docs/reference/microorganisms.codes.html index 73cc3ae24..43f207313 100644 --- a/docs/reference/microorganisms.codes.html +++ b/docs/reference/microorganisms.codes.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with
+set_mo_source
.A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with
set_mo_source()
.microorganisms.codes
@@ -242,18 +242,17 @@Format
-A
data.frame
with 5,433 observations and 2 variables:-
+code
- -
Commonly used code of a microorganism
mo
- - -
ID of the microorganism in the
microorganisms
data setA
data.frame
with 5,433 observations and 2 variables:+
- +
code
Commonly used code of a microorganism- +
mo
ID of the microorganism in the microorganisms data setCatalogue of Life
-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Read more on our website!
@@ -261,7 +260,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using
+as.mo
.A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using
as.mo()
.microorganisms
@@ -242,27 +242,26 @@Format
-A
data.frame
with 69,447 observations and 16 variables:-
+mo
- -
ID of microorganism as used by this package
col_id
- -
Catalogue of Life ID
fullname
- -
Full name, like
"Escherichia coli"
kingdom
,phylum
,class
,order
,family
,genus
,species
,subspecies
- -
Taxonomic rank of the microorganism
rank
- -
Text of the taxonomic rank of the microorganism, like
"species"
or"genus"
ref
- -
Author(s) and year of concerning scientific publication
species_id
- -
ID of the species as used by the Catalogue of Life
source
- -
Either "CoL", "DSMZ" (see Source) or "manually added"
prevalence
- - -
Prevalence of the microorganism, see
?as.mo
A
data.frame
with 69,447 observations and 16 variables:+
- +
mo
ID of microorganism as used by this package- +
col_id
Catalogue of Life ID- +
fullname
Full name, like"Escherichia coli"
- +
kingdom
,phylum
,class
,order
,family
,genus
,species
,subspecies
Taxonomic rank of the microorganism- +
rank
Text of the taxonomic rank of the microorganism, like"species"
or"genus"
- +
ref
Author(s) and year of concerning scientific publication- +
species_id
ID of the species as used by the Catalogue of Life- +
source
Either "CoL", "DSMZ" (see Source) or "manually added"- +
prevalence
Prevalence of the microorganism, seeas.mo()
Source
-Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
-catalogue_of_life_version()
).Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date (check included version with
+catalogue_of_life_version()
).Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
+catalogue_of_life_version()
).Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date (check included version with
catalogue_of_life_version()
).Details
Manually added were:
- -
11 entries of Streptococcus (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)
- +
2 entries of Staphylococcus (coagulase-negative [CoNS] and coagulase-positive [CoPS])
2 entries of Staphylococcus (coagulase-negative CoNS and coagulase-positive CoPS)
3 entries of Trichomonas (Trichomonas vaginalis, and its family and genus)
1 entry of Blastocystis (Blastocystis hominis), although it officially does not exist (Noel et al. 2005, PMID 15634993)
- @@ -282,7 +281,7 @@
5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)
-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Read more on our website!
@@ -290,7 +289,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by
+as.mo
.A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by
as.mo()
.microorganisms.old
@@ -242,24 +242,23 @@Format
-A
data.frame
with 24,246 observations and 5 variables:-
+col_id
- -
Catalogue of Life ID that was originally given
col_id_new
- -
New Catalogue of Life ID that responds to an entry in the
microorganisms
data setfullname
- -
Old full taxonomic name of the microorganism
ref
- -
Author(s) and year of concerning scientific publication
prevalence
- - -
Prevalence of the microorganism, see
?as.mo
A
data.frame
with 24,246 observations and 5 variables:+
- +
col_id
Catalogue of Life ID that was originally given- +
col_id_new
New Catalogue of Life ID that responds to an entry in the microorganisms data set- +
fullname
Old full taxonomic name of the microorganism- +
ref
Author(s) and year of concerning scientific publication- +
prevalence
Prevalence of the microorganism, seeas.mo()
Source
-Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
+catalogue_of_life_version()
).Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
catalogue_of_life_version()
).Catalogue of Life
-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Read more on our website!
@@ -267,7 +266,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with
+as.mo
, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with
as.mo()
, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples.mo_name(x, language = get_locale(), ...) @@ -286,23 +286,23 @@x -+ any (vector of) text that can be coerced to a valid microorganism code with
as.mo
any (vector of) text that can be coerced to a valid microorganism code with
as.mo()
language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.... -+ other parameters passed on to
as.mo
other parameters passed on to
as.mo()
open -+ browse the URL using
browseURL()
browse the URL using
utils::browseURL()
property -+ one of the column names of the
microorganisms
data set or"shortname"
one of the column names of the microorganisms data set or
"shortname"
-
- -
An
integer
in case ofmo_year
- -
A
list
in case ofmo_taxonomy
- -
A named
character
in case ofmo_url
- +
A
character
in all other cases- +
An
integer
in case ofmo_year()
- +
A
list
in case ofmo_taxonomy()
- +
A named
character
in case ofmo_url()
A
character
in all other casesDetails
-All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for
mo_ref
,mo_authors
andmo_year
. This leads to the following results:+
All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for
mo_ref()
,mo_authors()
andmo_year()
. This leads to the following results:
mo_name("Chlamydia psittaci")
will return"Chlamydophila psittaci"
(with a warning about the renaming)
mo_ref("Chlamydia psittaci")
will return"Page, 1968"
(with a warning about the renaming)- @@ -333,15 +333,18 @@
mo_ref("Chlamydophila psittaci")
will return"Everett et al., 1999"
(without a warning)-
![]()
This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (http://www.catalogueoflife.org). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
+catalogue_of_life_version()
.Click here for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with
catalogue_of_life_version()
.Source
-[1] Becker K et al. Coagulase-Negative Staphylococci. 2014. Clin Microbiol Rev. 27(4): 870–926. https://dx.doi.org/10.1128/CMR.00109-13
-[2] Becker K et al. 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. https://doi.org/10.1016/j.cmi.2019.02.028
-[3] Lancefield RC A serological differentiation of human and other groups of hemolytic streptococci. 1933. J Exp Med. 57(4): 571–95. https://dx.doi.org/10.1084/jem.57.4.571
-[4] Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
+catalogue_of_life_version()
).+
+- +
Becker K et al. Coagulase-Negative Staphylococci. 2014. Clin Microbiol Rev. 27(4): 870–926. https://dx.doi.org/10.1128/CMR.00109-13
- +
Becker K et al. 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. https://doi.org/10.1016/j.cmi.2019.02.028
- +
Lancefield RC A serological differentiation of human and other groups of hemolytic streptococci. 1933. J Exp Med. 57(4): 571–95. https://dx.doi.org/10.1084/jem.57.4.571
- +
Catalogue of Life: Annual Checklist (public online taxonomic database), http://www.catalogueoflife.org (check included annual version with
catalogue_of_life_version()
).Read more on our website!
@@ -349,7 +352,7 @@ This package contains the complete taxonomic tree of almost all microorganisms (On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +Examples
# taxonomic tree ----------------------------------------------------------- @@ -431,7 +434,7 @@ This package contains the complete taxonomic tree of almost all microorganisms ( # get a list with the complete taxonomy (from kingdom to subspecies) mo_taxonomy("E. coli") -# get a list with the taxonomy, the authors and the URL to the online database +# get a list with the taxonomy, the authors, Gram-stain and URL to the online database mo_info("E. coli") # }-@@ -255,15 +255,12 @@ This is the fastest way to have your organisation (or analysis) specific codes pThese functions can be used to predefine your own reference to be used in
+as.mo
and consequently allmo_*
functions likemo_genus
andmo_gramstain
.These functions can be used to predefine your own reference to be used in
as.mo()
and consequently allmo_*
functions likemo_genus()
andmo_gramstain()
.This is the fastest way to have your organisation (or analysis) specific codes picked up and translated by this package.
Details
The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the
-readxl
package installed.-
set_mo_source
will check the file for validity: it must be adata.frame
, must have a column named"mo"
which contains values frommicroorganisms$mo
and must have a reference column with your own defined values. If all tests pass,set_mo_source
will read the file into R and export it to"~/.mo_source.rds"
. This compressed data file will then be used at default for MO determination (functionas.mo
and consequently allmo_*
functions likemo_genus
andmo_gramstain
). The location of the original file will be saved as option withoptions(mo_source = path)
. Its timestamp will be saved withoptions(mo_source_datetime = ...)
.-
get_mo_source
will return the data set by reading"~/.mo_source.rds"
withreadRDS
. If the original file has changed (the file defined withpath
), it will callset_mo_source
to update the data file automatically.Reading an Excel file (
-.xlsx
) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read byget_mo_source
in only a couple of microseconds (a millionth of a second).How it works
++
set_mo_source()
will check the file for validity: it must be adata.frame
, must have a column named"mo"
which contains values frommicroorganisms$mo
and must have a reference column with your own defined values. If all tests pass,set_mo_source()
will read the file into R and export it to"~/.mo_source.rds"
. This compressed data file will then be used at default for MO determination (functionas.mo()
and consequently allmo_*
functions likemo_genus()
andmo_gramstain()
). The location of the original file will be saved as option withoptions(mo_source = path)
. Its timestamp will be saved withoptions(mo_source_datetime = ...)
.+
get_mo_source()
will return the data set by reading"~/.mo_source.rds"
withreadRDS()
. If the original file has changed (the file defined withpath
), it will callset_mo_source()
to update the data file automatically.Reading an Excel file (
.xlsx
) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read byget_mo_source()
in only a couple of microseconds (a millionth of a second).How it works
- -Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:
- | A | B | +Imagine this data on a sheet of an Excel file (mo codes were looked up in the
microorganisms
data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:| A | B | --|--------------------|-------------| 1 | Organisation XYZ | mo | 2 | lab_mo_ecoli | B_ESCHR_COL | @@ -271,49 +268,45 @@ This is the fastest way to have your organisation (or analysis) specific codes p 4 | | |-We save it as
'home/me/ourcodes.xlsx'
. Now we have to set it as a source:-set_mo_source("home/me/ourcodes.xlsx") +We save it as
"home/me/ourcodes.xlsx"
. Now we have to set it as a source:set_mo_source("home/me/ourcodes.xlsx") # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'.-It has now created a file "~/.mo_source.rds" with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.
-And now we can use it in our functions:
-as.mo("lab_mo_ecoli") -[1] B_ESCHR_COL +It has now created a file
+"~/.mo_source.rds"
with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept.And now we can use it in our functions:
as.mo("lab_mo_ecoli") +\[1\] B_ESCHR_COLI mo_genus("lab_mo_kpneumoniae") [1] "Klebsiella" # other input values still work too as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli")) -[1] B_ESCHR_COL B_ESCHR_COL B_ESCHR_COL +[1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI-If we edit the Excel file to, let's say, this:
- | A | B | ---|--------------------|-------------| -1 | Organisation XYZ | mo | -2 | lab_mo_ecoli | B_ESCHR_COL | -3 | lab_mo_kpneumoniae | B_KLBSL_PNE | -4 | lab_Staph_aureus | B_STPHY_AUR | -5 | | | +If we edit the Excel file to, let's say, this:
| A | B | +--|--------------------|--------------| +1 | Organisation XYZ | mo | +2 | lab_mo_ecoli | B_ESCHR_COLI | +3 | lab_mo_kpneumoniae | B_KLBSL_PNMN | +4 | lab_Staph_aureus | B_STPHY_AURS | +5 | | |-...any new usage of an MO function in this package will update your data:
-as.mo("lab_mo_ecoli") +...any new usage of an MO function in this package will update your data:
as.mo("lab_mo_ecoli") # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. -[1] B_ESCHR_COL +[1] B_ESCHR_COLI mo_genus("lab_Staph_aureus") [1] "Staphylococcus"-To remove the reference completely, just use any of these:
-set_mo_source("") +To remove the reference completely, just use any of these:
set_mo_source("") set_mo_source(NULL) # Removed mo_source file '~/.mo_source.rds'.+Read more on our website!
@@ -326,7 +319,6 @@ set_mo_source(NULL)Symbol of a p value — p_symbol • AMR (for R) +Symbol of a p-value — p_symbol • AMR (for R) @@ -50,8 +50,8 @@ - - + + @@ -85,7 +85,7 @@ @@ -228,13 +228,13 @@@@ -235,45 +235,50 @@ resistance() should be used to calculate resistance, susceptibility() should be-Symbol of a p value
+Symbol of a p-value
p_symbol.Rd
-Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above
+p = 1
will returnNA
.Return the symbol related to the p-value: 0 '
***
' 0.001 '**
' 0.01 '*
' 0.05 '.
' 0.1 ' ' 1. Values abovep = 1
will returnNA
.p_symbol(p, emptychar = " ")diff --git a/docs/reference/proportion.html b/docs/reference/proportion.html index 9e2d044b3..e16e1f162 100644 --- a/docs/reference/proportion.html +++ b/docs/reference/proportion.html @@ -51,7 +51,7 @@ - @@ -86,7 +86,7 @@ resistance() should be used to calculate resistance, susceptibility() should be--These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in
+dplyr
ssummarise
and support grouped variables, see Examples.These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in
dplyr::summarise()
and support grouped variables, please see Examples.
resistance()
should be used to calculate resistance,susceptibility()
should be used to calculate susceptibility.resistance(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +resistance(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -susceptibility(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +susceptibility(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_R(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_R(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_IR(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_IR(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_I(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_I(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_SI(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_SI(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_S(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_S(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_df(data, translate_ab = "name", language = get_locale(), - minimum = 30, as_percent = FALSE, combine_SI = TRUE, - combine_IR = FALSE) +proportion_df( + data, + translate_ab = "name", + language = get_locale(), + minimum = 30, + as_percent = FALSE, + combine_SI = TRUE, + combine_IR = FALSE +) -rsi_df(data, translate_ab = "name", language = get_locale(), - minimum = 30, as_percent = FALSE, combine_SI = TRUE, - combine_IR = FALSE)+rsi_df( + data, + translate_ab = "name", + language = get_locale(), + minimum = 30, + as_percent = FALSE, + combine_SI = TRUE, + combine_IR = FALSE +)Arguments
... -+ one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with
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.one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with
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.minimum @@ -285,19 +290,19 @@ resistance() should be used to calculate resistance, susceptibility() should beonly_all_tested -+ (for combination therapies, i.e. using more than one variable for
...
) a logical to indicate that isolates must be tested for all antibiotics, see section Combination therapy below(for combination therapies, i.e. using more than one variable for
...
): a logical to indicate that isolates must be tested for all antibiotics, see section Combination therapy belowdata -+ a
data.frame
containing columns with classrsi
(seeas.rsi
)a
data.frame
containing columns with classrsi
(seeas.rsi()
)translate_ab -+ a column name of the
antibiotics
data set to translate the antibiotic abbreviations to, usingab_property
a column name of the antibiotics data set to translate the antibiotic abbreviations to, using
ab_property()
language -+ language of the returned text, defaults to system language (see
get_locale
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.language of the returned text, defaults to system language (see
get_locale()
) and can also be set withgetOption("AMR_locale")
. Uselanguage = NULL
orlanguage = ""
to prevent translation.combine_SI @@ -314,20 +319,18 @@ resistance() should be used to calculate resistance, susceptibility() should beM39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition, 2014, Clinical and Laboratory Standards Institute (CLSI). https://clsi.org/standards/products/microbiology/documents/m39/.
Value
-Double or, when
+as_percent = TRUE
, a character.A
double
or, whenas_percent = TRUE
, acharacter
.Details
-The function
-resistance()
is equal to the functionproportion_R()
. The functionsusceptibility()
is equal to the functionproportion_SI()
.Remember that you should filter your table to let it contain only first isolates! This is needed to exclude duplicates and to reduce selection bias. Use
-first_isolate
to determine them in your data set.These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the
-count
functions to count isolates. The functionsusceptibility()
is essentially equal tocount_susceptible() / count_all()
. Low counts can infuence the outcome - theproportion
functions may camouflage this, since they only return the proportion (albeit being dependent on theminimum
parameter).The function
+proportion_df()
takes any variable fromdata
that has an"rsi"
class (created withas.rsi()
) and calculates the proportions R, I and S. The functionrsi_df()
works exactly likeproportion_df()
, but adds the number of isolates.The function
+resistance()
is equal to the functionproportion_R()
. The functionsusceptibility()
is equal to the functionproportion_SI()
.Remember that you should filter your table to let it contain only first isolates! This is needed to exclude duplicates and to reduce selection bias. Use
+first_isolate()
to determine them in your data set.These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the
+AMR::count()
functions to count isolates. The functionsusceptibility()
is essentially equal tocount_susceptible() / count_all()
. Low counts can infuence the outcome - theproportion
functions may camouflage this, since they only return the proportion (albeit being dependent on theminimum
parameter).The function
proportion_df()
takes any variable fromdata
that has anrsi
class (created withas.rsi()
) and calculates the proportions R, I and S. The functionrsi_df()
works exactly likeproportion_df()
, but adds the number of isolates.Combination therapy
-When using more than one variable for
-...
(= combination therapy)), useonly_all_tested
to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about howsusceptibility
works to calculate the %SI:--------------------------------------------------------------------- +When using more than one variable for
...
(= combination therapy)), useonly_all_tested
to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about howsusceptibility()
works to calculate the %SI:-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE ----------------------- ----------------------- Drug A Drug B include as include as include as include as @@ -345,11 +348,11 @@ resistance() should be used to calculate resistance, susceptibility() should be ---------------------------------------------------------------------Please note that, in combination therapies, for
only_all_tested = TRUE
applies that:- count_S() + count_I() + count_R() = count_all() +Please note that, in combination therapies, for
only_all_tested = TRUE
applies that:count_S() + count_I() + count_R() = count_all() proportion_S() + proportion_I() + proportion_R() = 1 -and that, in combination therapies, for
only_all_tested = FALSE
applies that:- count_S() + count_I() + count_R() >= count_all() ++ +and that, in combination therapies, for
only_all_tested = FALSE
applies that:count_S() + count_I() + count_R() >= count_all() proportion_S() + proportion_I() + proportion_R() >= 1@@ -358,15 +361,14 @@ resistance() should be used to calculate resistance, susceptibility() should be -In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
-+
In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
S - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
I - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
R - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
@@ -374,7 +376,7 @@ resistance() should be used to calculate resistance, susceptibility() should beOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
-+
count_*
to count resistant and susceptible isolates.
AMR::count()
to count resistant and susceptible isolates.Examples
# example_isolates is a data set available in the AMR package. diff --git a/docs/reference/read.4D.html b/docs/reference/read.4D.html index 84db8e425..60c43fa12 100644 --- a/docs/reference/read.4D.html +++ b/docs/reference/read.4D.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,14 +234,27 @@--This function is only useful for the MMB department of the UMCG. Use this function to import data by just defining the
+file
parameter. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes withas.mo
and transform all antimicrobial columns withas.rsi
.This function is only useful for the MMB department of the UMCG. Use this function to import data by just defining the
file
parameter. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes withas.mo()
and transform all antimicrobial columns withas.rsi()
.read.4D(file, info = interactive(), header = TRUE, row.names = NULL, - sep = "\t", quote = "\"'", dec = ",", na.strings = c("NA", "", - "."), skip = 2, check.names = TRUE, strip.white = TRUE, - fill = TRUE, blank.lines.skip = TRUE, stringsAsFactors = FALSE, - fileEncoding = "UTF-8", encoding = "UTF-8")+read.4D( + file, + info = interactive(), + header = TRUE, + row.names = NULL, + sep = "\t", + quote = "\"'", + dec = ",", + na.strings = c("NA", "", "."), + skip = 2, + check.names = TRUE, + strip.white = TRUE, + fill = TRUE, + blank.lines.skip = TRUE, + stringsAsFactors = FALSE, + fileEncoding = "UTF-8", + encoding = "UTF-8" +)Arguments
diff --git a/docs/reference/resistance_predict.html b/docs/reference/resistance_predict.html index 37ca38268..161340a5f 100644 --- a/docs/reference/resistance_predict.html +++ b/docs/reference/resistance_predict.html @@ -85,7 +85,7 @@
@@ -234,34 +234,59 @@--Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns
+se_min
andse_max
. See Examples for a real live example.Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns
se_min
andse_max
. See Examples for a real live example.resistance_predict(x, col_ab, col_date = NULL, year_min = NULL, - year_max = NULL, year_every = 1, minimum = 30, model = NULL, - I_as_S = TRUE, preserve_measurements = TRUE, info = TRUE, ...) +resistance_predict( + x, + col_ab, + col_date = NULL, + year_min = NULL, + year_max = NULL, + year_every = 1, + minimum = 30, + model = NULL, + I_as_S = TRUE, + preserve_measurements = TRUE, + info = TRUE, + ... +) -rsi_predict(x, col_ab, col_date = NULL, year_min = NULL, - year_max = NULL, year_every = 1, minimum = 30, model = NULL, - I_as_S = TRUE, preserve_measurements = TRUE, info = TRUE, ...) +rsi_predict( + x, + col_ab, + col_date = NULL, + year_min = NULL, + year_max = NULL, + year_every = 1, + minimum = 30, + model = NULL, + I_as_S = TRUE, + preserve_measurements = TRUE, + info = TRUE, + ... +) # S3 method for resistance_predict -plot(x, - main = paste("Resistance Prediction of", x_name), ...) +plot(x, main = paste("Resistance Prediction of", x_name), ...) -ggplot_rsi_predict(x, main = paste("Resistance Prediction of", x_name), - ribbon = TRUE, ...)+ggplot_rsi_predict( + x, + main = paste("Resistance Prediction of", x_name), + ribbon = TRUE, + ... +)Arguments
x -+ a
data.frame
containing isolates.a
data.frame
containing isolates.col_ab -+ column name of
x
with antimicrobial interpretations (R
,I
andS
)column name of
x
containing antimicrobial interpretations ("R"
,"I"
and"S"
)col_date @@ -285,11 +310,11 @@model -+ the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using
glm(..., family = binomial)
), assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `glm(..., family = binomial)``, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.
I_as_S -+ a logical to indicate whether values
I
should be treated asS
(will otherwise be treated asR
). The default,TRUE
, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below.a logical to indicate whether values
I
should be treated asS
(will otherwise be treated asR
). The default,TRUE
, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section Interpretation of S, I and R below.preserve_measurements @@ -297,7 +322,7 @@info -+ a logical to indicate whether textual analysis should be printed with the name and
summary
of the statistical model.a logical to indicate whether textual analysis should be printed with the name and
summary()
of the statistical model.... @@ -315,18 +340,20 @@Value
-
data.frame
with extra class"resistance_predict"
with columns:+
+ +A
data.frame
with extra classresistance_predict
with columns:
year
value
, the same asestimated
whenpreserve_measurements = FALSE
, and a combination ofobserved
andestimated
otherwise
se_min
, the lower bound of the standard error with a minimum of0
(so the standard error will never go below 0%)- -
se_max
the upper bound of the standard error with a maximum of1
(so the standard error will never go above 100%)- +
observations
, the total number of available observations in that year, i.e. S + I + R
observations
, the total number of available observations in that year, i.e. \(S + I + R\)
observed
, the original observed resistant percentages- -
estimated
, the estimated resistant percentages, calculated by the modelFurthermore, the model itself is available as an attribute:
+attributes(x)$model
, see Examples.Furthermore, the model itself is available as an attribute:
attributes(x)$model
, please see Examples.Details
-Valid options for the statistical model are:
+
Valid options for the statistical model (parameter
model
) are:
"binomial"
or"binom"
or"logit"
: a generalised linear regression model with binomial distribution
"loglin"
or"poisson"
: a generalised log-linear regression model with poisson distribution- @@ -336,15 +363,14 @@ -
"lin"
or"linear"
: a linear regression modelIn 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
-+
In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (http://www.eucast.org/newsiandr/). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations".
S - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.
I - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.
R - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.
Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection.
-This AMR package honours this new insight. Use
+susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.This AMR package honours this new insight. Use
susceptibility()
(equal toproportion_SI()
) to determine antimicrobial susceptibility andcount_susceptible()
(equal tocount_SI()
) to count susceptible isolates.Read more on our website!
@@ -352,10 +378,14 @@On our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- +The
+proportion()
functions to calculate resistanceExamples
-x <- resistance_predict(example_isolates, col_ab = "AMX", year_min = 2010, model = "binomial") +x <- resistance_predict(example_isolates, + col_ab = "AMX", + year_min = 2010, + model = "binomial") plot(x) ggplot_rsi_predict(x) @@ -394,9 +424,9 @@ scale_y_continuous(limits = c(0, 1), breaks = seq(0, 1, 0.1), labels = paste0(seq(0, 100, 10), "%")) + - labs(title = expression(paste("Forecast of amoxicillin resistance in ", + labs(title = expression(paste("Forecast of Amoxicillin Resistance in ", italic("E. coli"))), - y = "%IR", + y = "%R", x = "Year") + theme_minimal(base_size = 13) }diff --git a/docs/reference/rsi_translation.html b/docs/reference/rsi_translation.html index 54166eb82..4d5776f8e 100644 --- a/docs/reference/rsi_translation.html +++ b/docs/reference/rsi_translation.html @@ -51,7 +51,7 @@ - + @@ -85,7 +85,7 @@ @@ -234,7 +234,7 @@-Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use
+as.rsi
to transform MICs or disks measurements to RSI values.Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use
as.rsi()
to transform MICs or disks measurements to RSI values.rsi_translation
@@ -242,18 +242,17 @@Format
-A
data.frame
with 13,975 observations and 9 variables:-
+guideline
- -
Name of the guideline
method
- -
Either "MIC" or "DISK"
site
- -
Body site, e.g. "Oral" or "Respiratory"
mo
- -
Microbial ID, see
as.mo
ab
- -
Antibiotic ID, see
as.ab
ref_tbl
- -
Info about where the guideline rule can be found
disk_dose
- -
Dose of the used disk diffusion method
breakpoint_S
- -
Lowest MIC value or highest number of millimeters that leads to "S"
breakpoint_R
- - -
Highest MIC value or lowest number of millimeters that leads to "R"
A
data.frame
with 13,975 observations and 9 variables:+
- +
guideline
Name of the guideline- +
method
Either "MIC" or "DISK"- +
site
Body site, e.g. "Oral" or "Respiratory"- +
mo
Microbial ID, seeas.mo()
- +
ab
Antibiotic ID, seeas.ab()
- +
ref_tbl
Info about where the guideline rule can be found- +
disk_dose
Dose of the used disk diffusion method- +
breakpoint_S
Lowest MIC value or highest number of millimeters that leads to "S"- +
breakpoint_R
Highest MIC value or lowest number of millimeters that leads to "R"Read more on our website!
diff --git a/docs/reference/skewness.html b/docs/reference/skewness.html index a5841cb64..fec2d6608 100644 --- a/docs/reference/skewness.html +++ b/docs/reference/skewness.html @@ -86,7 +86,7 @@ When negative: the left tail is longer; the mass of the distribution is concentr @@ -255,7 +255,7 @@ When negative: the left tail is longer; the mass of the distribution is concentrx -+ a vector of values, a
matrix
or adata frame
a vector of values, a
matrix
or adata.frame
na.rm @@ -270,7 +270,7 @@ When negative: the left tail is longer; the mass of the distribution is concentrOn our website https://msberends.gitlab.io/AMR you can find a tutorial about how to conduct AMR analysis, the complete documentation of all functions (which reads a lot easier than here in R) and an example analysis using WHONET data.
See also
- + @@ -234,7 +234,7 @@-For language-dependent output of AMR functions, like
+mo_name
,mo_type
andab_name
.For language-dependent output of AMR functions, like
mo_name()
,mo_type()
andab_name()
.get_locale()
@@ -245,8 +245,8 @@Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv.
Currently supported languages can be found if running:
unique(AMR:::translations_file$lang)
.Please suggest your own translations by creating a new issue on our repository.
-This file will be read by all functions where a translated output can be desired, like all
-mo_property
functions (mo_fullname
,mo_type
, etc.).The system language will be used at default, if that language is supported. The system language can be overwritten with
+getOption("AMR_locale")
.This file will be read by all functions where a translated output can be desired, like all
+mo_property()
functions (mo_fullname()
,mo_type()
, etc.).The system language will be used at default, if that language is supported. The system language can be overwritten with
Sys.setenv(AMR_locale = yourlanguage)
.Read more on our website!
diff --git a/man/AMR-deprecated.Rd b/man/AMR-deprecated.Rd index 1210eac93..9b8fc1059 100644 --- a/man/AMR-deprecated.Rd +++ b/man/AMR-deprecated.Rd @@ -8,6 +8,7 @@ \alias{portion_I} \alias{portion_SI} \alias{portion_S} +\alias{portion_df} \title{Deprecated functions} \usage{ p.symbol(...) @@ -21,6 +22,8 @@ portion_I(...) portion_SI(...) portion_S(...) + +portion_df(...) } \description{ These functions are so-called '\link{Deprecated}'. They will be removed in a future release. Using the functions will give a warning with the name of the function it has been replaced by (if there is one). diff --git a/man/AMR.Rd b/man/AMR.Rd index 6c834394f..18b6ef1a8 100644 --- a/man/AMR.Rd +++ b/man/AMR.Rd @@ -13,17 +13,17 @@ We created this package for both academic research and routine analysis at the F This package can be used for: \itemize{ - \item{Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the Catalogue of Life} - \item{Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines} - \item{Determining first isolates to be used for AMR analysis} - \item{Calculating antimicrobial resistance} - \item{Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO)} - \item{Calculating (empirical) susceptibility of both mono therapy and combination therapies} - \item{Predicting future antimicrobial resistance using regression models} - \item{Getting properties for any microorganism (like Gram stain, species, genus or family)} - \item{Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name)} - \item{Plotting antimicrobial resistance} - \item{Applying EUCAST expert rules} +\item Reference for the taxonomy of microorganisms, since the package contains all microbial (sub)species from the \href{http://www.catalogueoflife.org}{Catalogue of Life} +\item Interpreting raw MIC and disk diffusion values, based on the latest CLSI or EUCAST guidelines +\item Determining first isolates to be used for AMR analysis +\item Calculating antimicrobial resistance +\item Determining multi-drug resistance (MDR) / multi-drug resistant organisms (MDRO) +\item Calculating (empirical) susceptibility of both mono therapy and combination therapies +\item Predicting future antimicrobial resistance using regression models +\item Getting properties for any microorganism (like Gram stain, species, genus or family) +\item Getting properties for any antibiotic (like name, EARS-Net code, ATC code, PubChem code, defined daily dose or trade name) +\item Plotting antimicrobial resistance +\item Applying EUCAST expert rules } } \section{Read more on our website!}{ @@ -36,11 +36,11 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// For suggestions, comments or questions, please contact us at: Matthijs S. Berends \cr -m.s.berends [at] umcg [dot] nl \cr +m.s.berends \link{at} umcg \link{dot} nl \cr Department of Medical Microbiology, University of Groningen \cr University Medical Center Groningen \cr Post Office Box 30001 \cr -9700 RB Groningen +9700 RB Groningen \cr The Netherlands If you have found a bug, please file a new issue at: \cr diff --git a/man/WHOCC.Rd b/man/WHOCC.Rd index c99c8ec14..3ec5c0bd1 100644 --- a/man/WHOCC.Rd +++ b/man/WHOCC.Rd @@ -9,13 +9,13 @@ All antimicrobial drugs and their official names, ATC codes, ATC groups and defi \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. -\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} +\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://www.whocc.no/copyright_disclaimer/.} } \section{Read more on our website!}{ diff --git a/man/WHONET.Rd b/man/WHONET.Rd index ef861befb..a320993bf 100644 --- a/man/WHONET.Rd +++ b/man/WHONET.Rd @@ -5,39 +5,39 @@ \alias{WHONET} \title{Data set with 500 isolates - WHONET example} \format{A \code{\link{data.frame}} with 500 observations and 53 variables: -\describe{ - \item{\code{Identification number}}{ID of the sample} - \item{\code{Specimen number}}{ID of the specimen} - \item{\code{Organism}}{Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link{as.mo}}.} - \item{\code{Country}}{Country of origin} - \item{\code{Laboratory}}{Name of laboratory} - \item{\code{Last name}}{Last name of patient} - \item{\code{First name}}{Initial of patient} - \item{\code{Sex}}{Gender of patient} - \item{\code{Age}}{Age of patient} - \item{\code{Age category}}{Age group, can also be looked up using \code{\link{age_groups}}} - \item{\code{Date of admission}}{Date of hospital admission} - \item{\code{Specimen date}}{Date when specimen was received at laboratory} - \item{\code{Specimen type}}{Specimen type or group} - \item{\code{Specimen type (Numeric)}}{Translation of \code{"Specimen type"}} - \item{\code{Reason}}{Reason of request with Differential Diagnosis} - \item{\code{Isolate number}}{ID of isolate} - \item{\code{Organism type}}{Type of microorganism, can also be looked up using \code{\link{mo_type}}} - \item{\code{Serotype}}{Serotype of microorganism} - \item{\code{Beta-lactamase}}{Microorganism produces beta-lactamase?} - \item{\code{ESBL}}{Microorganism produces extended spectrum beta-lactamase?} - \item{\code{Carbapenemase}}{Microorganism produces carbapenemase?} - \item{\code{MRSA screening test}}{Microorganism is possible MRSA?} - \item{\code{Inducible clindamycin resistance}}{Clindamycin can be induced?} - \item{\code{Comment}}{Other comments} - \item{\code{Date of data entry}}{Date this data was entered in WHONET} - \item{\code{AMP_ND10:CIP_EE}}{27 different antibiotics. You can lookup the abbreviatons in the \code{\link{antibiotics}} data set, or use e.g. \code{\link{ab_name}("AMP")} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link{as.rsi}}.} +\itemize{ +\item \verb{Identification number}\cr ID of the sample +\item \verb{Specimen number}\cr ID of the specimen +\item \code{Organism}\cr Name of the microorganism. Before analysis, you should transform this to a valid microbial class, using \code{\link[=as.mo]{as.mo()}}. +\item \code{Country}\cr Country of origin +\item \code{Laboratory}\cr Name of laboratory +\item \verb{Last name}\cr Last name of patient +\item \verb{First name}\cr Initial of patient +\item \code{Sex}\cr Gender of patient +\item \code{Age}\cr Age of patient +\item \verb{Age category}\cr Age group, can also be looked up using \code{\link[=age_groups]{age_groups()}} +\item \verb{Date of admission}\cr Date of hospital admission +\item \verb{Specimen date}\cr Date when specimen was received at laboratory +\item \verb{Specimen type}\cr Specimen type or group +\item \verb{Specimen type (Numeric)}\cr Translation of \code{"Specimen type"} +\item \code{Reason}\cr Reason of request with Differential Diagnosis +\item \verb{Isolate number}\cr ID of isolate +\item \verb{Organism type}\cr Type of microorganism, can also be looked up using \code{\link[=mo_type]{mo_type()}} +\item \code{Serotype}\cr Serotype of microorganism +\item \code{Beta-lactamase}\cr Microorganism produces beta-lactamase? +\item \code{ESBL}\cr Microorganism produces extended spectrum beta-lactamase? +\item \code{Carbapenemase}\cr Microorganism produces carbapenemase? +\item \verb{MRSA screening test}\cr Microorganism is possible MRSA? +\item \verb{Inducible clindamycin resistance}\cr Clindamycin can be induced? +\item \code{Comment}\cr Other comments +\item \verb{Date of data entry}\cr Date this data was entered in WHONET +\item \code{AMP_ND10:CIP_EE}\cr 27 different antibiotics. You can lookup the abbreviatons in the \link{antibiotics} data set, or use e.g. \code{\link[=ab_name]{ab_name("AMP")}} to get the official name immediately. Before analysis, you should transform this to a valid antibiotic class, using \code{\link[=as.rsi]{as.rsi()}}. }} \usage{ WHONET } \description{ -This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \code{\link{example_isolates}} data set. +This example data set has the exact same structure as an export file from WHONET. Such files can be used with this package, as this example data set shows. The data itself was based on our \link{example_isolates} data set. } \section{Read more on our website!}{ diff --git a/man/ab_property.Rd b/man/ab_property.Rd index af3bb84e9..eb366109d 100644 --- a/man/ab_property.Rd +++ b/man/ab_property.Rd @@ -38,30 +38,30 @@ ab_info(x, language = get_locale(), ...) ab_property(x, property = "name", language = get_locale(), ...) } \arguments{ -\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.ab}}} +\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link[=as.ab]{as.ab()}}} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \item{tolower}{logical to indicate whether the first character of every output should be transformed to a lower case character. This will lead to e.g. "polymyxin B" and not "polymyxin b".} -\item{...}{other parameters passed on to \code{\link{as.ab}}} +\item{...}{other parameters passed on to \code{\link[=as.ab]{as.ab()}}} \item{administration}{way of administration, either \code{"oral"} or \code{"iv"}} \item{units}{a logical to indicate whether the units instead of the DDDs itself must be returned, see Examples} -\item{property}{one of the column names of one of the \code{\link{antibiotics}} data set} +\item{property}{one of the column names of one of the \link{antibiotics} data set} } \value{ \itemize{ - \item{An \code{integer} in case of \code{ab_cid}} - \item{A named \code{list} in case of \code{ab_info} and multiple \code{ab_synonyms}/\code{ab_tradenames}} - \item{A \code{double} in case of \code{ab_ddd}} - \item{A \code{character} in all other cases} +\item An \code{\link{integer}} in case of \code{\link[=ab_cid]{ab_cid()}} +\item A named \code{\link{list}} in case of \code{\link[=ab_info]{ab_info()}} and multiple \code{\link[=ab_synonyms]{ab_synonyms()}}/\code{\link[=ab_tradenames]{ab_tradenames()}} +\item A \code{\link{double}} in case of \code{\link[=ab_ddd]{ab_ddd()}} +\item A \code{\link{character}} in all other cases } } \description{ -Use these functions to return a specific property of an antibiotic from the \code{\link{antibiotics}} data set. All input values will be evaluated internally with \code{\link{as.ab}}. +Use these functions to return a specific property of an antibiotic from the \link{antibiotics} data set. All input values will be evaluated internally with \code{\link[=as.ab]{as.ab()}}. } \details{ All output will be \link{translate}d where possible. @@ -112,5 +112,5 @@ ab_name(21319) # "Flucloxacillin" (using CID) ab_name("J01CF05") # "Flucloxacillin" (using ATC) } \seealso{ -\code{\link{antibiotics}} +\link{antibiotics} } diff --git a/man/age.Rd b/man/age.Rd index e68e56f3b..bf8ffa5d3 100644 --- a/man/age.Rd +++ b/man/age.Rd @@ -7,11 +7,11 @@ age(x, reference = Sys.Date(), exact = FALSE, na.rm = FALSE) } \arguments{ -\item{x}{date(s), will be coerced with \code{\link{as.POSIXlt}}} +\item{x}{date(s), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}}} -\item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link{as.POSIXlt}} and cannot be lower than \code{x}} +\item{reference}{reference date(s) (defaults to today), will be coerced with \code{\link[=as.POSIXlt]{as.POSIXlt()}} and cannot be lower than \code{x}} -\item{exact}{a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in a year of \code{reference} (either 365 or 366).} +\item{exact}{a logical to indicate whether age calculation should be exact, i.e. with decimals. It divides the number of days of \href{https://en.wikipedia.org/wiki/Year-to-date}{year-to-date} (YTD) of \code{x} by the number of days in the year of \code{reference} (either 365 or 366).} \item{na.rm}{a logical to indicate whether missing values should be removed} } @@ -37,5 +37,5 @@ df$age_exact <- age(df$birth_date, exact = TRUE) df } \seealso{ -To split ages into groups, use the \code{\link{age_groups}} function. +To split ages into groups, use the \code{\link[=age_groups]{age_groups()}} function. } diff --git a/man/age_groups.Rd b/man/age_groups.Rd index 8272e5780..793a3e310 100644 --- a/man/age_groups.Rd +++ b/man/age_groups.Rd @@ -7,7 +7,7 @@ age_groups(x, split_at = c(12, 25, 55, 75), na.rm = FALSE) } \arguments{ -\item{x}{age, e.g. calculated with \code{\link{age}}} +\item{x}{age, e.g. calculated with \code{\link[=age]{age()}}} \item{split_at}{values to split \code{x} at, defaults to age groups 0-11, 12-24, 25-54, 55-74 and 75+. See Details.} @@ -22,15 +22,15 @@ Split ages into age groups defined by the \code{split} parameter. This allows fo \details{ To split ages, the input can be: \itemize{ - \item{A numeric vector. A vector of e.g. \code{c(10, 20)} will split on 0-9, 10-19 and 20+. A value of only \code{50} will split on 0-49 and 50+. - The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+).} - \item{A character:} - \itemize{ - \item{\code{"children"} or \code{"kids"}, equivalent of: \code{c(0, 1, 2, 4, 6, 13, 18)}. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.} - \item{\code{"elderly"} or \code{"seniors"}, equivalent of: \code{c(65, 75, 85)}. This will split on 0-64, 65-74, 75-84, 85+.} - \item{\code{"fives"}, equivalent of: \code{1:20 * 5}. This will split on 0-4, 5-9, 10-14, ..., 90-94, 95-99, 100+.} - \item{\code{"tens"}, equivalent of: \code{1:10 * 10}. This will split on 0-9, 10-19, 20-29, ... 80-89, 90-99, 100+.} - } +\item A numeric vector. A vector of e.g. \code{c(10, 20)} will split on 0-9, 10-19 and 20+. A value of only \code{50} will split on 0-49 and 50+. +The default is to split on young children (0-11), youth (12-24), young adults (25-54), middle-aged adults (55-74) and elderly (75+). +\item A character: +\itemize{ +\item \code{"children"} or \code{"kids"}, equivalent of: \code{c(0, 1, 2, 4, 6, 13, 18)}. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+. +\item \code{"elderly"} or \code{"seniors"}, equivalent of: \code{c(65, 75, 85)}. This will split on 0-64, 65-74, 75-84, 85+. +\item \code{"fives"}, equivalent of: \code{1:20 * 5}. This will split on 0-4, 5-9, 10-14, ..., 90-94, 95-99, 100+. +\item \code{"tens"}, equivalent of: \code{1:10 * 10}. This will split on 0-9, 10-19, 20-29, ... 80-89, 90-99, 100+. +} } } \section{Read more on our website!}{ @@ -72,5 +72,5 @@ example_isolates \%>\% } } \seealso{ -To determine ages, based on one or more reference dates, use the \code{\link{age}} function. +To determine ages, based on one or more reference dates, use the \code{\link[=age]{age()}} function. } diff --git a/man/antibiotics.Rd b/man/antibiotics.Rd index 4a826fe43..4f1e12fad 100644 --- a/man/antibiotics.Rd +++ b/man/antibiotics.Rd @@ -5,34 +5,36 @@ \alias{antibiotics} \alias{antivirals} \title{Data sets with ~550 antimicrobials} -\format{\strong{For the \code{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:} -\describe{ - \item{\code{ab}}{Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available} - \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02}} - \item{\code{cid}}{Compound ID as found in PubChem} - \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} - \item{\code{group}}{A short and concise group name, based on WHONET and WHOCC definitions} - \item{\code{atc_group1}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"}} - \item{\code{atc_group2}}{Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"}} - \item{\code{abbr}}{List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST)} - \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} - \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} - \item{\code{oral_units}}{Units of \code{oral_ddd}} - \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} - \item{\code{iv_units}}{Units of \code{iv_ddd}} +\format{\subsection{For the \link{antibiotics} data set: a \code{\link{data.frame}} with 452 observations and 13 variables:}{ +\itemize{ +\item \code{ab}\cr Antibiotic ID as used in this package (like \code{AMC}), using the official EARS-Net (European Antimicrobial Resistance Surveillance Network) codes where available +\item \code{atc}\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC, like \code{J01CR02} +\item \code{cid}\cr Compound ID as found in PubChem +\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO +\item \code{group}\cr A short and concise group name, based on WHONET and WHOCC definitions +\item \code{atc_group1}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC, like \code{"Macrolides, lincosamides and streptogramins"} +\item \code{atc_group2}\cr Official chemical subgroup (4th level ATC code) as defined by the WHOCC, like \code{"Macrolides"} +\item \code{abbr}\cr List of abbreviations as used in many countries, also for antibiotic susceptibility testing (AST) +\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID +\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment +\item \code{oral_units}\cr Units of \code{oral_ddd} +\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment +\item \code{iv_units}\cr Units of \code{iv_ddd} +} } -\strong{For the \code{antivirals} data set: a \code{\link{data.frame}} with 102 observations and 9 variables:} -\describe{ - \item{\code{atc}}{ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC} - \item{\code{cid}}{Compound ID as found in PubChem} - \item{\code{name}}{Official name as used by WHONET/EARS-Net or the WHO} - \item{\code{atc_group}}{Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC} - \item{\code{synonyms}}{Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID} - \item{\code{oral_ddd}}{Defined Daily Dose (DDD), oral treatment} - \item{\code{oral_units}}{Units of \code{oral_ddd}} - \item{\code{iv_ddd}}{Defined Daily Dose (DDD), parenteral treatment} - \item{\code{iv_units}}{Units of \code{iv_ddd}} +\subsection{For the \link{antivirals} data set: a \code{\link{data.frame}} with 102 observations and 9 variables:}{ +\itemize{ +\item \code{atc}\cr ATC code (Anatomical Therapeutic Chemical) as defined by the WHOCC +\item \code{cid}\cr Compound ID as found in PubChem +\item \code{name}\cr Official name as used by WHONET/EARS-Net or the WHO +\item \code{atc_group}\cr Official pharmacological subgroup (3rd level ATC code) as defined by the WHOCC +\item \code{synonyms}\cr Synonyms (often trade names) of a drug, as found in PubChem based on their compound ID +\item \code{oral_ddd}\cr Defined Daily Dose (DDD), oral treatment +\item \code{oral_units}\cr Units of \code{oral_ddd} +\item \code{iv_ddd}\cr Defined Daily Dose (DDD), parenteral treatment +\item \code{iv_units}\cr Units of \code{iv_ddd} +} }} \source{ World Health Organization (WHO) Collaborating Centre for Drug Statistics Methodology (WHOCC): \url{https://www.whocc.no/atc_ddd_index/} @@ -47,7 +49,7 @@ antibiotics antivirals } \description{ -Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link{as.ab}} or one of the \code{\link{ab_property}} functions to retrieve values from the \code{antibiotics} data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. +Two data sets containing all antibiotics/antimycotics and antivirals. Use \code{\link[=as.ab]{as.ab()}} or one of the \code{\link[=ab_property]{ab_property()}} functions to retrieve values from the \link{antibiotics} data set. Three identifiers are included in this data set: an antibiotic ID (\code{ab}, primarily used in this package) as defined by WHONET/EARS-Net, an ATC code (\code{atc}) as defined by the WHO, and a Compound ID (\code{cid}) as found in PubChem. Other properties in this data set are derived from one or more of these codes. } \details{ Properties that are based on an ATC code are only available when an ATC is available. These properties are: \code{atc_group1}, \code{atc_group2}, \code{oral_ddd}, \code{oral_units}, \code{iv_ddd} and \code{iv_units}. @@ -57,13 +59,13 @@ Synonyms (i.e. trade names) are derived from the Compound ID (\code{cid}) and co \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. -\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} +\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://www.whocc.no/copyright_disclaimer/.} } \section{Read more on our website!}{ @@ -72,6 +74,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{microorganisms}} +\link{microorganisms} } \keyword{datasets} diff --git a/man/as.ab.Rd b/man/as.ab.Rd index bfdf2c8ae..8ae403a73 100644 --- a/man/as.ab.Rd +++ b/man/as.ab.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/ab.R \name{as.ab} \alias{as.ab} +\alias{ab} \alias{is.ab} \title{Transform to antibiotic ID} \usage{ @@ -15,15 +16,15 @@ is.ab(x) \item{...}{arguments passed on to internal functions} } \value{ -Character (vector) with class \code{"ab"}. Unknown values will return \code{NA}. +Character (vector) with class \code{\link{ab}}. Unknown values will return \code{NA}. } \description{ -Use this function to determine the antibiotic code of one or more antibiotics. The data set \code{\link{antibiotics}} will be searched for abbreviations, official names and synonyms (brand names). +Use this function to determine the antibiotic code of one or more antibiotics. The data set \link{antibiotics} will be searched for abbreviations, official names and synonyms (brand names). } \details{ -All entries in the \code{\link{antibiotics}} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. +All entries in the \link{antibiotics} data set have three different identifiers: a human readable EARS-Net code (column \code{ab}, used by ECDC and WHONET), an ATC code (column \code{atc}, used by WHO), and a CID code (column \code{cid}, Compound ID, used by PubChem). The data set contains more than 5,000 official brand names from many different countries, as found in PubChem. -Use the \code{\link{ab_property}} functions to get properties based on the returned antibiotic ID, see Examples. +Use the \code{\link[=ab_property]{ab_property()}} functions to get properties based on the returned antibiotic ID, see Examples. } \section{Source}{ @@ -37,13 +38,13 @@ European Commission Public Health PHARMACEUTICALS - COMMUNITY REGISTER: \url{htt \section{WHOCC}{ \if{html}{\figure{logo_who.png}{options: height=60px style=margin-bottom:5px} \cr} -This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). +This package contains \strong{all ~550 antibiotic, antimycotic and antiviral drugs} and their Anatomical Therapeutic Chemical (ATC) codes, ATC groups and Defined Daily Dose (DDD) from the World Health Organization Collaborating Centre for Drug Statistics Methodology (WHOCC, \url{https://www.whocc.no}) and the Pharmaceuticals Community Register of the European Commission (\url{http://ec.europa.eu/health/documents/community-register/html/atc.htm}). These have become the gold standard for international drug utilisation monitoring and research. The WHOCC is located in Oslo at the Norwegian Institute of Public Health and funded by the Norwegian government. The European Commission is the executive of the European Union and promotes its general interest. -\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package. See \url{https://www.whocc.no/copyright_disclaimer/}.} +\strong{NOTE: The WHOCC copyright does not allow use for commercial purposes, unlike any other info from this package.} See \url{https://www.whocc.no/copyright_disclaimer/.} } \section{Read more on our website!}{ @@ -70,5 +71,5 @@ ab_name("J01FA01") # "Erythromycin" ab_name("eryt") # "Erythromycin" } \seealso{ -\code{\link{antibiotics}} for the dataframe that is being used to determine ATCs. +\link{antibiotics} for the dataframe that is being used to determine ATCs. } diff --git a/man/as.disk.Rd b/man/as.disk.Rd index ccbc1d3a3..54c2f3953 100644 --- a/man/as.disk.Rd +++ b/man/as.disk.Rd @@ -16,13 +16,13 @@ is.disk(x) \item{na.rm}{a logical indicating whether missing values should be removed} } \value{ -Ordered integer factor with new class \code{disk} +Ordered integer factor with new class \code{\link{disk}} } \description{ -This transforms a vector to a new class \code{disk}, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99. +This transforms a vector to a new class \code{\link{disk}}, which is a growth zone size (around an antibiotic disk) in millimeters between 6 and 99. } \details{ -Interpret disk values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI. +Interpret disk values as RSI values with \code{\link[=as.rsi]{as.rsi()}}. It supports guidelines from EUCAST and CLSI. } \section{Read more on our website!}{ @@ -41,5 +41,5 @@ as.rsi(x = 12, guideline = "CLSI") } \seealso{ -\code{\link{as.rsi}} +\code{\link[=as.rsi]{as.rsi()}} } diff --git a/man/as.mic.Rd b/man/as.mic.Rd index 34e7acf5f..330574c0a 100755 --- a/man/as.mic.Rd +++ b/man/as.mic.Rd @@ -16,13 +16,13 @@ is.mic(x) \item{na.rm}{a logical indicating whether missing values should be removed} } \value{ -Ordered factor with new class \code{mic} +Ordered \code{\link{factor}} with new class \code{\link{mic}} } \description{ -This transforms a vector to a new class \code{mic}, which is an ordered factor with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning. +This transforms a vector to a new class \code{\link{mic}}, which is an ordered \code{\link{factor}} with valid MIC values as levels. Invalid MIC values will be translated as \code{NA} with a warning. } \details{ -Interpret MIC values as RSI values with \code{\link{as.rsi}}. It supports guidelines from EUCAST and CLSI. +To interpret MIC values as RSI values, use \code{\link[=as.rsi]{as.rsi()}} on MIC values. It supports guidelines from EUCAST and CLSI. } \section{Read more on our website!}{ @@ -51,5 +51,5 @@ barplot(mic_data) freq(mic_data) } \seealso{ -\code{\link{as.rsi}} +\code{\link[=as.rsi]{as.rsi()}} } diff --git a/man/as.mo.Rd b/man/as.mo.Rd index 85ffb00e5..9fe22a81d 100644 --- a/man/as.mo.Rd +++ b/man/as.mo.Rd @@ -10,8 +10,14 @@ \alias{clear_mo_history} \title{Transform to microorganism ID} \usage{ -as.mo(x, Becker = FALSE, Lancefield = FALSE, allow_uncertain = TRUE, - reference_df = get_mo_source(), ...) +as.mo( + x, + Becker = FALSE, + Lancefield = FALSE, + allow_uncertain = TRUE, + reference_df = get_mo_source(), + ... +) is.mo(x) @@ -24,33 +30,32 @@ mo_renamed() clear_mo_history(...) } \arguments{ -\item{x}{a character vector or a \code{data.frame} with one or two columns} +\item{x}{a character vector or a \code{\link{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,2]. Note that this does not include species that were newly named after these publications, like \emph{S. caeli}. +\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".} +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 [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. +\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.} +This excludes \emph{Enterococci} at default (who are in group D), use \code{Lancefield = "all"} to also categorise all \emph{Enterococci} as group D.} -\item{allow_uncertain}{a number between 0 (or "none") and 3 (or "all"), or TRUE (= 2) or FALSE (= 0) to indicate whether the input should be checked for less probable results, see Details} +\item{allow_uncertain}{a number between \code{0} (or \code{"none"}) and \code{3} (or \code{"all"}), or \code{TRUE} (= \code{2}) or \code{FALSE} (= \code{0}) to indicate whether the input should be checked for less probable results, please see \emph{Details}} -\item{reference_df}{a \code{data.frame} to use for extra reference when translating \code{x} to a valid \code{mo}. See \code{\link{set_mo_source}} and \code{\link{get_mo_source}} to automate the usage of your own codes (e.g. used in your analysis or organisation).} +\item{reference_df}{a \code{\link{data.frame}} to use for extra reference when translating \code{x} to a valid \code{\link{mo}}. See \code{\link[=set_mo_source]{set_mo_source()}} and \code{\link[=get_mo_source]{get_mo_source()}} to automate the usage of your own codes (e.g. used in your analysis or organisation).} \item{...}{other parameters passed on to functions} } \value{ -Character (vector) with class \code{"mo"} +A \code{\link{character}} vector with class \code{\link{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. +Use this function to determine a valid microorganism ID (\code{\link{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 \emph{Examples}. } \details{ -\strong{General info} \cr -A microorganism ID from this package (class: \code{mo}) typically looks like these examples:\cr -\preformatted{ - Code Full name +\subsection{General info}{ + +A microorganism ID from this package (class: \code{\link{mo}}) typically looks like these examples:\preformatted{ Code Full name --------------- -------------------------------------- B_KLBSL Klebsiella B_KLBSL_PNMN Klebsiella pneumoniae @@ -66,71 +71,75 @@ A microorganism ID from this package (class: \code{mo}) typically looks like the 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. +Use the \code{\link[=mo_property]{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{\link{microorganisms}}). +The algorithm uses data from the Catalogue of Life (see below) and from one other source (see \link{microorganisms}). -The \code{as.mo()} function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order: -\itemize{ - \item{Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones;} - \item{Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others;} - \item{Breakdown of input values to identify possible matches.} +The \code{\link[=as.mo]{as.mo()}} function uses several coercion rules for fast and logical results. It assesses the input matching criteria in the following order: +\enumerate{ +\item Human pathogenic prevalence: the function starts with more prevalent microorganisms, followed by less prevalent ones; +\item Taxonomic kingdom: the function starts with determining Bacteria, then Fungi, then Protozoa, then others; +\item Breakdown of input values to identify possible matches. } -This will lead to the effect that e.g. \code{"E. coli"} (a highly prevalent microorganism found in humans) will return the microbial ID of \emph{Escherichia coli} and not \emph{Entamoeba coli} (a less prevalent microorganism in humans), although the latter would alphabetically come first. +This will lead to the effect that e.g. \code{"E. coli"} (a highly prevalent microorganism found in humans) will return the microbial ID of \emph{Escherichia coli} and not \emph{Entamoeba coli} (a less prevalent microorganism in humans), although the latter would alphabetically come first. +} -\strong{Coping with uncertain results} \cr -In addition, the \code{as.mo()} function can differentiate four levels of uncertainty to guess valid results: +\subsection{Coping with uncertain results}{ +In addition, the \code{\link[=as.mo]{as.mo()}} function can differentiate four levels of uncertainty to guess valid results: \itemize{ - \item{Uncertainty level 0: no additional rules are applied;} - \item{Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors;} - \item{Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements;} - \item{Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name.} +\item Uncertainty level 0: no additional rules are applied; +\item Uncertainty level 1: allow previously accepted (but now invalid) taxonomic names and minor spelling errors; +\item Uncertainty level 2: allow all of level 1, strip values between brackets, inverse the words of the input, strip off text elements from the end keeping at least two elements; +\item Uncertainty level 3: allow all of level 1 and 2, strip off text elements from the end, allow any part of a taxonomic name. } This leads to e.g.: - \itemize{ - \item{\code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPT_GRPB}) needs review.} - \item{\code{"S. aureus - please mind: MRSA"}. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result \emph{Staphylococcus aureus} (\code{B_STPHY_AURS}) needs review.} - \item{\code{"Fluoroquinolone-resistant Neisseria gonorrhoeae"}. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result \emph{Neisseria gonorrhoeae} (\code{B_NESSR_GNRR}) needs review.} +\item \code{"Streptococcus group B (known as S. agalactiae)"}. The text between brackets will be removed and a warning will be thrown that the result \emph{Streptococcus group B} (\code{B_STRPT_GRPB}) needs review. +\item \code{"S. aureus - please mind: MRSA"}. The last word will be stripped, after which the function will try to find a match. If it does not, the second last word will be stripped, etc. Again, a warning will be thrown that the result \emph{Staphylococcus aureus} (\code{B_STPHY_AURS}) needs review. +\item \code{"Fluoroquinolone-resistant Neisseria gonorrhoeae"}. The first word will be stripped, after which the function will try to find a match. A warning will be thrown that the result \emph{Neisseria gonorrhoeae} (\code{B_NESSR_GNRR}) needs review. } The level of uncertainty can be set using the argument \code{allow_uncertain}. The default is \code{allow_uncertain = TRUE}, which is equal to uncertainty level 2. Using \code{allow_uncertain = FALSE} is equal to uncertainty level 0 and will skip all rules. You can also use e.g. \code{as.mo(..., allow_uncertain = 1)} to only allow up to level 1 uncertainty. -There are three helper functions that can be run after then \code{as.mo()} function: +There are three helper functions that can be run after then \code{\link[=as.mo]{as.mo()}} function: \itemize{ - \item{Use \code{mo_uncertainties()} to get a \code{data.frame} with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \code{(n - 0.5 * L) / n}, where \emph{n} is the number of characters of the returned full name of the microorganism, and \emph{L} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance} between that full name and the user input.} - \item{Use \code{mo_failures()} to get a vector with all values that could not be coerced to a valid value.} - \item{Use \code{mo_renamed()} to get a \code{data.frame} with all values that could be coerced based on an old, previously accepted taxonomic name.} -} +\item Use \code{\link[=mo_uncertainties]{mo_uncertainties()}} to get a \code{\link{data.frame}} with all values that were coerced to a valid value, but with uncertainty. The output contains a score, that is calculated as \eqn{(n - 0.5 * L) / n}, where \emph{n} is the number of characters of the returned full name of the microorganism, and \emph{L} is the \href{https://en.wikipedia.org/wiki/Levenshtein_distance}{Levenshtein distance} between that full name and the user input. +\item Use \code{\link[=mo_failures]{mo_failures()}} to get a \code{\link{vector}} with all values that could not be coerced to a valid value. +\item Use \code{\link[=mo_renamed]{mo_renamed()}} to get a \code{\link{data.frame}} with all values that could be coerced based on an old, previously accepted taxonomic name. +} +} -\strong{Microbial prevalence of pathogens in humans} \cr -The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \code{\link{microorganisms}} and \code{\link{microorganisms.old}} data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. +\subsection{Microbial prevalence of pathogens in humans}{ -Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacteriales. +The intelligent rules consider the prevalence of microorganisms in humans grouped into three groups, which is available as the \code{prevalence} columns in the \link{microorganisms} and \link{microorganisms.old} data sets. The grouping into prevalence groups is based on experience from several microbiological laboratories in the Netherlands in conjunction with international reports on pathogen prevalence. -Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Aspergillus}, \emph{Bacteroides}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Chryseobacterium}, \emph{Cryptococcus}, \emph{Elisabethkingia}, \emph{Flavobacterium}, \emph{Fusobacterium}, \emph{Giardia}, \emph{Leptotrichia}, \emph{Mycoplasma}, \emph{Prevotella}, \emph{Rhodotorula}, \emph{Treponema}, \emph{Trichophyton} or \emph{Ureaplasma}. +Group 1 (most prevalent microorganisms) consists of all microorganisms where the taxonomic class is Gammaproteobacteria or where the taxonomic genus is \emph{Enterococcus}, \emph{Staphylococcus} or \emph{Streptococcus}. This group consequently contains all common Gram-negative bacteria, such as \emph{Pseudomonas} and \emph{Legionella} and all species within the order Enterobacteriales. + +Group 2 consists of all microorganisms where the taxonomic phylum is Proteobacteria, Firmicutes, Actinobacteria or Sarcomastigophora, or where the taxonomic genus is \emph{Aspergillus}, \emph{Bacteroides}, \emph{Candida}, \emph{Capnocytophaga}, \emph{Chryseobacterium}, \emph{Cryptococcus}, \emph{Elisabethkingia}, \emph{Flavobacterium}, \emph{Fusobacterium}, \emph{Giardia}, \emph{Leptotrichia}, \emph{Mycoplasma}, \emph{Prevotella}, \emph{Rhodotorula}, \emph{Treponema}, \emph{Trichophyton} or \emph{Ureaplasma}. Group 3 (least prevalent microorganisms) consists of all other microorganisms. +} -\strong{Self-learning algorithm} \cr -The \code{as.mo()} function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use \code{clear_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. +\subsection{Self-learning algorithm}{ + +The \code{\link[=as.mo]{as.mo()}} function gains experience from previously determined microorganism IDs and learns from it. This drastically improves both speed and reliability. Use \code{\link[=clear_mo_history]{clear_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. This resets with every update of this \code{AMR} package since results are saved to your local package library folder. } +} \section{Source}{ -[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] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028} - -[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{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). +\enumerate{ +\item 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} +\item Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028} +\item 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} +\item Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}). +} } \section{Catalogue of Life}{ @@ -138,7 +147,7 @@ This resets with every update of this \code{AMR} package since results are saved \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Read more on our website!}{ @@ -203,8 +212,9 @@ df <- df \%>\% } } \seealso{ -\code{\link{microorganisms}} for the \code{data.frame} that is being used to determine ID's. \cr -The \code{\link{mo_property}} functions (like \code{\link{mo_genus}}, \code{\link{mo_gramstain}}) to get properties based on the returned code. +\link{microorganisms} for the \code{\link{data.frame}} that is being used to determine ID's. + +The \code{\link[=mo_property]{mo_property()}} functions (like \code{\link[=mo_genus]{mo_genus()}}, \code{\link[=mo_gramstain]{mo_gramstain()}}) to get properties based on the returned code. } \keyword{Becker} \keyword{Lancefield} diff --git a/man/as.rsi.Rd b/man/as.rsi.Rd index b19246c33..85f30563f 100755 --- a/man/as.rsi.Rd +++ b/man/as.rsi.Rd @@ -16,54 +16,52 @@ as.rsi(x, ...) \method{as.rsi}{disk}(x, mo, ab, guideline = "EUCAST", ...) -\method{as.rsi}{data.frame}(x, col_mo = NULL, guideline = "EUCAST", - ...) +\method{as.rsi}{data.frame}(x, col_mo = NULL, guideline = "EUCAST", ...) is.rsi(x) is.rsi.eligible(x, threshold = 0.05) } \arguments{ -\item{x}{vector of values (for class \code{mic}: an MIC value in mg/L, for class \code{disk}: a disk diffusion radius in millimeters)} +\item{x}{vector of values (for class \code{\link{mic}}: an MIC value in mg/L, for class \code{\link{disk}}: a disk diffusion radius in millimeters)} \item{...}{parameters passed on to methods} -\item{mo}{a microorganism code, generated with \code{\link{as.mo}}} +\item{mo}{a microorganism code, generated with \code{\link[=as.mo]{as.mo()}}} -\item{ab}{an antimicrobial code, generated with \code{\link{as.ab}}} +\item{ab}{an antimicrobial code, generated with \code{\link[=as.ab]{as.ab()}}} \item{guideline}{defaults to the latest included EUCAST guideline, run \code{unique(AMR::rsi_translation$guideline)} for all options} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} -\item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, see Examples} +\item{threshold}{maximum fraction of invalid antimicrobial interpretations of \code{x}, please see \emph{Examples}} } \value{ -Ordered factor with new class \code{rsi} +Ordered factor with new class \code{\link{rsi}} } \description{ -Interpret MIC values according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class \code{rsi}, which is an ordered factor with levels \code{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning. +Interpret MIC values and disk diffusion diameters according to EUCAST or CLSI, or clean up existing RSI values. This transforms the input to a new class \code{\link{rsi}}, which is an ordered factor with levels \verb{S < I < R}. Invalid antimicrobial interpretations will be translated as \code{NA} with a warning. } \details{ Run \code{unique(AMR::rsi_translation$guideline)} for a list of all supported guidelines. -After using \code{as.rsi}, you can use \code{\link{eucast_rules}} to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism. +After using \code{\link[=as.rsi]{as.rsi()}}, you can use \code{\link[=eucast_rules]{eucast_rules()}} to (1) apply inferred susceptibility and resistance based on results of other antimicrobials and (2) apply intrinsic resistance based on taxonomic properties of a microorganism. -The function \code{is.rsi.eligible} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter. +The function \code{\link[=is.rsi.eligible]{is.rsi.eligible()}} returns \code{TRUE} when a columns contains at most 5\% invalid antimicrobial interpretations (not S and/or I and/or R), and \code{FALSE} otherwise. The threshold of 5\% can be set with the \code{threshold} parameter. } \section{Interpretation of S, I and R}{ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". - \itemize{ - \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} - \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} - \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.} +\item \strong{S} - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent. +\item \strong{I} - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. +\item \strong{R} - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure. } Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } \section{Read more on our website!}{ @@ -109,5 +107,5 @@ is.rsi.eligible(WHONET$`First name`) # fails, >80\% is invalid is.rsi.eligible(WHONET$`First name`, threshold = 0.99) # succeeds } \seealso{ -\code{\link{as.mic}} +\code{\link[=as.mic]{as.mic()}} } diff --git a/man/atc_online.Rd b/man/atc_online.Rd index b1af92937..4379cf48d 100644 --- a/man/atc_online.Rd +++ b/man/atc_online.Rd @@ -9,8 +9,12 @@ \url{https://www.whocc.no/atc_ddd_alterations__cumulative/ddd_alterations/abbrevations/} } \usage{ -atc_online_property(atc_code, property, administration = "O", - url = "https://www.whocc.no/atc_ddd_index/?code=\%s&showdescription=no") +atc_online_property( + atc_code, + property, + administration = "O", + url = "https://www.whocc.no/atc_ddd_index/?code=\%s&showdescription=no" +) atc_online_groups(atc_code, ...) @@ -23,38 +27,40 @@ atc_online_ddd(atc_code, ...) \item{administration}{type of administration when using \code{property = "Adm.R"}, see Details} -\item{url}{url of website of the WHO. The sign \code{\%s} can be used as a placeholder for ATC codes.} +\item{url}{url of website of the WHO. The sign \verb{\%s} can be used as a placeholder for ATC codes.} \item{...}{parameters to pass on to \code{atc_property}} } \description{ -Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. \cr \strong{This function requires an internet connection.} +Gets data from the WHO to determine properties of an ATC (e.g. an antibiotic) like name, defined daily dose (DDD) or standard unit. + +\strong{This function requires an internet connection.} } \details{ Options for parameter \code{administration}: \itemize{ - \item{\code{"Implant"}}{ = Implant} - \item{\code{"Inhal"}}{ = Inhalation} - \item{\code{"Instill"}}{ = Instillation} - \item{\code{"N"}}{ = nasal} - \item{\code{"O"}}{ = oral} - \item{\code{"P"}}{ = parenteral} - \item{\code{"R"}}{ = rectal} - \item{\code{"SL"}}{ = sublingual/buccal} - \item{\code{"TD"}}{ = transdermal} - \item{\code{"V"}}{ = vaginal} +\item \code{"Implant"} = Implant +\item \code{"Inhal"} = Inhalation +\item \code{"Instill"} = Instillation +\item \code{"N"} = nasal +\item \code{"O"} = oral +\item \code{"P"} = parenteral +\item \code{"R"} = rectal +\item \code{"SL"} = sublingual/buccal +\item \code{"TD"} = transdermal +\item \code{"V"} = vaginal } Abbreviations of return values when using \code{property = "U"} (unit): \itemize{ - \item{\code{"g"}}{ = gram} - \item{\code{"mg"}}{ = milligram} - \item{\code{"mcg"}}{ = microgram} - \item{\code{"U"}}{ = unit} - \item{\code{"TU"}}{ = thousand units} - \item{\code{"MU"}}{ = million units} - \item{\code{"mmol"}}{ = millimole} - \item{\code{"ml"}}{ = milliliter (e.g. eyedrops)} +\item \code{"g"} = gram +\item \code{"mg"} = milligram +\item `"mcg"`` = microgram +\item \code{"U"} = unit +\item \code{"TU"} = thousand units +\item \code{"MU"} = million units +\item \code{"mmol"} = millimole +\item \code{"ml"} = milliliter (e.g. eyedrops) } } \section{Read more on our website!}{ diff --git a/man/availability.Rd b/man/availability.Rd index 38202d10b..74bd416e1 100644 --- a/man/availability.Rd +++ b/man/availability.Rd @@ -7,18 +7,18 @@ availability(tbl, width = NULL) } \arguments{ -\item{tbl}{a \code{data.frame} or \code{list}} +\item{tbl}{a \code{\link{data.frame}} or \code{\link{list}}} \item{width}{number of characters to present the visual availability, defaults to filling the width of the console} } \value{ -\code{data.frame} with column names of \code{tbl} as row names +\code{\link{data.frame}} with column names of \code{tbl} as row names } \description{ -Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. \code{\link{resistance}}. +Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. \code{\link[=resistance]{resistance()}}. } \details{ -The function returns a \code{data.frame} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link{resistance}}. +The function returns a \code{\link{data.frame}} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link[=resistance]{resistance()}}. } \section{Read more on our website!}{ diff --git a/man/bug_drug_combinations.Rd b/man/bug_drug_combinations.Rd index 64c83ebbe..30501d1b8 100644 --- a/man/bug_drug_combinations.Rd +++ b/man/bug_drug_combinations.Rd @@ -10,25 +10,32 @@ \usage{ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) -\method{format}{bug_drug_combinations}(x, - translate_ab = "name (ab, atc)", language = get_locale(), - minimum = 30, combine_SI = TRUE, combine_IR = FALSE, - add_ab_group = TRUE, remove_intrinsic_resistant = FALSE, - decimal.mark = getOption("OutDec"), big.mark = ifelse(decimal.mark == - ",", ".", ","), ...) +\method{format}{bug_drug_combinations}( + x, + translate_ab = "name (ab, atc)", + language = get_locale(), + minimum = 30, + combine_SI = TRUE, + combine_IR = FALSE, + add_ab_group = TRUE, + remove_intrinsic_resistant = FALSE, + decimal.mark = getOption("OutDec"), + big.mark = ifelse(decimal.mark == ",", ".", ","), + ... +) } \arguments{ \item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} -\item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link{mo_shortname}}} +\item{FUN}{the function to call on the \code{mo} column to transform the microorganism IDs, defaults to \code{\link[=mo_shortname]{mo_shortname()}}} \item{...}{arguments passed on to \code{FUN}} -\item{translate_ab}{a character of length 1 containing column names of the \code{\link{antibiotics}} data set} +\item{translate_ab}{a character of length 1 containing column names of the \link{antibiotics} data set} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \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.} @@ -48,13 +55,13 @@ bug_drug_combinations(x, col_mo = NULL, FUN = mo_shortname, ...) decimal point.} } \value{ -The function \code{bug_drug_combinations} returns a \code{data.frame} with columns "mo", "ab", "S", "I", "R" and "total". +The function \code{\link[=bug_drug_combinations]{bug_drug_combinations()}} returns a \code{\link{data.frame}} with columns "mo", "ab", "S", "I", "R" and "total". } \description{ -Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{format} on the result to prettify it to a publicable/printable format, see Examples. +Determine antimicrobial resistance (AMR) of all bug-drug combinations in your data set where at least 30 (default) isolates are available per species. Use \code{\link[=format]{format()}} on the result to prettify it to a publicable/printable format, see Examples. } \details{ -The function \code{format} calculates the resistance per bug-drug combination. Use \code{combine_IR = FALSE} (default) to test R vs. S+I and \code{combine_IR = TRUE} to test R+I vs. S. +The function \code{\link[=format]{format()}} calculates the resistance per bug-drug combination. Use \code{combine_IR = FALSE} (default) to test R vs. S+I and \code{combine_IR = TRUE} to test R+I vs. S. The language of the output can be overwritten with \code{options(AMR_locale)}, please see \link{translate}. } diff --git a/man/catalogue_of_life.Rd b/man/catalogue_of_life.Rd index fa8bf2749..50cf7ae01 100644 --- a/man/catalogue_of_life.Rd +++ b/man/catalogue_of_life.Rd @@ -11,19 +11,19 @@ This package contains the complete taxonomic tree of almost all microorganisms f \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Included taxa}{ Included are: \itemize{ - \item{All ~61,000 (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa} - \item{All ~8,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}).} - \item{All ~150 (sub)species from ~100 other relevant genera from the kingdom of Animalia (like \emph{Strongyloides} and \emph{Taenia})} - \item{All ~23,000 previously accepted names of all included (sub)species (these were taxonomically renamed)} - \item{The complete taxonomic tree of all included (sub)species: from kingdom to subspecies} - \item{The responsible author(s) and year of scientific publication} +\item All ~61,000 (sub)species from the kingdoms of Archaea, Bacteria, Chromista and Protozoa +\item All ~8,500 (sub)species from these orders of the kingdom of Fungi: Eurotiales, Microascales, Mucorales, Onygenales, Pneumocystales, Saccharomycetales, Schizosaccharomycetales and Tremellales. The kingdom of Fungi is a very large taxon with almost 300,000 different (sub)species, of which most are not microbial (but rather macroscopic, like mushrooms). Because of this, not all fungi fit the scope of this package and including everything would tremendously slow down our algorithms too. By only including the aforementioned taxonomic orders, the most relevant fungi are covered (like all species of \emph{Aspergillus}, \emph{Candida}, \emph{Cryptococcus}, \emph{Histplasma}, \emph{Pneumocystis}, \emph{Saccharomyces} and \emph{Trichophyton}). +\item All ~150 (sub)species from ~100 other relevant genera from the kingdom of Animalia (like \emph{Strongyloides} and \emph{Taenia}) +\item All ~23,000 previously accepted names of all included (sub)species (these were taxonomically renamed) +\item The complete taxonomic tree of all included (sub)species: from kingdom to subspecies +\item The responsible author(s) and year of scientific publication } The Catalogue of Life (\url{http://www.catalogueoflife.org}) is the most comprehensive and authoritative global index of species currently available. It holds essential information on the names, relationships and distributions of over 1.9 million species. The Catalogue of Life is used to support the major biodiversity and conservation information services such as the Global Biodiversity Information Facility (GBIF), Encyclopedia of Life (EoL) and the International Union for Conservation of Nature Red List. It is recognised by the Convention on Biological Diversity as a significant component of the Global Taxonomy Initiative and a contribution to Target 1 of the Global Strategy for Plant Conservation. @@ -60,13 +60,13 @@ mo_gramstain("E. coli") # based on kingdom and phylum, see ?mo_gramstain mo_ref("E. coli") # [1] "Castellani et al., 1919" -# Do not get mistaken - the package only includes microorganisms +# Do not get mistaken - this package is about microorganisms mo_kingdom("C. elegans") # [1] "Bacteria" # Bacteria?! mo_name("C. elegans") # [1] "Chroococcus limneticus elegans" # Because a microorganism was found } \seealso{ -Data set \code{\link{microorganisms}} for the actual data. \cr -Function \code{\link{as.mo}()} to use the data for intelligent determination of microorganisms. +Data set \link{microorganisms} for the actual data. \cr +Function \code{\link[=as.mo]{as.mo()}} to use the data for intelligent determination of microorganisms. } diff --git a/man/catalogue_of_life_version.Rd b/man/catalogue_of_life_version.Rd index a24d58064..55fbdc758 100644 --- a/man/catalogue_of_life_version.Rd +++ b/man/catalogue_of_life_version.Rd @@ -7,20 +7,20 @@ catalogue_of_life_version() } \value{ -a \code{list}, which prints in pretty format +a \code{\link{list}}, which prints in pretty format } \description{ This function returns information about the included data from the Catalogue of Life. } \details{ -For DSMZ, see \code{?microorganisms}. +For DSMZ, see \link{microorganisms}. } \section{Catalogue of Life}{ \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Read more on our website!}{ @@ -34,5 +34,5 @@ microorganisms \%>\% freq(kingdom) microorganisms \%>\% group_by(kingdom) \%>\% freq(phylum, nmax = NULL) } \seealso{ -\code{\link{microorganisms}} +\link{microorganisms} } diff --git a/man/count.Rd b/man/count.Rd index d5f82fa71..1ad0d81a1 100644 --- a/man/count.Rd +++ b/man/count.Rd @@ -12,7 +12,7 @@ \alias{count_all} \alias{n_rsi} \alias{count_df} -\title{Count isolates} +\title{Count available isolates} \usage{ count_resistant(..., only_all_tested = FALSE) @@ -32,62 +32,63 @@ count_all(..., only_all_tested = FALSE) n_rsi(..., only_all_tested = FALSE) -count_df(data, translate_ab = "name", language = get_locale(), - combine_SI = TRUE, combine_IR = FALSE) +count_df( + data, + translate_ab = "name", + language = get_locale(), + combine_SI = TRUE, + combine_IR = FALSE +) } \arguments{ -\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link{as.rsi}} if needed.} +\item{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.rsi]{as.rsi()}} if needed.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}) a logical to indicate that isolates must be tested for all antibiotics, see section \emph{Combination therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a logical to indicate that isolates must be tested for all antibiotics, see section \emph{Combination therapy} below} -\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})} +\item{data}{a \code{\link{data.frame}} containing columns with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})} -\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}} +\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} \item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} } \value{ -Integer +An \code{\link{integer}} } \description{ -These functions can be used to count resistant/susceptible microbial isolates. 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 count resistant/susceptible microbial isolates. All functions support quasiquotation with pipes, can be used in \code{\link[=summarise]{summarise()}} and support grouped variables, see \emph{Examples}. -\code{count_resistant()} should be used to count resistant isolates, \code{count_susceptible()} should be used to count susceptible isolates.\cr +\code{\link[=count_resistant]{count_resistant()}} should be used to count resistant isolates, \code{\link[=count_susceptible]{count_susceptible()}} should be used to count susceptible isolates. } \details{ -These functions are meant to count isolates. Use the \code{\link{resistance}}/\code{\link{susceptibility}} functions to calculate microbial resistance/susceptibility. +These functions are meant to count isolates. Use the \code{\link[=resistance]{resistance()}}/\code{\link[=susceptibility]{susceptibility()}} functions to calculate microbial resistance/susceptibility. -The function \code{count_resistant()} is equal to the function \code{count_R()}. The function \code{count_susceptible()} is equal to the function \code{count_SI()}. +The function \code{\link[=count_resistant]{count_resistant()}} is equal to the function \code{\link[=count_R]{count_R()}}. The function \code{\link[=count_susceptible]{count_susceptible()}} is equal to the function \code{\link[=count_SI]{count_SI()}}. -The function \code{n_rsi()} is an alias of \code{count_all()}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link{n_distinct}()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. +The function \code{\link[=n_rsi]{n_rsi()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{\link[=n_distinct]{n_distinct()}}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. -The function \code{count_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and counts the number of S's, I's and R's. The function \code{rsi_df()} works exactly like \code{count_df()}, but adds the percentage of S, I and R. +The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) and counts the number of S's, I's and R's. The function \code{\link[=rsi_df]{rsi_df()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. } \section{Interpretation of S, I and R}{ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". - \itemize{ - \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} - \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} - \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.} +\item \strong{S} - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent. +\item \strong{I} - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. +\item \strong{R} - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure. } Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } \section{Combination therapy}{ -When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{susceptibility} works to calculate the \%SI: - -\preformatted{ --------------------------------------------------------------------- +When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE ----------------------- ----------------------- Drug A Drug B include as include as include as include as @@ -105,14 +106,11 @@ When using more than one variable for \code{...} (= combination therapy)), use \ -------------------------------------------------------------------- } -Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that: -\preformatted{ - count_S() + count_I() + count_R() = count_all() +Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:\preformatted{ count_S() + count_I() + count_R() = count_all() proportion_S() + proportion_I() + proportion_R() = 1 } -and that, in combination therapies, for \code{only_all_tested = FALSE} applies that: -\preformatted{ - count_S() + count_I() + count_R() >= count_all() + +and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:\preformatted{ count_S() + count_I() + count_R() >= count_all() proportion_S() + proportion_I() + proportion_R() >= 1 } @@ -184,5 +182,5 @@ example_isolates \%>\% } \seealso{ -\code{\link{proportion}_*} to calculate microbial resistance and susceptibility. +\code{\link[=proportion]{proportion_*}} to calculate microbial resistance and susceptibility. } diff --git a/man/eucast_rules.Rd b/man/eucast_rules.Rd index 764eed66d..b9f5697e6 100644 --- a/man/eucast_rules.Rd +++ b/man/eucast_rules.Rd @@ -6,29 +6,29 @@ \title{EUCAST rules} \source{ \itemize{ - \item{ - EUCAST Expert Rules. Version 2.0, 2012. \cr - Leclercq et al. \strong{EUCAST expert rules in antimicrobial susceptibility testing.} \emph{Clin Microbiol Infect.} 2013;19(2):141-60. \cr - \url{https://doi.org/10.1111/j.1469-0691.2011.03703.x} - } - \item{ - EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr - \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} - } - \item{ - EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr - \url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx} - } - } +\item EUCAST Expert Rules. Version 2.0, 2012. \cr +Leclercq et al. \strong{EUCAST expert rules in antimicrobial susceptibility testing.} \emph{Clin Microbiol Infect.} 2013;19(2):141-60. \cr +\url{https://doi.org/10.1111/j.1469-0691.2011.03703.x} +\item EUCAST Expert Rules, Intrinsic Resistance and Exceptional Phenotypes Tables. Version 3.1, 2016. \cr +\url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf} +\item EUCAST Breakpoint tables for interpretation of MICs and zone diameters. Version 9.0, 2019. \cr +\url{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Breakpoint_tables/v_9.0_Breakpoint_Tables.xlsx} +} } \usage{ -eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints", - "expert", "other", "all"), verbose = FALSE, ...) +eucast_rules( + x, + col_mo = NULL, + info = TRUE, + rules = c("breakpoints", "expert", "other", "all"), + verbose = FALSE, + ... +) } \arguments{ \item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} \item{info}{print progress} @@ -36,120 +36,120 @@ eucast_rules(x, col_mo = NULL, info = TRUE, rules = c("breakpoints", \item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not apply rules to the data, but instead returns a data set in logbook form with extensive info about which rows and columns would be effected and in which way.} -\item{...}{column name of an antibiotic, see section Antibiotics} +\item{...}{column name of an antibiotic, please see section \emph{Antibiotics} below} } \value{ -The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{data.frame} with all original and new values of the affected bug-drug combinations. +The input of \code{x}, possibly with edited values of antibiotics. Or, if \code{verbose = TRUE}, a \code{\link{data.frame}} with all original and new values of the affected bug-drug combinations. } \description{ -Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables. +Apply susceptibility rules as defined by the European Committee on Antimicrobial Susceptibility Testing (EUCAST, \url{http://eucast.org}), see \emph{Source}. This includes (1) expert rules, (2) intrinsic resistance and (3) inferred resistance as defined in their breakpoint tables. To improve the interpretation of the antibiogram before EUCAST rules are applied, some non-EUCAST rules are applied at default, see Details. } \details{ -\strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link{as.rsi}} for that. \cr +\strong{Note:} This function does not translate MIC values to RSI values. Use \code{\link[=as.rsi]{as.rsi()}} for that. \cr \strong{Note:} When ampicillin (AMP, J01CA01) is not available but amoxicillin (AMX, J01CA04) is, the latter will be used for all rules where there is a dependency on ampicillin. These drugs are interchangeable when it comes to expression of antimicrobial resistance. Before further processing, some non-EUCAST rules are applied to improve the efficacy of the EUCAST rules. These non-EUCAST rules, that are applied to all isolates, are: \itemize{ - \item{Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable;} - \item{Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable;} - \item{Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R;} - \item{Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R;} - \item{Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R;} - \item{Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S;} - \item{Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S;} - \item{Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S.} -} +\item Inherit amoxicillin (AMX) from ampicillin (AMP), where amoxicillin (AMX) is unavailable; +\item Inherit ampicillin (AMP) from amoxicillin (AMX), where ampicillin (AMP) is unavailable; +\item Set amoxicillin (AMX) = R where amoxicillin/clavulanic acid (AMC) = R; +\item Set piperacillin (PIP) = R where piperacillin/tazobactam (TZP) = R; +\item Set trimethoprim (TMP) = R where trimethoprim/sulfamethoxazole (SXT) = R; +\item Set amoxicillin/clavulanic acid (AMC) = S where amoxicillin (AMX) = S; +\item Set piperacillin/tazobactam (TZP) = S where piperacillin (PIP) = S; +\item Set trimethoprim/sulfamethoxazole (SXT) = S where trimethoprim (TMP) = S. To \emph{not} use these rules, please use \code{eucast_rules(..., rules = c("breakpoints", "expert"))}. +} The file containing all EUCAST rules is located here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/eucast_rules.tsv}. } \section{Antibiotics}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are used for the functions \code{\link{eucast_rules}} and \code{\link{mdro}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: +The following antibiotics are used for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: - \strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), - \strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), - \strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}), - \strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}), - \strong{SAM}: ampicillin/sulbactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR01}{J01CR01}), - \strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}), - \strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}), - \strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}), - \strong{CAP}: capreomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB30}{J04AB30}), - \strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}), - \strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}), - \strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}), - \strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}), - \strong{CTT}: cefotetan (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC05}{J01DC05}), - \strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}), - \strong{CPT}: ceftaroline (\href{https://www.whocc.no/atc_ddd_index/?code=J01DI02}{J01DI02}), - \strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}), - \strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}), - \strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}), - \strong{CED}: cephradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}), - \strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}), - \strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}), - \strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}), - \strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}), - \strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}), - \strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}), - \strong{DOR}: doripenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH04}{J01DH04}), - \strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}), - \strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}), - \strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}), - \strong{ETH}: ethambutol (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK02}{J04AK02}), - \strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}), - \strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}), - \strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}), - \strong{GAT}: gatifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA16}{J01MA16}), - \strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}), - \strong{GEH}: gentamicin-high (no ATC code), - \strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}), - \strong{INH}: isoniazid (\href{https://www.whocc.no/atc_ddd_index/?code=J04AC01}{J04AC01}), - \strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}), - \strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}), - \strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}), - \strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}), - \strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}), - \strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01XD01}{J01XD01}), - \strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}), - \strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}), - \strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}), - \strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}), - \strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}), - \strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}), - \strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}), - \strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}), - \strong{NOV}: novobiocin (\href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}), - \strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}), - \strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF04}{J01CF04}), - \strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}), - \strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}), - \strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}), - \strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}), - \strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}), - \strong{PZA}: pyrazinamide (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK01}{J04AK01}), - \strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}), - \strong{RIB}: rifabutin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB04}{J04AB04}), - \strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}), - \strong{RFP}: rifapentine (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB05}{J04AB05}), - \strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}), - \strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}), - \strong{STH}: streptomycin-high (no ATC code), - \strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}), - \strong{TLV}: telavancin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA03}{J01XA03}), - \strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}), - \strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}), - \strong{TCC}: ticarcillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR03}{J01CR03}), - \strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}), - \strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}), - \strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}), - \strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}), - \strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}). +\strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), +\strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), +\strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}), +\strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}), +\strong{SAM}: ampicillin/sulbactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR01}{J01CR01}), +\strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}), +\strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}), +\strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}), +\strong{CAP}: capreomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB30}{J04AB30}), +\strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}), +\strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}), +\strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}), +\strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}), +\strong{CTT}: cefotetan (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC05}{J01DC05}), +\strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}), +\strong{CPT}: ceftaroline (\href{https://www.whocc.no/atc_ddd_index/?code=J01DI02}{J01DI02}), +\strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}), +\strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}), +\strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}), +\strong{CED}: cephradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}), +\strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}), +\strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}), +\strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}), +\strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}), +\strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}), +\strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}), +\strong{DOR}: doripenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH04}{J01DH04}), +\strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}), +\strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}), +\strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}), +\strong{ETH}: ethambutol (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK02}{J04AK02}), +\strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}), +\strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}), +\strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}), +\strong{GAT}: gatifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA16}{J01MA16}), +\strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}), +\strong{GEH}: gentamicin-high (no ATC code), +\strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}), +\strong{INH}: isoniazid (\href{https://www.whocc.no/atc_ddd_index/?code=J04AC01}{J04AC01}), +\strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}), +\strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}), +\strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}), +\strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}), +\strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}), +\strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01XD01}{J01XD01}), +\strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}), +\strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}), +\strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}), +\strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}), +\strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}), +\strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}), +\strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}), +\strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}), +\strong{NOV}: novobiocin (\href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}), +\strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}), +\strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF04}{J01CF04}), +\strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}), +\strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}), +\strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}), +\strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}), +\strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}), +\strong{PZA}: pyrazinamide (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK01}{J04AK01}), +\strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}), +\strong{RIB}: rifabutin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB04}{J04AB04}), +\strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}), +\strong{RFP}: rifapentine (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB05}{J04AB05}), +\strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}), +\strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}), +\strong{STH}: streptomycin-high (no ATC code), +\strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}), +\strong{TLV}: telavancin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA03}{J01XA03}), +\strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}), +\strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}), +\strong{TCC}: ticarcillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR03}{J01CR03}), +\strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}), +\strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}), +\strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}), +\strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}), +\strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}). } \section{Read more on our website!}{ diff --git a/man/example_isolates.Rd b/man/example_isolates.Rd index e94b71826..4eed7482d 100644 --- a/man/example_isolates.Rd +++ b/man/example_isolates.Rd @@ -5,17 +5,17 @@ \alias{example_isolates} \title{Data set with 2,000 example isolates} \format{A \code{\link{data.frame}} with 2,000 observations and 49 variables: -\describe{ - \item{\code{date}}{date of receipt at the laboratory} - \item{\code{hospital_id}}{ID of the hospital, from A to D} - \item{\code{ward_icu}}{logical to determine if ward is an intensive care unit} - \item{\code{ward_clinical}}{logical to determine if ward is a regular clinical ward} - \item{\code{ward_outpatient}}{logical to determine if ward is an outpatient clinic} - \item{\code{age}}{age of the patient} - \item{\code{gender}}{gender of the patient} - \item{\code{patient_id}}{ID of the patient} - \item{\code{mo}}{ID of microorganism created with \code{\link{as.mo}}, see also \code{\link{microorganisms}}} - \item{\code{PEN:RIF}}{40 different antibiotics with class \code{rsi} (see \code{\link{as.rsi}}); these column names occur in \code{\link{antibiotics}} data set and can be translated with \code{\link{ab_name}}} +\itemize{ +\item \code{date}\cr date of receipt at the laboratory +\item \code{hospital_id}\cr ID of the hospital, from A to D +\item \code{ward_icu}\cr logical to determine if ward is an intensive care unit +\item \code{ward_clinical}\cr logical to determine if ward is a regular clinical ward +\item \code{ward_outpatient}\cr logical to determine if ward is an outpatient clinic +\item \code{age}\cr age of the patient +\item \code{gender}\cr gender of the patient +\item \code{patient_id}\cr ID of the patient +\item \code{mo}\cr ID of microorganism created with \code{\link[=as.mo]{as.mo()}}, see also \link{microorganisms} +\item \code{PEN:RIF}\cr 40 different antibiotics with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}}); these column names occur in \link{antibiotics} data set and can be translated with \code{\link[=ab_name]{ab_name()}} }} \usage{ example_isolates diff --git a/man/filter_ab_class.Rd b/man/filter_ab_class.Rd index 9bb77f0d4..7c87ade75 100644 --- a/man/filter_ab_class.Rd +++ b/man/filter_ab_class.Rd @@ -45,7 +45,7 @@ filter_tetracyclines(x, result = NULL, scope = "any", ...) \arguments{ \item{x}{a data set} -\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{AMR::antibiotics$group}} +\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}, as can be found in \code{\link[=antibiotics]{AMR::antibiotics$group}}} \item{result}{an antibiotic result: S, I or R (or a combination of more of them)} @@ -57,7 +57,7 @@ filter_tetracyclines(x, result = NULL, scope = "any", ...) 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{group} column in \code{\link{antibiotics}} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \code{antibiotics} data set. +The \code{group} column in \link{antibiotics} data set will be searched for \code{ab_class} (case-insensitive). If no results are found, the \code{atc_group1} and \code{atc_group2} columns will be searched. Next, \code{x} will be checked for column names with a value in any abbreviations, codes or official names found in the \link{antibiotics} data set. } \examples{ library(dplyr) diff --git a/man/first_isolate.Rd b/man/first_isolate.Rd index 6ef7bf836..013e1cc53 100755 --- a/man/first_isolate.Rd +++ b/man/first_isolate.Rd @@ -6,31 +6,57 @@ \alias{filter_first_weighted_isolate} \title{Determine first (weighted) isolates} \source{ -Methodology of this function is based on: \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. +Methodology of this function is based on: + +\strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. } \usage{ -first_isolate(x, col_date = NULL, col_patient_id = NULL, - col_mo = NULL, col_testcode = NULL, col_specimen = NULL, - col_icu = NULL, col_keyantibiotics = NULL, episode_days = 365, - testcodes_exclude = NULL, icu_exclude = FALSE, - specimen_group = NULL, type = "keyantibiotics", ignore_I = TRUE, - points_threshold = 2, info = TRUE, include_unknown = FALSE, ...) +first_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + col_testcode = NULL, + col_specimen = NULL, + col_icu = NULL, + col_keyantibiotics = NULL, + episode_days = 365, + testcodes_exclude = NULL, + icu_exclude = FALSE, + specimen_group = NULL, + type = "keyantibiotics", + ignore_I = TRUE, + points_threshold = 2, + info = TRUE, + include_unknown = FALSE, + ... +) -filter_first_isolate(x, col_date = NULL, col_patient_id = NULL, - col_mo = NULL, ...) +filter_first_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + ... +) -filter_first_weighted_isolate(x, col_date = NULL, - col_patient_id = NULL, col_mo = NULL, col_keyantibiotics = NULL, - ...) +filter_first_weighted_isolate( + x, + col_date = NULL, + col_patient_id = NULL, + col_mo = NULL, + col_keyantibiotics = NULL, + ... +) } \arguments{ -\item{x}{a \code{data.frame} containing isolates.} +\item{x}{a \code{\link{data.frame}} containing isolates.} \item{col_date}{column name of the result date (or date that is was received on the lab), defaults to the first column of with a date class} \item{col_patient_id}{column name of the unique IDs of the patients, defaults to the first column that starts with 'patient' or 'patid' (case insensitive)} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} \item{col_testcode}{column name of the test codes. Use \code{col_testcode = NULL} to \strong{not} exclude certain test codes (like test codes for screening). In that case \code{testcodes_exclude} will be ignored.} @@ -38,7 +64,7 @@ filter_first_weighted_isolate(x, col_date = NULL, \item{col_icu}{column name of the logicals (\code{TRUE}/\code{FALSE}) whether a ward or department is an Intensive Care Unit (ICU)} -\item{col_keyantibiotics}{column name of the key antibiotics to determine first \emph{weighted} isolates, see \code{\link{key_antibiotics}}. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use \code{col_keyantibiotics = FALSE} to prevent this.} +\item{col_keyantibiotics}{column name of the key antibiotics to determine first \emph{weighted} isolates, see \code{\link[=key_antibiotics]{key_antibiotics()}}. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use \code{col_keyantibiotics = FALSE} to prevent this.} \item{episode_days}{episode in days after which a genus/species combination will be determined as 'first isolate' again. The default of 365 days is based on the guideline by CLSI, see Source.} @@ -58,30 +84,27 @@ filter_first_weighted_isolate(x, col_date = NULL, \item{include_unknown}{logical to determine whether 'unknown' microorganisms should be included too, i.e. microbial code \code{"UNKNOWN"}, which defaults to \code{FALSE}. For WHONET users, this means that all records with organism code \code{"con"} (\emph{contamination}) will be excluded at default. Isolates with a microbial ID of \code{NA} will always be excluded as first isolate.} -\item{...}{parameters passed on to the \code{first_isolate} function} +\item{...}{parameters passed on to the \code{\link[=first_isolate]{first_isolate()}} function} } \value{ -Logical vector +A \code{\link{logical}} vector } \description{ Determine first (weighted) isolates of all microorganisms of every patient per episode and (if needed) per specimen type. } \details{ \strong{WHY THIS IS SO IMPORTANT} \cr -To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode \href{https://www.ncbi.nlm.nih.gov/pubmed/17304462}{[1]}. If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. +To conduct an analysis of antimicrobial resistance, you should only include the first isolate of every patient per episode [\link{1}](https://www.ncbi.nlm.nih.gov/pubmed/17304462). If you would not do this, you could easily get an overestimate or underestimate of the resistance of an antibiotic. Imagine that a patient was admitted with an MRSA and that it was found in 5 different blood cultures the following week. The resistance percentage of oxacillin of all \emph{S. aureus} isolates would be overestimated, because you included this MRSA more than once. It would be \href{https://en.wikipedia.org/wiki/Selection_bias}{selection bias}. All isolates with a microbial ID of \code{NA} will be excluded as first isolate. -The functions \code{filter_first_isolate} and \code{filter_first_weighted_isolate} are helper functions to quickly filter on first isolates. The function \code{filter_first_isolate} is essentially equal to: -\preformatted{ - x \%>\% +The functions \code{\link[=filter_first_isolate]{filter_first_isolate()}} and \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} are helper functions to quickly filter on first isolates. The function \code{\link[=filter_first_isolate]{filter_first_isolate()}} is essentially equal to:\preformatted{ x \%>\% mutate(only_firsts = first_isolate(x, ...)) \%>\% filter(only_firsts == TRUE) \%>\% select(-only_firsts) } -The function \code{filter_first_weighted_isolate} is essentially equal to: -\preformatted{ - x \%>\% + +The function \code{\link[=filter_first_weighted_isolate]{filter_first_weighted_isolate()}} is essentially equal to:\preformatted{ x \%>\% mutate(keyab = key_antibiotics(.)) \%>\% mutate(only_weighted_firsts = first_isolate(x, col_keyantibiotics = "keyab", ...)) \%>\% @@ -91,13 +114,15 @@ The function \code{filter_first_weighted_isolate} is essentially equal to: } \section{Key antibiotics}{ - There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: \cr +There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: +\enumerate{ +\item Using \code{type = "keyantibiotics"} and parameter \code{ignore_I} - \strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr - Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link{key_antibiotics}} function. \cr +Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link[=key_antibiotics]{key_antibiotics()}} function. +\item Using \code{type = "points"} and parameter \code{points_threshold} - \strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr - A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. +A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. +} } \section{Read more on our website!}{ @@ -158,5 +183,5 @@ x$first_blood_isolate <- first_isolate(x, specimen_group = "Blood") } } \seealso{ -\code{\link{key_antibiotics}} +\code{\link[=key_antibiotics]{key_antibiotics()}} } diff --git a/man/g.test.Rd b/man/g.test.Rd index a0f633dd0..fee57e8d6 100644 --- a/man/g.test.Rd +++ b/man/g.test.Rd @@ -4,16 +4,15 @@ \alias{g.test} \title{\emph{G}-test for Count Data} \source{ -This code is almost identical to \code{\link{chisq.test}}, except that: +The code for this function is identical to that of \code{\link[=chisq.test]{chisq.test()}}, except that: \itemize{ - \item{The calculation of the statistic was changed to \code{2 * sum(x * log(x / E))}} - \item{Yates' continuity correction was removed as it does not apply to a \emph{G}-test} - \item{The possibility to simulate p values with \code{simulate.p.value} was removed} +\item The calculation of the statistic was changed to \eqn{2 * sum(x * log(x / E))} +\item Yates' continuity correction was removed as it does not apply to a \emph{G}-test +\item The possibility to simulate p values with \code{simulate.p.value} was removed } } \usage{ -g.test(x, y = NULL, p = rep(1/length(x), length(x)), - rescale.p = FALSE) +g.test(x, y = NULL, p = rep(1/length(x), length(x)), rescale.p = FALSE) } \arguments{ \item{x}{a numeric vector or matrix. \code{x} and \code{y} can also @@ -50,56 +49,54 @@ A list with class \code{"htest"} containing the following section 2.4.5 for the case where \code{x} is a matrix, \code{n * p * (1 - p)} otherwise).} } \description{ -\code{g.test} performs chi-squared contingency table tests and goodness-of-fit tests, just like \code{\link{chisq.test}} but is more reliable [1]. A \emph{G}-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a \strong{\emph{G}-test of goodness-of-fit}), or to see whether the proportions of one variable are different for different values of the other variable (called a \strong{\emph{G}-test of independence}). +\code{\link[=g.test]{g.test()}} performs chi-squared contingency table tests and goodness-of-fit tests, just like \code{\link[=chisq.test]{chisq.test()}} but is more reliable \link{1}. A \emph{G}-test can be used to see whether the number of observations in each category fits a theoretical expectation (called a \strong{\emph{G}-test of goodness-of-fit}), or to see whether the proportions of one variable are different for different values of the other variable (called a \strong{\emph{G}-test of independence}). } \details{ If \code{x} is a matrix with one row or column, or if \code{x} is a vector and \code{y} is not given, then a \emph{goodness-of-fit test} is performed (\code{x} is treated as a one-dimensional contingency table). The entries of \code{x} must be non-negative integers. In this case, the hypothesis tested is whether the population probabilities equal those in \code{p}, or are all equal if \code{p} is not given. - If \code{x} is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of \code{x} must be non-negative integers. Otherwise, \code{x} and \code{y} must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals. +If \code{x} is a matrix with at least two rows and columns, it is taken as a two-dimensional contingency table: the entries of \code{x} must be non-negative integers. Otherwise, \code{x} and \code{y} must be vectors or factors of the same length; cases with missing values are removed, the objects are coerced to factors, and the contingency table is computed from these. Then Pearson's chi-squared test is performed of the null hypothesis that the joint distribution of the cell counts in a 2-dimensional contingency table is the product of the row and column marginals. - The p-value is computed from the asymptotic chi-squared distribution of the test statistic. +The p-value is computed from the asymptotic chi-squared distribution of the test statistic. - In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the \emph{G}-test) but rather that for Fisher's exact test. +In the contingency table case simulation is done by random sampling from the set of all contingency tables with given marginals, and works only if the marginals are strictly positive. Note that this is not the usual sampling situation assumed for a chi-squared test (like the \emph{G}-test) but rather that for Fisher's exact test. - In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by \code{p}, each sample being of size \code{n = sum(x)}. This simulation is done in \R and may be slow. -} -\section{\emph{G}-test of goodness-of-fit (likelihood ratio test)}{ +In the goodness-of-fit case simulation is done by random sampling from the discrete distribution specified by \code{p}, each sample being of size \code{n = sum(x)}. This simulation is done in \R and may be slow. +\subsection{\emph{G}-test of goodness-of-fit (likelihood ratio test)}{ Use the \emph{G}-test of goodness-of-fit when you have one nominal variable with two or more values (such as male and female, or red, pink and white flowers). You compare the observed counts of numbers of observations in each category with the expected counts, which you calculate using some kind of theoretical expectation (such as a 1:1 sex ratio or a 1:2:1 ratio in a genetic cross). -If the expected number of observations in any category is too small, the \emph{G}-test may give inaccurate results, and you should use an exact test instead (\code{\link{fisher.test}}). +If the expected number of observations in any category is too small, the \emph{G}-test may give inaccurate results, and you should use an exact test instead (\code{\link[=fisher.test]{fisher.test()}}). -The \emph{G}-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (\code{\link{chisq.test}}); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar. +The \emph{G}-test of goodness-of-fit is an alternative to the chi-square test of goodness-of-fit (\code{\link[=chisq.test]{chisq.test()}}); each of these tests has some advantages and some disadvantages, and the results of the two tests are usually very similar. } -\section{\emph{G}-test of independence}{ +\subsection{\emph{G}-test of independence}{ Use the \emph{G}-test of independence when you have two nominal variables, each with two or more possible values. You want to know whether the proportions for one variable are different among values of the other variable. It is also possible to do a \emph{G}-test of independence with more than two nominal variables. For example, Jackson et al. (2013) also had data for children under 3, so you could do an analysis of old vs. young, thigh vs. arm, and reaction vs. no reaction, all analyzed together. -Fisher's exact test (\code{\link{fisher.test}}) is an \strong{exact} test, where the \emph{G}-test is still only an \strong{approximation}. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions. +Fisher's exact test (\code{\link[=fisher.test]{fisher.test()}}) is an \strong{exact} test, where the \emph{G}-test is still only an \strong{approximation}. For any 2x2 table, Fisher's Exact test may be slower but will still run in seconds, even if the sum of your observations is multiple millions. -The \emph{G}-test of independence is an alternative to the chi-square test of independence (\code{\link{chisq.test}}), and they will give approximately the same results. +The \emph{G}-test of independence is an alternative to the chi-square test of independence (\code{\link[=chisq.test]{chisq.test()}}), and they will give approximately the same results. } -\section{How the test works}{ +\subsection{How the test works}{ -Unlike the exact test of goodness-of-fit (\code{\link{fisher.test}}), the \emph{G}-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the \emph{G}-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic. +Unlike the exact test of goodness-of-fit (\code{\link[=fisher.test]{fisher.test()}}), the \emph{G}-test does not directly calculate the probability of obtaining the observed results or something more extreme. Instead, like almost all statistical tests, the \emph{G}-test has an intermediate step; it uses the data to calculate a test statistic that measures how far the observed data are from the null expectation. You then use a mathematical relationship, in this case the chi-square distribution, to estimate the probability of obtaining that value of the test statistic. The \emph{G}-test uses the log of the ratio of two likelihoods as the test statistic, which is why it is also called a likelihood ratio test or log-likelihood ratio test. The formula to calculate a \emph{G}-statistic is: -\code{G <- 2 * sum(x * log(x / E))} +\eqn{G = 2 * sum(x * log(x / E))} -where \code{E} are the expected values. Since this is chi-square distributed, the p value can be calculated with: - -\code{p <- stats::pchisq(G, df, lower.tail = FALSE)} +where \code{E} are the expected values. Since this is chi-square distributed, the p value can be calculated in \R with:\preformatted{p <- stats::pchisq(G, df, lower.tail = FALSE) +} where \code{df} are the degrees of freedom. If there are more than two categories and you want to find out which ones are significantly different from their null expectation, you can use the same method of testing each category vs. the sum of all categories, with the Bonferroni correction. You use \emph{G}-tests for each category, of course. } - +} \section{Read more on our website!}{ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. @@ -140,8 +137,8 @@ g.test(x) } \references{ -[1] McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland. \url{http://www.biostathandbook.com/gtestgof.html}. +\link{1} McDonald, J.H. 2014. \strong{Handbook of Biological Statistics (3rd ed.)}. Sparky House Publishing, Baltimore, Maryland. \url{http://www.biostathandbook.com/gtestgof.html}. } \seealso{ -\code{\link{chisq.test}} +\code{\link[=chisq.test]{chisq.test()}} } diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index 09e6f6877..7b60af056 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -10,36 +10,66 @@ \alias{labels_rsi_count} \title{AMR plots with \code{ggplot2}} \usage{ -ggplot_rsi(data, position = NULL, x = "antibiotic", - fill = "interpretation", facet = NULL, breaks = seq(0, 1, 0.1), - limits = NULL, translate_ab = "name", combine_SI = TRUE, - combine_IR = FALSE, language = get_locale(), nrow = NULL, - colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = - "#ff6961", R = "#ff6961"), datalabels = TRUE, datalabels.size = 2.5, - datalabels.colour = "gray15", title = NULL, subtitle = NULL, - caption = NULL, x.title = "Antimicrobial", y.title = "Proportion", - ...) +ggplot_rsi( + data, + position = NULL, + x = "antibiotic", + fill = "interpretation", + facet = NULL, + breaks = seq(0, 1, 0.1), + limits = NULL, + translate_ab = "name", + combine_SI = TRUE, + combine_IR = FALSE, + language = get_locale(), + nrow = NULL, + colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = "#ff6961", R = + "#ff6961"), + datalabels = TRUE, + datalabels.size = 2.5, + datalabels.colour = "gray15", + title = NULL, + subtitle = NULL, + caption = NULL, + x.title = "Antimicrobial", + y.title = "Proportion", + ... +) -geom_rsi(position = NULL, x = c("antibiotic", "interpretation"), - fill = "interpretation", translate_ab = "name", - language = get_locale(), combine_SI = TRUE, combine_IR = FALSE, - ...) +geom_rsi( + position = NULL, + x = c("antibiotic", "interpretation"), + fill = "interpretation", + translate_ab = "name", + language = get_locale(), + combine_SI = TRUE, + combine_IR = FALSE, + ... +) facet_rsi(facet = c("interpretation", "antibiotic"), nrow = NULL) scale_y_percent(breaks = seq(0, 1, 0.1), limits = NULL) -scale_rsi_colours(colours = c(S = "#61a8ff", SI = "#61a8ff", I = - "#61f7ff", IR = "#ff6961", R = "#ff6961")) +scale_rsi_colours( + colours = c(S = "#61a8ff", SI = "#61a8ff", I = "#61f7ff", IR = "#ff6961", R = + "#ff6961") +) theme_rsi() -labels_rsi_count(position = NULL, x = "antibiotic", - translate_ab = "name", combine_SI = TRUE, combine_IR = FALSE, - datalabels.size = 3, datalabels.colour = "gray15") +labels_rsi_count( + position = NULL, + x = "antibiotic", + translate_ab = "name", + combine_SI = TRUE, + combine_IR = FALSE, + datalabels.size = 3, + datalabels.colour = "gray15" +) } \arguments{ -\item{data}{a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}})} +\item{data}{a \code{\link{data.frame}} with column(s) of class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})} \item{position}{position adjustment of bars, either \code{"fill"}, \code{"stack"} or \code{"dodge"}} @@ -53,19 +83,19 @@ labels_rsi_count(position = NULL, x = "antibiotic", \item{limits}{numeric vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum} -\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}} +\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} \item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} \item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \item{nrow}{(when using \code{facet}) number of rows} -\item{colours}{a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be \code{FALSE} to use default \code{ggplot2} colours.} +\item{colours}{a named vector with colours for the bars. The names must be one or more of: S, SI, I, IR, R or be \code{FALSE} to use default [ggplot2][\code{\link[ggplot2:ggplot]{ggplot2::ggplot()}} colours.} -\item{datalabels}{show datalabels using \code{labels_rsi_count}} +\item{datalabels}{show datalabels using \code{\link[=labels_rsi_count]{labels_rsi_count()}}} \item{datalabels.size}{size of the datalabels} @@ -81,28 +111,29 @@ labels_rsi_count(position = NULL, x = "antibiotic", \item{y.title}{text to show as y axis description} -\item{...}{other parameters passed on to \code{geom_rsi}} +\item{...}{other parameters passed on to \code{\link[=geom_rsi]{geom_rsi()}}} } \description{ -Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal \code{\link[ggplot2]{ggplot}2} functions. +Use these functions to create bar plots for antimicrobial resistance analysis. All functions rely on internal \link[ggplot2:ggplot]{ggplot2} functions. } \details{ -At default, the names of antibiotics will be shown on the plots using \code{\link{ab_name}}. This can be set with the \code{translate_ab} parameter. See \code{\link{count_df}}. +At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} parameter. See \code{\link[=count_df]{count_df()}}. +\subsection{The functions}{ -\strong{The functions}\cr -\code{geom_rsi} will take any variable from the data that has an \code{rsi} class (created with \code{\link{as.rsi}}) using \code{\link{rsi_df}} and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. +\code{\link[=geom_rsi]{geom_rsi()}} will take any variable from the data that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) using \code{\link[=rsi_df]{rsi_df()}} and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. -\code{facet_rsi} creates 2d plots (at default based on S/I/R) using \code{\link[ggplot2]{facet_wrap}}. +\code{\link[=facet_rsi]{facet_rsi()}} creates 2d plots (at default based on S/I/R) using \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}}. -\code{scale_y_percent} transforms the y axis to a 0 to 100\% range using \code{\link[ggplot2]{scale_continuous}}. +\code{\link[=scale_y_percent]{scale_y_percent()}} transforms the y axis to a 0 to 100\% range using \code{\link[ggplot2:scale_continuous]{ggplot2::scale_continuous()}}. -\code{scale_rsi_colours} sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using \code{\link[ggplot2]{scale_brewer}}. +\code{\link[=scale_rsi_colours]{scale_rsi_colours()}} sets colours to the bars: pastel blue for S, pastel turquoise for I and pastel red for R, using \code{\link[ggplot2:scale_brewer]{ggplot2::scale_brewer()}}. -\code{theme_rsi} is a \code{ggplot \link[ggplot2]{theme}} with minimal distraction. +\code{\link[=theme_rsi]{theme_rsi()}} is a [ggplot2 theme][\code{\link[ggplot2:theme]{ggplot2::theme()}} with minimal distraction. -\code{labels_rsi_count} print datalabels on the bars with percentage and amount of isolates using \code{\link[ggplot2]{geom_text}} +\code{\link[=labels_rsi_count]{labels_rsi_count()}} print datalabels on the bars with percentage and amount of isolates using \code{\link[ggplot2:geom_text]{ggplot2::geom_text()}} -\code{ggplot_rsi} is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (\code{\%>\%}). See Examples. +\code{\link[=ggplot_rsi]{ggplot_rsi()}} is a wrapper around all above functions that uses data as first input. This makes it possible to use this function after a pipe (\verb{\%>\%}). See Examples. +} } \section{Read more on our website!}{ diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd index 8f69b7aad..c5956a4db 100644 --- a/man/guess_ab_col.Rd +++ b/man/guess_ab_col.Rd @@ -7,9 +7,9 @@ guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE) } \arguments{ -\item{x}{a \code{data.frame}} +\item{x}{a \code{\link{data.frame}}} -\item{search_string}{a text to search \code{x} for, will be checked with \code{\link{as.ab}} if this value is not a column in \code{x}} +\item{search_string}{a text to search \code{x} for, will be checked with \code{\link[=as.ab]{as.ab()}} if this value is not a column in \code{x}} \item{verbose}{a logical to indicate whether additional info should be printed} } @@ -17,10 +17,10 @@ guess_ab_col(x = NULL, search_string = NULL, verbose = FALSE) A column name of \code{x}, or \code{NULL} when no result is found. } \description{ -This tries to find a column name in a data set based on information from the \code{\link{antibiotics}} data set. Also supports WHONET abbreviations. +This tries to find a column name in a data set based on information from the \link{antibiotics} data set. Also supports WHONET abbreviations. } \details{ -You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \code{\link{antibiotics}} data set for any column containing a name or code of that antibiotic. \strong{Longer columns names take precendence over shorter column names.} +You can look for an antibiotic (trade) name or abbreviation and it will search \code{x} and the \link{antibiotics} data set for any column containing a name or code of that antibiotic. \strong{Longer columns names take precendence over shorter column names.} } \section{Read more on our website!}{ diff --git a/man/join.Rd b/man/join.Rd index 454e1e56d..53aaac645 100755 --- a/man/join.Rd +++ b/man/join.Rd @@ -9,7 +9,7 @@ \alias{full_join_microorganisms} \alias{semi_join_microorganisms} \alias{anti_join_microorganisms} -\title{Join a table with \code{microorganisms}} +\title{Join a table with \link{microorganisms}} \usage{ inner_join_microorganisms(x, by = NULL, suffix = c("2", ""), ...) @@ -26,17 +26,17 @@ anti_join_microorganisms(x, by = NULL, ...) \arguments{ \item{x}{existing table to join, or character vector} -\item{by}{a variable to join by - if left empty will search for a column with class \code{mo} (created with \code{\link{as.mo}}) or will be \code{"mo"} if that column name exists in \code{x}, could otherwise be a column name of \code{x} with values that exist in \code{microorganisms$mo} (like \code{by = "bacteria_id"}), or another column in \code{\link{microorganisms}} (but then it should be named, like \code{by = c("my_genus_species" = "fullname")})} +\item{by}{a variable to join by - if left empty will search for a column with class \code{\link{mo}} (created with \code{\link[=as.mo]{as.mo()}}) or will be \code{"mo"} if that column name exists in \code{x}, could otherwise be a column name of \code{x} with values that exist in \code{microorganisms$mo} (like \code{by = "bacteria_id"}), or another column in \link{microorganisms} (but then it should be named, like \code{by = c("my_genus_species" = "fullname")})} \item{suffix}{if there are non-joined duplicate variables in \code{x} and \code{y}, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.} -\item{...}{other parameters to pass on to \code{dplyr::\link[dplyr]{join}}.} +\item{...}{other parameters to pass on to \code{\link[dplyr:join]{dplyr::join()}}} } \description{ -Join the dataset \code{\link{microorganisms}} easily to an existing table or character vector. +Join the data set \link{microorganisms} easily to an existing table or character vector. } \details{ -\strong{Note:} As opposed to the \code{\link[dplyr]{join}} functions of \code{dplyr}, characters vectors are supported and at default existing columns will get a suffix \code{"2"} and the newly joined columns will not get a suffix. See \code{\link[dplyr]{join}} for more information. +\strong{Note:} As opposed to the \code{\link[dplyr:join]{dplyr::join()}} functions of \code{dplyr}, \code{\link{characters}} vectors are supported and at default existing columns will get a suffix \code{"2"} and the newly joined columns will not get a suffix. See \code{\link[dplyr:join]{dplyr::join()}} for more information. } \section{Read more on our website!}{ diff --git a/man/key_antibiotics.Rd b/man/key_antibiotics.Rd index ef4f9a974..49b499203 100755 --- a/man/key_antibiotics.Rd +++ b/man/key_antibiotics.Rd @@ -5,36 +5,50 @@ \alias{key_antibiotics_equal} \title{Key antibiotics for first \emph{weighted} isolates} \usage{ -key_antibiotics(x, col_mo = NULL, universal_1 = guess_ab_col(x, - "amoxicillin"), universal_2 = guess_ab_col(x, - "amoxicillin/clavulanic acid"), universal_3 = guess_ab_col(x, - "cefuroxime"), universal_4 = guess_ab_col(x, - "piperacillin/tazobactam"), universal_5 = guess_ab_col(x, - "ciprofloxacin"), universal_6 = guess_ab_col(x, - "trimethoprim/sulfamethoxazole"), GramPos_1 = guess_ab_col(x, - "vancomycin"), GramPos_2 = guess_ab_col(x, "teicoplanin"), +key_antibiotics( + x, + col_mo = NULL, + universal_1 = guess_ab_col(x, "amoxicillin"), + universal_2 = guess_ab_col(x, "amoxicillin/clavulanic acid"), + universal_3 = guess_ab_col(x, "cefuroxime"), + universal_4 = guess_ab_col(x, "piperacillin/tazobactam"), + universal_5 = guess_ab_col(x, "ciprofloxacin"), + universal_6 = guess_ab_col(x, "trimethoprim/sulfamethoxazole"), + GramPos_1 = guess_ab_col(x, "vancomycin"), + GramPos_2 = guess_ab_col(x, "teicoplanin"), GramPos_3 = guess_ab_col(x, "tetracycline"), GramPos_4 = guess_ab_col(x, "erythromycin"), - GramPos_5 = guess_ab_col(x, "oxacillin"), GramPos_6 = guess_ab_col(x, - "rifampin"), GramNeg_1 = guess_ab_col(x, "gentamicin"), + GramPos_5 = guess_ab_col(x, "oxacillin"), + GramPos_6 = guess_ab_col(x, "rifampin"), + GramNeg_1 = guess_ab_col(x, "gentamicin"), GramNeg_2 = guess_ab_col(x, "tobramycin"), - GramNeg_3 = guess_ab_col(x, "colistin"), GramNeg_4 = guess_ab_col(x, - "cefotaxime"), GramNeg_5 = guess_ab_col(x, "ceftazidime"), - GramNeg_6 = guess_ab_col(x, "meropenem"), warnings = TRUE, ...) + GramNeg_3 = guess_ab_col(x, "colistin"), + GramNeg_4 = guess_ab_col(x, "cefotaxime"), + GramNeg_5 = guess_ab_col(x, "ceftazidime"), + GramNeg_6 = guess_ab_col(x, "meropenem"), + warnings = TRUE, + ... +) -key_antibiotics_equal(y, z, type = c("keyantibiotics", "points"), - ignore_I = TRUE, points_threshold = 2, info = FALSE) +key_antibiotics_equal( + y, + z, + type = c("keyantibiotics", "points"), + ignore_I = TRUE, + points_threshold = 2, + info = FALSE +) } \arguments{ \item{x}{table with antibiotics coloms, like \code{AMX} or \code{amox}} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} -\item{universal_1, universal_2, universal_3, universal_4, universal_5, universal_6}{column names of \strong{broad-spectrum} antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.} +\item{universal_1, universal_2, universal_3, universal_4, universal_5, universal_6}{column names of \strong{broad-spectrum} antibiotics, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link[=guess_ab_col]{guess_ab_col()}}.} -\item{GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6}{column names of antibiotics for \strong{Gram-positives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.} +\item{GramPos_1, GramPos_2, GramPos_3, GramPos_4, GramPos_5, GramPos_6}{column names of antibiotics for \strong{Gram-positives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link[=guess_ab_col]{guess_ab_col()}}.} -\item{GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6}{column names of antibiotics for \strong{Gram-negatives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link{guess_ab_col}}.} +\item{GramNeg_1, GramNeg_2, GramNeg_3, GramNeg_4, GramNeg_5, GramNeg_6}{column names of antibiotics for \strong{Gram-negatives}, case-insensitive. At default, the columns containing these antibiotics will be guessed with \code{\link[=guess_ab_col]{guess_ab_col()}}.} \item{warnings}{give warning about missing antibiotic columns, they will anyway be ignored} @@ -51,29 +65,56 @@ key_antibiotics_equal(y, z, type = c("keyantibiotics", "points"), \item{info}{print progress} } \description{ -These function can be used to determine first isolates (see \code{\link{first_isolate}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first \emph{weighted} isolates. +These function can be used to determine first isolates (see \code{\link[=first_isolate]{first_isolate()}}). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first \emph{weighted} isolates. } \details{ -The function \code{key_antibiotics} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{key_antibiotics_equal}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}). The \code{\link{first_isolate}} function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible \emph{S. aureus} (MSSA) found within the same episode (see \code{episode} parameter of \code{\link{first_isolate}}). Without key antibiotic comparison it would not. +The function \code{\link[=key_antibiotics]{key_antibiotics()}} returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}}, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot (\code{"."}). The \code{\link[=first_isolate]{first_isolate()}} function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible \emph{S. aureus} (MSSA) found within the same episode (see \code{episode} parameter of \code{\link[=first_isolate]{first_isolate()}}). Without key antibiotic comparison it would not. - At default, the antibiotics that are used for \strong{Gram-positive bacteria} are: \cr - amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), vancomycin, teicoplanin, tetracycline, erythromycin, oxacillin, rifampin. +At default, the antibiotics that are used for \strong{Gram-positive bacteria} are: +\itemize{ +\item Amoxicillin +\item Amoxicillin/clavulanic acid +\item Cefuroxime +\item Piperacillin/tazobactam +\item Ciprofloxacin +\item Trimethoprim/sulfamethoxazole +\item Vancomycin +\item Teicoplanin +\item Tetracycline +\item Erythromycin +\item Oxacillin +\item Rifampin +} - At default, the antibiotics that are used for \strong{Gram-negative bacteria} are: \cr - amoxicillin, amoxicillin/clavulanic acid, cefuroxime, piperacillin/tazobactam, ciprofloxacin, trimethoprim/sulfamethoxazole (until here is universal), gentamicin, tobramycin, colistin, cefotaxime, ceftazidime, meropenem. +At default the antibiotics that are used for \strong{Gram-negative bacteria} are: +\itemize{ +\item Amoxicillin +\item Amoxicillin/clavulanic acid +\item Cefuroxime +\item Piperacillin/tazobactam +\item Ciprofloxacin +\item Trimethoprim/sulfamethoxazole +\item Gentamicin +\item Tobramycin +\item Colistin +\item Cefotaxime +\item Ceftazidime +\item Meropenem +} - - The function \code{key_antibiotics_equal} checks the characters returned by \code{key_antibiotics} for equality, and returns a logical vector. +The function \code{\link[=key_antibiotics_equal]{key_antibiotics_equal()}} checks the characters returned by \code{\link[=key_antibiotics]{key_antibiotics()}} for equality, and returns a \code{\link{logical}} vector. } \section{Key antibiotics}{ - There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: \cr +There are two ways to determine whether isolates can be included as first \emph{weighted} isolates which will give generally the same results: +\enumerate{ +\item Using \code{type = "keyantibiotics"} and parameter \code{ignore_I} - \strong{1. Using} \code{type = "keyantibiotics"} \strong{and parameter} \code{ignore_I} \cr - Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link{key_antibiotics}} function. \cr +Any difference from S to R (or vice versa) will (re)select an isolate as a first weighted isolate. With \code{ignore_I = FALSE}, also differences from I to S|R (or vice versa) will lead to this. This is a reliable method and 30-35 times faster than method 2. Read more about this in the \code{\link[=key_antibiotics]{key_antibiotics()}} function. +\item Using \code{type = "points"} and parameter \code{points_threshold} - \strong{2. Using} \code{type = "points"} \strong{and parameter} \code{points_threshold} \cr - A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. +A difference from I to S|R (or vice versa) means 0.5 points, a difference from S to R (or vice versa) means 1 point. When the sum of points exceeds \code{points_threshold}, which default to \code{2}, an isolate will be (re)selected as a first weighted isolate. +} } \section{Read more on our website!}{ @@ -112,5 +153,5 @@ key_antibiotics_equal(strainA, strainB, ignore_I = FALSE) # FALSE, because I is not ignored and so the 4th value differs } \seealso{ -\code{\link{first_isolate}} +\code{\link[=first_isolate]{first_isolate()}} } diff --git a/man/kurtosis.Rd b/man/kurtosis.Rd index 09bff4373..59b08786a 100644 --- a/man/kurtosis.Rd +++ b/man/kurtosis.Rd @@ -16,7 +16,7 @@ kurtosis(x, na.rm = FALSE) \method{kurtosis}{data.frame}(x, na.rm = FALSE) } \arguments{ -\item{x}{a vector of values, a \code{matrix} or a \code{data frame}} +\item{x}{a vector of values, a \code{\link{matrix}} or a \code{\link{data frame}}} \item{na.rm}{a logical value indicating whether \code{NA} values should be stripped before the computation proceeds.} } @@ -29,5 +29,5 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{skewness}} +\code{\link[=skewness]{skewness()}} } diff --git a/man/like.Rd b/man/like.Rd index 7ed6f949e..b4ea7b076 100755 --- a/man/like.Rd +++ b/man/like.Rd @@ -18,12 +18,12 @@ x \%like_case\% pattern \arguments{ \item{x}{a character vector where matches are sought, or an object which can be coerced by \code{as.character} to a character - vector. \link{Long vectors} are supported.} + vector. \link[base]{Long vectors} are supported.} -\item{pattern}{character string containing a \link{regular expression} +\item{pattern}{character string containing a \link[base]{regular expression} (or character string for \code{fixed = TRUE}) to be matched in the given character vector. Coerced by - \code{\link{as.character}} to a character string if possible. If a + \code{\link[base]{as.character}} to a character string if possible. If a character vector of length 2 or more is supplied, the first element is used with a warning. Missing values are allowed except for \code{regexpr} and \code{gregexpr}.} @@ -32,13 +32,13 @@ x \%like_case\% pattern sensitive} and if \code{TRUE}, case is ignored during matching.} } \value{ -A \code{logical} vector +A \code{\link{logical}} vector } \description{ -Convenient wrapper around \code{\link[base]{grep}} to match a pattern: \code{a \%like\% b}. It always returns a \code{logical} vector and is always case-insensitive (use \code{a \%like_case\% b} for case-sensitive matching). Also, \code{pattern} (\code{b}) can be as long as \code{x} (\code{a}) to compare items of each index in both vectors, or can both have the same length to iterate over all cases. +Convenient wrapper around \code{\link[base:grep]{base::grep()}} to match a pattern: \code{a \%like\% b}. It always returns a \code{\link{logical}} vector and is always case-insensitive (use \code{a \%like_case\% b} for case-sensitive matching). Also, \code{pattern} (\emph{b}) can be as long as \code{x} (\emph{a}) to compare items of each index in both vectors, or can both have the same length to iterate over all cases. } \details{ -Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like Ctrl+Shift+L or Cmd+Shift+L (see Tools > Modify Keyboard Shortcuts...). +Using RStudio? This function can also be inserted from the Addins menu and can have its own Keyboard Shortcut like \code{Ctrl+Shift+L} or \code{Cmd+Shift+L} (see \code{Tools} > \verb{Modify Keyboard Shortcuts...}). } \section{Read more on our website!}{ @@ -67,5 +67,5 @@ example_isolates \%>\% freq(mo_fullname(mo)) } \seealso{ -\code{\link[base]{grep}} +\code{\link[base:grep]{base::grep()}} } diff --git a/man/mdro.Rd b/man/mdro.Rd index 56558457f..0a824c014 100644 --- a/man/mdro.Rd +++ b/man/mdro.Rd @@ -15,12 +15,19 @@ \alias{eucast_exceptional_phenotypes} \title{Determine multidrug-resistant organisms (MDRO)} \source{ -Please see Details for the list of publications used for this function. +Please see \emph{Details} for the list of publications used for this function. } \usage{ -mdro(x, guideline = NULL, col_mo = NULL, info = TRUE, - pct_required_classes = 0.5, combine_SI = TRUE, verbose = FALSE, - ...) +mdro( + x, + guideline = "CMI2012", + col_mo = NULL, + info = TRUE, + pct_required_classes = 0.5, + combine_SI = TRUE, + verbose = FALSE, + ... +) brmo(x, guideline = "BRMO", ...) @@ -35,26 +42,30 @@ eucast_exceptional_phenotypes(x, guideline = "EUCAST", ...) \arguments{ \item{x}{data with antibiotic columns, like e.g. \code{AMX} and \code{AMC}} -\item{guideline}{a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, see Details.} +\item{guideline}{a specific guideline to follow. When left empty, the publication by Magiorakos \emph{et al.} (2012, Clinical Microbiology and Infection) will be followed, please see \emph{Details}.} -\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link{as.mo}}), defaults to the first column of class \code{mo}. Values will be coerced using \code{\link{as.mo}}.} +\item{col_mo}{column name of the IDs of the microorganisms (see \code{\link[=as.mo]{as.mo()}}), defaults to the first column of class \code{\link{mo}}. Values will be coerced using \code{\link[=as.mo]{as.mo()}}.} -\item{info}{print progress} +\item{info}{a logical to indicate whether progress should be printed to the console} \item{pct_required_classes}{minimal required percentage of antimicrobial classes that must be available per isolate, rounded down. For example, with the default guideline, 17 antimicrobial classes must be available for \emph{S. aureus}. Setting this \code{pct_required_classes} argument to \code{0.5} (default) means that for every \emph{S. aureus} isolate at least 8 different classes must be available. Any lower number of available classes will return \code{NA} for that isolate.} -\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the \code{mdro()} function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using \code{combine_SI = FALSE}, resistance is considered when isolates are R or I.} +\item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so resistance is only considered when isolates are R, not I. As this is the default behaviour of the \code{\link[=mdro]{mdro()}} function, it follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. When using \code{combine_SI = FALSE}, resistance is considered when isolates are R or I.} \item{verbose}{a logical to turn Verbose mode on and off (default is off). In Verbose mode, the function does not return the MDRO results, but instead returns a data set in logbook form with extensive info about which isolates would be MDRO-positive, or why they are not.} -\item{...}{column name of an antibiotic, see section Antibiotics} +\item{...}{column name of an antibiotic, please see section \emph{Antibiotics} below} } \value{ \itemize{ - \item{CMI 2012 paper - function \code{mdr_cmi2012()} or \code{mdro()}:\cr Ordered factor with levels \code{Negative < Multi-drug-resistant (MDR) < Extensively drug-resistant (XDR) < Pandrug-resistant (PDR)}} - \item{TB guideline - function \code{mdr_tb()} or \code{mdro(..., guideline = "TB")}:\cr Ordered factor with levels \code{Negative < Mono-resistant < Poly-resistant < Multi-drug-resistant < Extensively drug-resistant}} - \item{German guideline - function \code{mrgn()} or \code{mdro(..., guideline = "MRGN")}:\cr Ordered factor with levels \code{Negative < 3MRGN < 4MRGN}} - \item{Everything else:\cr Ordered factor with levels \code{Negative < Positive, unconfirmed < Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests} +\item CMI 2012 paper - function \code{\link[=mdr_cmi2012]{mdr_cmi2012()}} or \code{\link[=mdro]{mdro()}}:\cr +Ordered \code{\link{factor}} with levels \code{Negative} < \code{Multi-drug-resistant (MDR)} < \verb{Extensively drug-resistant (XDR)} < \code{Pandrug-resistant (PDR)} +\item TB guideline - function \code{\link[=mdr_tb]{mdr_tb()}} or \code{\link[=mdro]{mdro(..., guideline = "TB")}}:\cr +Ordered \code{\link{factor}} with levels \code{Negative} < \code{Mono-resistant} < \code{Poly-resistant} < \code{Multi-drug-resistant} < \verb{Extensively drug-resistant} +\item German guideline - function \code{\link[=mrgn]{mrgn()}} or \code{\link[=mdro]{mdro(..., guideline = "MRGN")}}:\cr +Ordered \code{\link{factor}} with levels \code{Negative} < \verb{3MRGN} < \verb{4MRGN} +\item Everything else:\cr +Ordered \code{\link{factor}} with levels \code{Negative} < \verb{Positive, unconfirmed} < \code{Positive}. The value \code{"Positive, unconfirmed"} means that, according to the guideline, it is not entirely sure if the isolate is multi-drug resistant and this should be confirmed with additional (e.g. molecular) tests } } \description{ @@ -65,117 +76,121 @@ For the \code{pct_required_classes} argument, values above 1 will be divided by Currently supported guidelines are (case-insensitive): \itemize{ - \item{\code{guideline = "CMI2012"}: Magiorakos AP, Srinivasan A \emph{et al.} "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (\href{https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext}{link})} - \item{\code{guideline = "EUCAST"}: The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link})} - \item{\code{guideline = "TB"}: The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link})} - \item{\code{guideline = "MRGN"}: The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6} - \item{\code{guideline = "BRMO"}: The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) [ZKH]" (\href{https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH}{link})} +\item \code{guideline = "CMI2012"}\cr +Magiorakos AP, Srinivasan A \emph{et al.} "Multidrug-resistant, extensively drug-resistant and pandrug-resistant bacteria: an international expert proposal for interim standard definitions for acquired resistance." Clinical Microbiology and Infection (2012) (\href{https://www.clinicalmicrobiologyandinfection.com/article/S1198-743X(14)61632-3/fulltext}{link}) +\item \code{guideline = "EUCAST"}\cr +The European international guideline - EUCAST Expert Rules Version 3.1 "Intrinsic Resistance and Exceptional Phenotypes Tables" (\href{http://www.eucast.org/fileadmin/src/media/PDFs/EUCAST_files/Expert_Rules/Expert_rules_intrinsic_exceptional_V3.1.pdf}{link}) +\item \code{guideline = "TB"}\cr +The international guideline for multi-drug resistant tuberculosis - World Health Organization "Companion handbook to the WHO guidelines for the programmatic management of drug-resistant tuberculosis" (\href{https://www.who.int/tb/publications/pmdt_companionhandbook/en/}{link}) +\item \code{guideline = "MRGN"}\cr +The German national guideline - Mueller et al. (2015) Antimicrobial Resistance and Infection Control 4:7. DOI: 10.1186/s13756-015-0047-6 +\item \code{guideline = "BRMO"}\cr +The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) \link{ZKH}" (\href{https://www.rivm.nl/Documenten_en_publicaties/Professioneel_Praktisch/Richtlijnen/Infectieziekten/WIP_Richtlijnen/WIP_Richtlijnen/Ziekenhuizen/WIP_richtlijn_BRMO_Bijzonder_Resistente_Micro_Organismen_ZKH}{link}) } Please suggest your own (country-specific) guidelines by letting us know: \url{https://gitlab.com/msberends/AMR/issues/new}. -\strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{mdro()} function makes sure that results from before 2016 and after 2016 are identical. +\strong{Note:} Every test that involves the Enterobacteriaceae family, will internally be performed using its newly named order Enterobacterales, since the Enterobacteriaceae family has been taxonomically reclassified by Adeolu \emph{et al.} in 2016. Before that, Enterobacteriaceae was the only family under the Enterobacteriales (with an i) order. All species under the old Enterobacteriaceae family are still under the new Enterobacterales (without an i) order, but divided into multiple families. The way tests are performed now by this \code{\link[=mdro]{mdro()}} function makes sure that results from before 2016 and after 2016 are identical. } \section{Antibiotics}{ -To define antibiotics column names, leave as it is to determine it automatically with \code{\link{guess_ab_col}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. +To define antibiotics column names, leave as it is to determine it automatically with \code{\link[=guess_ab_col]{guess_ab_col()}} or input a text (case-insensitive), or use \code{NULL} to skip a column (e.g. \code{TIC = NULL} to skip ticarcillin). Manually defined but non-existing columns will be skipped with a warning. -The following antibiotics are used for the functions \code{\link{eucast_rules}} and \code{\link{mdro}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: +The following antibiotics are used for the functions \code{\link[=eucast_rules]{eucast_rules()}} and \code{\link[=mdro]{mdro()}}. These are shown below in the format '\strong{antimicrobial ID}: name (\href{https://www.whocc.no/atc/structure_and_principles/}{ATC code})', sorted by name: - \strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), - \strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), - \strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}), - \strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}), - \strong{SAM}: ampicillin/sulbactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR01}{J01CR01}), - \strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}), - \strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}), - \strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}), - \strong{CAP}: capreomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB30}{J04AB30}), - \strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}), - \strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}), - \strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}), - \strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}), - \strong{CTT}: cefotetan (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC05}{J01DC05}), - \strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}), - \strong{CPT}: ceftaroline (\href{https://www.whocc.no/atc_ddd_index/?code=J01DI02}{J01DI02}), - \strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}), - \strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}), - \strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}), - \strong{CED}: cephradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}), - \strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}), - \strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}), - \strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}), - \strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}), - \strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}), - \strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}), - \strong{DOR}: doripenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH04}{J01DH04}), - \strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}), - \strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}), - \strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}), - \strong{ETH}: ethambutol (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK02}{J04AK02}), - \strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}), - \strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}), - \strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}), - \strong{GAT}: gatifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA16}{J01MA16}), - \strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}), - \strong{GEH}: gentamicin-high (no ATC code), - \strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}), - \strong{INH}: isoniazid (\href{https://www.whocc.no/atc_ddd_index/?code=J04AC01}{J04AC01}), - \strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}), - \strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}), - \strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}), - \strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}), - \strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}), - \strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01XD01}{J01XD01}), - \strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}), - \strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}), - \strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}), - \strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}), - \strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}), - \strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}), - \strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}), - \strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}), - \strong{NOV}: novobiocin (\href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}), - \strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}), - \strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF04}{J01CF04}), - \strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}), - \strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}), - \strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}), - \strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}), - \strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}), - \strong{PZA}: pyrazinamide (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK01}{J04AK01}), - \strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}), - \strong{RIB}: rifabutin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB04}{J04AB04}), - \strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}), - \strong{RFP}: rifapentine (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB05}{J04AB05}), - \strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}), - \strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}), - \strong{STH}: streptomycin-high (no ATC code), - \strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}), - \strong{TLV}: telavancin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA03}{J01XA03}), - \strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}), - \strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}), - \strong{TCC}: ticarcillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR03}{J01CR03}), - \strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}), - \strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}), - \strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}), - \strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}), - \strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}). +\strong{AMK}: amikacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB06}{J01GB06}), +\strong{AMX}: amoxicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA04}{J01CA04}), +\strong{AMC}: amoxicillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR02}{J01CR02}), +\strong{AMP}: ampicillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA01}{J01CA01}), +\strong{SAM}: ampicillin/sulbactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR01}{J01CR01}), +\strong{AZM}: azithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA10}{J01FA10}), +\strong{AZL}: azlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA09}{J01CA09}), +\strong{ATM}: aztreonam (\href{https://www.whocc.no/atc_ddd_index/?code=J01DF01}{J01DF01}), +\strong{CAP}: capreomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB30}{J04AB30}), +\strong{RID}: cefaloridine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB02}{J01DB02}), +\strong{CZO}: cefazolin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB04}{J01DB04}), +\strong{FEP}: cefepime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DE01}{J01DE01}), +\strong{CTX}: cefotaxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD01}{J01DD01}), +\strong{CTT}: cefotetan (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC05}{J01DC05}), +\strong{FOX}: cefoxitin (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC01}{J01DC01}), +\strong{CPT}: ceftaroline (\href{https://www.whocc.no/atc_ddd_index/?code=J01DI02}{J01DI02}), +\strong{CAZ}: ceftazidime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD02}{J01DD02}), +\strong{CRO}: ceftriaxone (\href{https://www.whocc.no/atc_ddd_index/?code=J01DD04}{J01DD04}), +\strong{CXM}: cefuroxime (\href{https://www.whocc.no/atc_ddd_index/?code=J01DC02}{J01DC02}), +\strong{CED}: cephradine (\href{https://www.whocc.no/atc_ddd_index/?code=J01DB09}{J01DB09}), +\strong{CHL}: chloramphenicol (\href{https://www.whocc.no/atc_ddd_index/?code=J01BA01}{J01BA01}), +\strong{CIP}: ciprofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA02}{J01MA02}), +\strong{CLR}: clarithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA09}{J01FA09}), +\strong{CLI}: clindamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF01}{J01FF01}), +\strong{COL}: colistin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB01}{J01XB01}), +\strong{DAP}: daptomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX09}{J01XX09}), +\strong{DOR}: doripenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH04}{J01DH04}), +\strong{DOX}: doxycycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA02}{J01AA02}), +\strong{ETP}: ertapenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH03}{J01DH03}), +\strong{ERY}: erythromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA01}{J01FA01}), +\strong{ETH}: ethambutol (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK02}{J04AK02}), +\strong{FLC}: flucloxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF05}{J01CF05}), +\strong{FOS}: fosfomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX01}{J01XX01}), +\strong{FUS}: fusidic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XC01}{J01XC01}), +\strong{GAT}: gatifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA16}{J01MA16}), +\strong{GEN}: gentamicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB03}{J01GB03}), +\strong{GEH}: gentamicin-high (no ATC code), +\strong{IPM}: imipenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH51}{J01DH51}), +\strong{INH}: isoniazid (\href{https://www.whocc.no/atc_ddd_index/?code=J04AC01}{J04AC01}), +\strong{KAN}: kanamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB04}{J01GB04}), +\strong{LVX}: levofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA12}{J01MA12}), +\strong{LIN}: lincomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FF02}{J01FF02}), +\strong{LNZ}: linezolid (\href{https://www.whocc.no/atc_ddd_index/?code=J01XX08}{J01XX08}), +\strong{MEM}: meropenem (\href{https://www.whocc.no/atc_ddd_index/?code=J01DH02}{J01DH02}), +\strong{MTR}: metronidazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01XD01}{J01XD01}), +\strong{MEZ}: mezlocillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA10}{J01CA10}), +\strong{MNO}: minocycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA08}{J01AA08}), +\strong{MFX}: moxifloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA14}{J01MA14}), +\strong{NAL}: nalidixic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01MB02}{J01MB02}), +\strong{NEO}: neomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB05}{J01GB05}), +\strong{NET}: netilmicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB07}{J01GB07}), +\strong{NIT}: nitrofurantoin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XE01}{J01XE01}), +\strong{NOR}: norfloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA06}{J01MA06}), +\strong{NOV}: novobiocin (\href{https://www.whocc.no/atc_ddd_index/?code=QJ01XX95}{QJ01XX95}), +\strong{OFX}: ofloxacin (\href{https://www.whocc.no/atc_ddd_index/?code=J01MA01}{J01MA01}), +\strong{OXA}: oxacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CF04}{J01CF04}), +\strong{PEN}: penicillin G (\href{https://www.whocc.no/atc_ddd_index/?code=J01CE01}{J01CE01}), +\strong{PIP}: piperacillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA12}{J01CA12}), +\strong{TZP}: piperacillin/tazobactam (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR05}{J01CR05}), +\strong{PLB}: polymyxin B (\href{https://www.whocc.no/atc_ddd_index/?code=J01XB02}{J01XB02}), +\strong{PRI}: pristinamycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG01}{J01FG01}), +\strong{PZA}: pyrazinamide (\href{https://www.whocc.no/atc_ddd_index/?code=J04AK01}{J04AK01}), +\strong{QDA}: quinupristin/dalfopristin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FG02}{J01FG02}), +\strong{RIB}: rifabutin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB04}{J04AB04}), +\strong{RIF}: rifampicin (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB02}{J04AB02}), +\strong{RFP}: rifapentine (\href{https://www.whocc.no/atc_ddd_index/?code=J04AB05}{J04AB05}), +\strong{RXT}: roxithromycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01FA06}{J01FA06}), +\strong{SIS}: sisomicin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB08}{J01GB08}), +\strong{STH}: streptomycin-high (no ATC code), +\strong{TEC}: teicoplanin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA02}{J01XA02}), +\strong{TLV}: telavancin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA03}{J01XA03}), +\strong{TCY}: tetracycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA07}{J01AA07}), +\strong{TIC}: ticarcillin (\href{https://www.whocc.no/atc_ddd_index/?code=J01CA13}{J01CA13}), +\strong{TCC}: ticarcillin/clavulanic acid (\href{https://www.whocc.no/atc_ddd_index/?code=J01CR03}{J01CR03}), +\strong{TGC}: tigecycline (\href{https://www.whocc.no/atc_ddd_index/?code=J01AA12}{J01AA12}), +\strong{TOB}: tobramycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01GB01}{J01GB01}), +\strong{TMP}: trimethoprim (\href{https://www.whocc.no/atc_ddd_index/?code=J01EA01}{J01EA01}), +\strong{SXT}: trimethoprim/sulfamethoxazole (\href{https://www.whocc.no/atc_ddd_index/?code=J01EE01}{J01EE01}), +\strong{VAN}: vancomycin (\href{https://www.whocc.no/atc_ddd_index/?code=J01XA01}{J01XA01}). } \section{Interpretation of S, I and R}{ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". - \itemize{ - \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} - \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} - \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.} +\item \strong{S} - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent. +\item \strong{I} - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. +\item \strong{R} - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure. } Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } \section{Read more on our website!}{ diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd index f8f1fbb15..34c0dc79e 100755 --- a/man/microorganisms.Rd +++ b/man/microorganisms.Rd @@ -5,38 +5,38 @@ \alias{microorganisms} \title{Data set with ~70,000 microorganisms} \format{A \code{\link{data.frame}} with 69,447 observations and 16 variables: -\describe{ - \item{\code{mo}}{ID of microorganism as used by this package} - \item{\code{col_id}}{Catalogue of Life ID} - \item{\code{fullname}}{Full name, like \code{"Escherichia coli"}} - \item{\code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, \code{genus}, \code{species}, \code{subspecies}}{Taxonomic rank of the microorganism} - \item{\code{rank}}{Text of the taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"}} - \item{\code{ref}}{Author(s) and year of concerning scientific publication} - \item{\code{species_id}}{ID of the species as used by the Catalogue of Life} - \item{\code{source}}{Either "CoL", "DSMZ" (see Source) or "manually added"} - \item{\code{prevalence}}{Prevalence of the microorganism, see \code{?as.mo}} +\itemize{ +\item \code{mo}\cr ID of microorganism as used by this package +\item \code{col_id}\cr Catalogue of Life ID +\item \code{fullname}\cr Full name, like \code{"Escherichia coli"} +\item \code{kingdom}, \code{phylum}, \code{class}, \code{order}, \code{family}, \code{genus}, \code{species}, \code{subspecies}\cr Taxonomic rank of the microorganism +\item \code{rank}\cr Text of the taxonomic rank of the microorganism, like \code{"species"} or \code{"genus"} +\item \code{ref}\cr Author(s) and year of concerning scientific publication +\item \code{species_id}\cr ID of the species as used by the Catalogue of Life +\item \code{source}\cr Either "CoL", "DSMZ" (see Source) or "manually added" +\item \code{prevalence}\cr Prevalence of the microorganism, see \code{\link[=as.mo]{as.mo()}} }} \source{ -Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). +Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}). -Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, \url{http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date} (check included version with \code{\link{catalogue_of_life_version}()}). +Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, \url{http://www.dsmz.de/bacterial-diversity/prokaryotic-nomenclature-up-to-date} (check included version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}). } \usage{ microorganisms } \description{ -A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link{as.mo}}. +A data set containing the microbial taxonomy of six kingdoms from the Catalogue of Life. MO codes can be looked up using \code{\link[=as.mo]{as.mo()}}. } \details{ Manually added were: \itemize{ - \item{11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri)} - \item{2 entries of \emph{Staphylococcus} (coagulase-negative [CoNS] and coagulase-positive [CoPS])} - \item{3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus)} - \item{1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel \emph{et al.} 2005, PMID 15634993)} - \item{5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)} - \item{6 families under the Enterobacterales order, according to Adeolu \emph{et al.} (2016, PMID 27620848), that are not in the Catalogue of Life} - \item{12,600 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications} +\item 11 entries of \emph{Streptococcus} (beta-haemolytic: groups A, B, C, D, F, G, H, K and unspecified; other: viridans, milleri) +\item 2 entries of \emph{Staphylococcus} (coagulase-negative \link{CoNS} and coagulase-positive \link{CoPS}) +\item 3 entries of \emph{Trichomonas} (\emph{Trichomonas vaginalis}, and its family and genus) +\item 1 entry of \emph{Blastocystis} (\emph{Blastocystis hominis}), although it officially does not exist (Noel \emph{et al.} 2005, PMID 15634993) +\item 5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus) +\item 6 families under the Enterobacterales order, according to Adeolu \emph{et al.} (2016, PMID 27620848), that are not in the Catalogue of Life +\item 12,600 species from the DSMZ (Deutsche Sammlung von Mikroorganismen und Zellkulturen) since the DSMZ contain the latest taxonomic information based on recent publications } } \section{About the records from DSMZ (see source)}{ @@ -51,7 +51,7 @@ From: \url{https://www.dsmz.de/support/bacterial-nomenclature-up-to-date-downloa \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Read more on our website!}{ @@ -60,6 +60,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{as.mo}}, \code{\link{mo_property}}, \code{\link{microorganisms.codes}} +\code{\link[=as.mo]{as.mo()}}, \code{\link[=mo_property]{mo_property()}}, \link{microorganisms.codes} } \keyword{datasets} diff --git a/man/microorganisms.codes.Rd b/man/microorganisms.codes.Rd index 68932fa87..e3b8fdd66 100644 --- a/man/microorganisms.codes.Rd +++ b/man/microorganisms.codes.Rd @@ -5,22 +5,22 @@ \alias{microorganisms.codes} \title{Translation table for common microorganism codes} \format{A \code{\link{data.frame}} with 5,433 observations and 2 variables: -\describe{ - \item{\code{code}}{Commonly used code of a microorganism} - \item{\code{mo}}{ID of the microorganism in the \code{\link{microorganisms}} data set} +\itemize{ +\item \code{code}\cr Commonly used code of a microorganism +\item \code{mo}\cr ID of the microorganism in the \link{microorganisms} data set }} \usage{ microorganisms.codes } \description{ -A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link{set_mo_source}}. +A data set containing commonly used codes for microorganisms, from laboratory systems and WHONET. Define your own with \code{\link[=set_mo_source]{set_mo_source()}}. } \section{Catalogue of Life}{ \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Read more on our website!}{ @@ -29,6 +29,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{as.mo}} \code{\link{microorganisms}} +\code{\link[=as.mo]{as.mo()}} \link{microorganisms} } \keyword{datasets} diff --git a/man/microorganisms.old.Rd b/man/microorganisms.old.Rd index 17085c87c..4031d01c0 100644 --- a/man/microorganisms.old.Rd +++ b/man/microorganisms.old.Rd @@ -5,28 +5,28 @@ \alias{microorganisms.old} \title{Data set with previously accepted taxonomic names} \format{A \code{\link{data.frame}} with 24,246 observations and 5 variables: -\describe{ - \item{\code{col_id}}{Catalogue of Life ID that was originally given} - \item{\code{col_id_new}}{New Catalogue of Life ID that responds to an entry in the \code{\link{microorganisms}} data set} - \item{\code{fullname}}{Old full taxonomic name of the microorganism} - \item{\code{ref}}{Author(s) and year of concerning scientific publication} - \item{\code{prevalence}}{Prevalence of the microorganism, see \code{?as.mo}} +\itemize{ +\item \code{col_id}\cr Catalogue of Life ID that was originally given +\item \code{col_id_new}\cr New Catalogue of Life ID that responds to an entry in the \link{microorganisms} data set +\item \code{fullname}\cr Old full taxonomic name of the microorganism +\item \code{ref}\cr Author(s) and year of concerning scientific publication +\item \code{prevalence}\cr Prevalence of the microorganism, see \code{\link[=as.mo]{as.mo()}} }} \source{ -Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). +Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}). } \usage{ microorganisms.old } \description{ -A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by \code{\link{as.mo}}. +A data set containing old (previously valid or accepted) taxonomic names according to the Catalogue of Life. This data set is used internally by \code{\link[=as.mo]{as.mo()}}. } \section{Catalogue of Life}{ \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Read more on our website!}{ @@ -35,6 +35,6 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{as.mo}} \code{\link{mo_property}} \code{\link{microorganisms}} +\code{\link[=as.mo]{as.mo()}} \code{\link[=mo_property]{mo_property()}} \link{microorganisms} } \keyword{datasets} diff --git a/man/mo_property.Rd b/man/mo_property.Rd index 457a17fe4..08a5949a7 100644 --- a/man/mo_property.Rd +++ b/man/mo_property.Rd @@ -70,58 +70,57 @@ mo_url(x, open = FALSE, ...) mo_property(x, property = "fullname", language = get_locale(), ...) } \arguments{ -\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link{as.mo}}} +\item{x}{any (vector of) text that can be coerced to a valid microorganism code with \code{\link[=as.mo]{as.mo()}}} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} -\item{...}{other parameters passed on to \code{\link{as.mo}}} +\item{...}{other parameters passed on to \code{\link[=as.mo]{as.mo()}}} -\item{open}{browse the URL using \code{\link[utils]{browseURL}()}} +\item{open}{browse the URL using \code{\link[utils:browseURL]{utils::browseURL()}}} -\item{property}{one of the column names of the \code{\link{microorganisms}} data set or \code{"shortname"}} +\item{property}{one of the column names of the \link{microorganisms} data set or \code{"shortname"}} } \value{ \itemize{ - \item{An \code{integer} in case of \code{mo_year}} - \item{A \code{list} in case of \code{mo_taxonomy}} - \item{A named \code{character} in case of \code{mo_url}} - \item{A \code{character} in all other cases} +\item An \code{\link{integer}} in case of \code{\link[=mo_year]{mo_year()}} +\item A \code{\link{list}} in case of \code{\link[=mo_taxonomy]{mo_taxonomy()}} +\item A named \code{\link{character}} in case of \code{\link[=mo_url]{mo_url()}} +\item A \code{\link{character}} in all other cases } } \description{ -Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link{as.mo}}, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples. +Use these functions to return a specific property of a microorganism. All input values will be evaluated internally with \code{\link[=as.mo]{as.mo()}}, which makes it possible for input of these functions to use microbial abbreviations, codes and names. See Examples. } \details{ -All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{mo_ref}, \code{mo_authors} and \code{mo_year}. This leads to the following results: +All functions will return the most recently known taxonomic property according to the Catalogue of Life, except for \code{\link[=mo_ref]{mo_ref()}}, \code{\link[=mo_authors]{mo_authors()}} and \code{\link[=mo_year]{mo_year()}}. This leads to the following results: \itemize{ - \item{\code{mo_name("Chlamydia psittaci")} will return \code{"Chlamydophila psittaci"} (with a warning about the renaming)} - \item{\code{mo_ref("Chlamydia psittaci")} will return \code{"Page, 1968"} (with a warning about the renaming)} - \item{\code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning)} +\item \code{mo_name("Chlamydia psittaci")} will return \code{"Chlamydophila psittaci"} (with a warning about the renaming) +\item \code{mo_ref("Chlamydia psittaci")} will return \code{"Page, 1968"} (with a warning about the renaming) +\item \code{mo_ref("Chlamydophila psittaci")} will return \code{"Everett et al., 1999"} (without a warning) } -The Gram stain - \code{mo_gramstain()} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}. +The Gram stain - \code{\link[=mo_gramstain]{mo_gramstain()}} - will be determined on the taxonomic kingdom and phylum. According to Cavalier-Smith (2002) who defined subkingdoms Negibacteria and Posibacteria, only these phyla are Posibacteria: Actinobacteria, Chloroflexi, Firmicutes and Tenericutes. These bacteria are considered Gram positive - all other bacteria are considered Gram negative. Species outside the kingdom of Bacteria will return a value \code{NA}. All output will be \link{translate}d where possible. -The function \code{mo_url()} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. +The function \code{\link[=mo_url]{mo_url()}} will return the direct URL to the online database entry, which also shows the scientific reference of the concerned species. } \section{Catalogue of Life}{ \if{html}{\figure{logo_col.png}{options: height=40px style=margin-bottom:5px} \cr} This package contains the complete taxonomic tree of almost all microorganisms (~70,000 species) from the authoritative and comprehensive Catalogue of Life (\url{http://www.catalogueoflife.org}). The Catalogue of Life is the most comprehensive and authoritative global index of species currently available. -\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link{catalogue_of_life_version}()}. +\link[=catalogue_of_life]{Click here} for more information about the included taxa. Check which version of the Catalogue of Life was included in this package with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}. } \section{Source}{ -[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] Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028} - -[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{http://www.catalogueoflife.org} (check included annual version with \code{\link{catalogue_of_life_version}()}). +\enumerate{ +\item 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} +\item Becker K \emph{et al.} \strong{Implications of identifying the recently defined members of the \emph{S. aureus} complex, \emph{S. argenteus} and \emph{S. schweitzeri}: A position paper of members of the ESCMID Study Group for staphylococci and Staphylococcal Diseases (ESGS).} 2019. Clin Microbiol Infect. \url{https://doi.org/10.1016/j.cmi.2019.02.028} +\item 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} +\item Catalogue of Life: Annual Checklist (public online taxonomic database), \url{http://www.catalogueoflife.org} (check included annual version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}). +} } \section{Read more on our website!}{ @@ -209,10 +208,10 @@ mo_fullname("S. pyogenes", # get a list with the complete taxonomy (from kingdom to subspecies) mo_taxonomy("E. coli") -# get a list with the taxonomy, the authors and the URL to the online database +# get a list with the taxonomy, the authors, Gram-stain and URL to the online database mo_info("E. coli") } } \seealso{ -\code{\link{microorganisms}} +\link{microorganisms} } diff --git a/man/mo_source.Rd b/man/mo_source.Rd index 9a51ae7b3..30fc5effc 100644 --- a/man/mo_source.Rd +++ b/man/mo_source.Rd @@ -14,24 +14,21 @@ get_mo_source() \item{path}{location of your reference file, see Details} } \description{ -These functions can be used to predefine your own reference to be used in \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}. +These functions can be used to predefine your own reference to be used in \code{\link[=as.mo]{as.mo()}} and consequently all \verb{mo_*} functions like \code{\link[=mo_genus]{mo_genus()}} and \code{\link[=mo_gramstain]{mo_gramstain()}}. This is \strong{the fastest way} to have your organisation (or analysis) specific codes picked up and translated by this package. } \details{ The reference file can be a text file seperated with commas (CSV) or tabs or pipes, an Excel file (either 'xls' or 'xlsx' format) or an R object file (extension '.rds'). To use an Excel file, you need to have the \code{readxl} package installed. -\code{set_mo_source} will check the file for validity: it must be a \code{data.frame}, must have a column named \code{"mo"} which contains values from \code{microorganisms$mo} and must have a reference column with your own defined values. If all tests pass, \code{set_mo_source} will read the file into R and export it to \code{"~/.mo_source.rds"}. This compressed data file will then be used at default for MO determination (function \code{\link{as.mo}} and consequently all \code{mo_*} functions like \code{\link{mo_genus}} and \code{\link{mo_gramstain}}). The location of the original file will be saved as option with \code{\link{options}(mo_source = path)}. Its timestamp will be saved with \code{\link{options}(mo_source_datetime = ...)}. +\code{\link[=set_mo_source]{set_mo_source()}} will check the file for validity: it must be a \code{\link{data.frame}}, must have a column named \code{"mo"} which contains values from \code{\link[=microorganisms]{microorganisms$mo}} and must have a reference column with your own defined values. If all tests pass, \code{\link[=set_mo_source]{set_mo_source()}} will read the file into R and export it to \code{"~/.mo_source.rds"}. This compressed data file will then be used at default for MO determination (function \code{\link[=as.mo]{as.mo()}} and consequently all \verb{mo_*} functions like \code{\link[=mo_genus]{mo_genus()}} and \code{\link[=mo_gramstain]{mo_gramstain()}}). The location of the original file will be saved as option with \code{options(mo_source = path)}. Its timestamp will be saved with \code{options(mo_source_datetime = ...)}. -\code{get_mo_source} will return the data set by reading \code{"~/.mo_source.rds"} with \code{\link{readRDS}}. If the original file has changed (the file defined with \code{path}), it will call \code{set_mo_source} to update the data file automatically. +\code{\link[=get_mo_source]{get_mo_source()}} will return the data set by reading \code{"~/.mo_source.rds"} with \code{\link[=readRDS]{readRDS()}}. If the original file has changed (the file defined with \code{path}), it will call \code{\link[=set_mo_source]{set_mo_source()}} to update the data file automatically. -Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by \code{get_mo_source} in only a couple of microseconds (a millionth of a second). -} -\section{How it works}{ +Reading an Excel file (\code{.xlsx}) with only one row has a size of 8-9 kB. The compressed file used by this package will have a size of 0.1 kB and can be read by \code{\link[=get_mo_source]{get_mo_source()}} in only a couple of microseconds (a millionth of a second). +\subsection{How it works}{ -Imagine this data on a sheet of an Excel file (mo codes were looked up in the `microorganisms` data set). The first column contains the organisation specific codes, the second column contains an MO code from this package: -\preformatted{ - | A | B | +Imagine this data on a sheet of an Excel file (mo codes were looked up in the \code{microorganisms} data set). The first column contains the organisation specific codes, the second column contains an MO code from this package:\preformatted{ | A | B | --|--------------------|-------------| 1 | Organisation XYZ | mo | 2 | lab_mo_ecoli | B_ESCHR_COL | @@ -39,56 +36,46 @@ Imagine this data on a sheet of an Excel file (mo codes were looked up in the `m 4 | | | } -We save it as \code{'home/me/ourcodes.xlsx'}. Now we have to set it as a source: -\preformatted{ -set_mo_source("home/me/ourcodes.xlsx") +We save it as \code{"home/me/ourcodes.xlsx"}. Now we have to set it as a source:\preformatted{set_mo_source("home/me/ourcodes.xlsx") # Created mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. } -It has now created a file "~/.mo_source.rds" with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept. +It has now created a file \code{"~/.mo_source.rds"} with the contents of our Excel file, but only the first column with foreign values and the 'mo' column will be kept. -And now we can use it in our functions: -\preformatted{ -as.mo("lab_mo_ecoli") -[1] B_ESCHR_COL +And now we can use it in our functions:\preformatted{as.mo("lab_mo_ecoli") +\[1\] B_ESCHR_COLI mo_genus("lab_mo_kpneumoniae") [1] "Klebsiella" # other input values still work too as.mo(c("Escherichia coli", "E. coli", "lab_mo_ecoli")) -[1] B_ESCHR_COL B_ESCHR_COL B_ESCHR_COL +[1] B_ESCHR_COLI B_ESCHR_COLI B_ESCHR_COLI } -If we edit the Excel file to, let's say, this: -\preformatted{ - | A | B | ---|--------------------|-------------| -1 | Organisation XYZ | mo | -2 | lab_mo_ecoli | B_ESCHR_COL | -3 | lab_mo_kpneumoniae | B_KLBSL_PNE | -4 | lab_Staph_aureus | B_STPHY_AUR | -5 | | | +If we edit the Excel file to, let's say, this:\preformatted{ | A | B | +--|--------------------|--------------| +1 | Organisation XYZ | mo | +2 | lab_mo_ecoli | B_ESCHR_COLI | +3 | lab_mo_kpneumoniae | B_KLBSL_PNMN | +4 | lab_Staph_aureus | B_STPHY_AURS | +5 | | | } -...any new usage of an MO function in this package will update your data: -\preformatted{ -as.mo("lab_mo_ecoli") +...any new usage of an MO function in this package will update your data:\preformatted{as.mo("lab_mo_ecoli") # Updated mo_source file '~/.mo_source.rds' from 'home/me/ourcodes.xlsx'. -[1] B_ESCHR_COL +[1] B_ESCHR_COLI mo_genus("lab_Staph_aureus") [1] "Staphylococcus" } -To remove the reference completely, just use any of these: -\preformatted{ -set_mo_source("") +To remove the reference completely, just use any of these:\preformatted{set_mo_source("") set_mo_source(NULL) # Removed mo_source file '~/.mo_source.rds'. } } - +} \section{Read more on our website!}{ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. diff --git a/man/p_symbol.Rd b/man/p_symbol.Rd index 8ed48cb9a..e432200da 100644 --- a/man/p_symbol.Rd +++ b/man/p_symbol.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/p_symbol.R \name{p_symbol} \alias{p_symbol} -\title{Symbol of a p value} +\title{Symbol of a p-value} \usage{ p_symbol(p, emptychar = " ") } @@ -15,7 +15,7 @@ p_symbol(p, emptychar = " ") Text } \description{ -Return the symbol related to the p value: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1. Values above \code{p = 1} will return \code{NA}. +Return the symbol related to the p-value: 0 '\verb{***}' 0.001 '\verb{**}' 0.01 '\code{*}' 0.05 '\code{.}' 0.1 ' ' 1. Values above \code{p = 1} will return \code{NA}. } \section{Read more on our website!}{ diff --git a/man/proportion.Rd b/man/proportion.Rd index 6d605ad94..7b4f46703 100644 --- a/man/proportion.Rd +++ b/man/proportion.Rd @@ -17,77 +17,79 @@ \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 4th Edition}, 2014, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. } \usage{ -resistance(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +resistance(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -susceptibility(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +susceptibility(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_R(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_R(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_IR(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_IR(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_I(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_I(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_SI(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_SI(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_S(..., minimum = 30, as_percent = FALSE, - only_all_tested = FALSE) +proportion_S(..., minimum = 30, as_percent = FALSE, only_all_tested = FALSE) -proportion_df(data, translate_ab = "name", language = get_locale(), - minimum = 30, as_percent = FALSE, combine_SI = TRUE, - combine_IR = FALSE) +proportion_df( + data, + translate_ab = "name", + language = get_locale(), + minimum = 30, + as_percent = FALSE, + combine_SI = TRUE, + combine_IR = FALSE +) -rsi_df(data, translate_ab = "name", language = get_locale(), - minimum = 30, as_percent = FALSE, combine_SI = TRUE, - combine_IR = FALSE) +rsi_df( + data, + translate_ab = "name", + language = get_locale(), + minimum = 30, + as_percent = FALSE, + combine_SI = TRUE, + combine_IR = FALSE +) } \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{...}{one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with \code{\link[=as.rsi]{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 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\%"}.} -\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}) a logical to indicate that isolates must be tested for all antibiotics, see section \emph{Combination therapy} below} +\item{only_all_tested}{(for combination therapies, i.e. using more than one variable for \code{...}): a logical to indicate that isolates must be tested for all antibiotics, see section \emph{Combination therapy} below} -\item{data}{a \code{data.frame} containing columns with class \code{rsi} (see \code{\link{as.rsi}})} +\item{data}{a \code{\link{data.frame}} containing columns with class \code{\link{rsi}} (see \code{\link[=as.rsi]{as.rsi()}})} -\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations to, using \code{\link{ab_property}}} +\item{translate_ab}{a column name of the \link{antibiotics} data set to translate the antibiotic abbreviations to, using \code{\link[=ab_property]{ab_property()}}} -\item{language}{language of the returned text, defaults to system language (see \code{\link{get_locale}}) and can also be set with \code{\link{getOption}("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} +\item{language}{language of the returned text, defaults to system language (see \code{\link[=get_locale]{get_locale()}}) and can also be set with \code{getOption("AMR_locale")}. Use \code{language = NULL} or \code{language = ""} to prevent translation.} \item{combine_SI}{a logical to indicate whether all values of S and I must be merged into one, so the output only consists of S+I vs. R (susceptible vs. resistant). This used to be the parameter \code{combine_IR}, but this now follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below. Default is \code{TRUE}.} \item{combine_IR}{a logical to indicate whether all values of I and R must be merged into one, so the output only consists of S vs. I+R (susceptible vs. non-susceptible). This is outdated, see parameter \code{combine_SI}.} } \value{ -Double or, when \code{as_percent = TRUE}, a character. +A \code{\link{double}} or, when \code{as_percent = TRUE}, a \code{\link{character}}. } \description{ -These functions can be used to calculate the (co-)resistance or susceptibility 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}. +These functions can be used to calculate the (co-)resistance or susceptibility of microbial isolates (i.e. percentage of S, SI, I, IR or R). All functions support quasiquotation with pipes, can be used in \code{\link[dplyr:summarise]{dplyr::summarise()}} and support grouped variables, please see \emph{Examples}. -\code{resistance()} should be used to calculate resistance, \code{susceptibility()} should be used to calculate susceptibility.\cr +\code{\link[=resistance]{resistance()}} should be used to calculate resistance, \code{\link[=susceptibility]{susceptibility()}} should be used to calculate susceptibility.\cr } \details{ -The function \code{resistance()} is equal to the function \code{proportion_R()}. The function \code{susceptibility()} is equal to the function \code{proportion_SI()}. - -\strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link{first_isolate}} to determine them in your data set. +The function \code{\link[=resistance]{resistance()}} is equal to the function \code{\link[=proportion_R]{proportion_R()}}. The function \code{\link[=susceptibility]{susceptibility()}} is equal to the function \code{\link[=proportion_SI]{proportion_SI()}}. -These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[AMR]{count}} functions to count isolates. The function \code{susceptibility()} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can infuence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).} +\strong{Remember that you should filter your table to let it contain only first isolates!} This is needed to exclude duplicates and to reduce selection bias. Use \code{\link[=first_isolate]{first_isolate()}} to determine them in your data set. -The function \code{proportion_df()} takes any variable from \code{data} that has an \code{"rsi"} class (created with \code{\link{as.rsi}()}) and calculates the proportions R, I and S. The function \code{rsi_df()} works exactly like \code{proportion_df()}, but adds the number of isolates. +These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[AMR:count]{AMR::count()}} functions to count isolates. The function \code{\link[=susceptibility]{susceptibility()}} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can infuence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} parameter).} + +The function \code{\link[=proportion_df]{proportion_df()}} takes any variable from \code{data} that has an \code{\link{rsi}} class (created with \code{\link[=as.rsi]{as.rsi()}}) and calculates the proportions R, I and S. The function \code{\link[=rsi_df]{rsi_df()}} works exactly like \code{\link[=proportion_df]{proportion_df()}}, but adds the number of isolates. } \section{Combination therapy}{ -When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{susceptibility} works to calculate the \%SI: - -\preformatted{ --------------------------------------------------------------------- +When using more than one variable for \code{...} (= combination therapy)), use \code{only_all_tested} to only count isolates that are tested for all antibiotics/variables that you test them for. See this example for two antibiotics, Antibiotic A and Antibiotic B, about how \code{\link[=susceptibility]{susceptibility()}} works to calculate the \%SI:\preformatted{-------------------------------------------------------------------- only_all_tested = FALSE only_all_tested = TRUE ----------------------- ----------------------- Drug A Drug B include as include as include as include as @@ -105,14 +107,11 @@ When using more than one variable for \code{...} (= combination therapy)), use \ -------------------------------------------------------------------- } -Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that: -\preformatted{ - count_S() + count_I() + count_R() = count_all() +Please note that, in combination therapies, for \code{only_all_tested = TRUE} applies that:\preformatted{ count_S() + count_I() + count_R() = count_all() proportion_S() + proportion_I() + proportion_R() = 1 } -and that, in combination therapies, for \code{only_all_tested = FALSE} applies that: -\preformatted{ - count_S() + count_I() + count_R() >= count_all() + +and that, in combination therapies, for \code{only_all_tested = FALSE} applies that:\preformatted{ count_S() + count_I() + count_R() >= count_all() proportion_S() + proportion_I() + proportion_R() >= 1 } @@ -122,16 +121,15 @@ Using \code{only_all_tested} has no impact when only using one antibiotic as inp \section{Interpretation of S, I and R}{ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". - \itemize{ - \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} - \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} - \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.} +\item \strong{S} - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent. +\item \strong{I} - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. +\item \strong{R} - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure. } Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } \section{Read more on our website!}{ @@ -222,5 +220,5 @@ my_table \%>\% } } \seealso{ -\code{\link[AMR]{count}_*} to count resistant and susceptible isolates. +\code{\link[AMR:count]{AMR::count()}} to count resistant and susceptible isolates. } diff --git a/man/read.4D.Rd b/man/read.4D.Rd index f6b7fcf39..319c5779c 100644 --- a/man/read.4D.Rd +++ b/man/read.4D.Rd @@ -4,11 +4,24 @@ \alias{read.4D} \title{Read data from 4D database} \usage{ -read.4D(file, info = interactive(), header = TRUE, row.names = NULL, - sep = "\\t", quote = "\\"'", dec = ",", na.strings = c("NA", "", - "."), skip = 2, check.names = TRUE, strip.white = TRUE, - fill = TRUE, blank.lines.skip = TRUE, stringsAsFactors = FALSE, - fileEncoding = "UTF-8", encoding = "UTF-8") +read.4D( + file, + info = interactive(), + header = TRUE, + row.names = NULL, + sep = "\\t", + quote = "\\"'", + dec = ",", + na.strings = c("NA", "", "."), + skip = 2, + check.names = TRUE, + strip.white = TRUE, + fill = TRUE, + blank.lines.skip = TRUE, + stringsAsFactors = FALSE, + fileEncoding = "UTF-8", + encoding = "UTF-8" +) } \arguments{ \item{file}{the name of the file which the data are to be read from. @@ -117,7 +130,7 @@ read.4D(file, info = interactive(), header = TRUE, row.names = NULL, } } \description{ -This function is only useful for the MMB department of the UMCG. Use this function to \strong{import data by just defining the \code{file} parameter}. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with \code{\link{as.mo}} and transform all antimicrobial columns with \code{\link{as.rsi}}. +This function is only useful for the MMB department of the UMCG. Use this function to \strong{import data by just defining the \code{file} parameter}. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with \code{\link[=as.mo]{as.mo()}} and transform all antimicrobial columns with \code{\link[=as.rsi]{as.rsi()}}. } \details{ Column names will be transformed, but the original column names are set as a "label" attribute and can be seen in e.g. RStudio Viewer. diff --git a/man/resistance_predict.Rd b/man/resistance_predict.Rd index c29ef00cd..0a8a2d1bf 100644 --- a/man/resistance_predict.Rd +++ b/man/resistance_predict.Rd @@ -7,24 +7,49 @@ \alias{ggplot_rsi_predict} \title{Predict antimicrobial resistance} \usage{ -resistance_predict(x, col_ab, col_date = NULL, year_min = NULL, - year_max = NULL, year_every = 1, minimum = 30, model = NULL, - I_as_S = TRUE, preserve_measurements = TRUE, info = TRUE, ...) +resistance_predict( + x, + col_ab, + col_date = NULL, + year_min = NULL, + year_max = NULL, + year_every = 1, + minimum = 30, + model = NULL, + I_as_S = TRUE, + preserve_measurements = TRUE, + info = TRUE, + ... +) -rsi_predict(x, col_ab, col_date = NULL, year_min = NULL, - year_max = NULL, year_every = 1, minimum = 30, model = NULL, - I_as_S = TRUE, preserve_measurements = TRUE, info = TRUE, ...) +rsi_predict( + x, + col_ab, + col_date = NULL, + year_min = NULL, + year_max = NULL, + year_every = 1, + minimum = 30, + model = NULL, + I_as_S = TRUE, + preserve_measurements = TRUE, + info = TRUE, + ... +) -\method{plot}{resistance_predict}(x, - main = paste("Resistance Prediction of", x_name), ...) +\method{plot}{resistance_predict}(x, main = paste("Resistance Prediction of", x_name), ...) -ggplot_rsi_predict(x, main = paste("Resistance Prediction of", x_name), - ribbon = TRUE, ...) +ggplot_rsi_predict( + x, + main = paste("Resistance Prediction of", x_name), + ribbon = TRUE, + ... +) } \arguments{ -\item{x}{a \code{data.frame} containing isolates.} +\item{x}{a \code{\link{data.frame}} containing isolates.} -\item{col_ab}{column name of \code{x} with antimicrobial interpretations (\code{R}, \code{I} and \code{S})} +\item{col_ab}{column name of \code{x} containing antimicrobial interpretations (\code{"R"}, \code{"I"} and \code{"S"})} \item{col_date}{column name of the date, will be used to calculate years if this column doesn't consist of years already, defaults to the first column of with a date class} @@ -36,13 +61,13 @@ ggplot_rsi_predict(x, main = paste("Resistance Prediction of", x_name), \item{minimum}{minimal amount of available isolates per year to include. Years containing less observations will be estimated by the model.} -\item{model}{the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using \code{\link{glm}(..., family = \link{binomial})}), assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.} +\item{model}{the statistical model of choice. This could be a generalised linear regression model with binomial distribution (i.e. using `glm(..., family = binomial)``, assuming that a period of zero resistance was followed by a period of increasing resistance leading slowly to more and more resistance. See Details for all valid options.} -\item{I_as_S}{a logical to indicate whether values \code{I} should be treated as \code{S} (will otherwise be treated as \code{R}). The default, \code{TRUE}, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section 'Interpretation of S, I and R' below.} +\item{I_as_S}{a logical to indicate whether values \code{I} should be treated as \code{S} (will otherwise be treated as \code{R}). The default, \code{TRUE}, follows the redefinition by EUCAST about the interpretion of I (increased exposure) in 2019, see section \emph{Interpretation of S, I and R} below.} \item{preserve_measurements}{a logical to indicate whether predictions of years that are actually available in the data should be overwritten by the original data. The standard errors of those years will be \code{NA}.} -\item{info}{a logical to indicate whether textual analysis should be printed with the name and \code{\link{summary}} of the statistical model.} +\item{info}{a logical to indicate whether textual analysis should be printed with the name and \code{\link[=summary]{summary()}} of the statistical model.} \item{...}{parameters passed on to functions} @@ -51,42 +76,42 @@ ggplot_rsi_predict(x, main = paste("Resistance Prediction of", x_name), \item{ribbon}{a logical to indicate whether a ribbon should be shown (default) or error bars} } \value{ -\code{data.frame} with extra class \code{"resistance_predict"} with columns: +A \code{\link{data.frame}} with extra class \code{\link{resistance_predict}} with columns: \itemize{ - \item{\code{year}} - \item{\code{value}, the same as \code{estimated} when \code{preserve_measurements = FALSE}, and a combination of \code{observed} and \code{estimated} otherwise} - \item{\code{se_min}, the lower bound of the standard error with a minimum of \code{0} (so the standard error will never go below 0\%)} - \item{\code{se_max} the upper bound of the standard error with a maximum of \code{1} (so the standard error will never go above 100\%)} - \item{\code{observations}, the total number of available observations in that year, i.e. S + I + R} - \item{\code{observed}, the original observed resistant percentages} - \item{\code{estimated}, the estimated resistant percentages, calculated by the model} +\item \code{year} +\item \code{value}, the same as \code{estimated} when \code{preserve_measurements = FALSE}, and a combination of \code{observed} and \code{estimated} otherwise +\item \code{se_min}, the lower bound of the standard error with a minimum of \code{0} (so the standard error will never go below 0\%) +\item \code{se_max} the upper bound of the standard error with a maximum of \code{1} (so the standard error will never go above 100\%) +\item \code{observations}, the total number of available observations in that year, i.e. \eqn{S + I + R} +\item \code{observed}, the original observed resistant percentages +\item \code{estimated}, the estimated resistant percentages, calculated by the model } -Furthermore, the model itself is available as an attribute: \code{attributes(x)$model}, see Examples. + +Furthermore, the model itself is available as an attribute: \code{attributes(x)$model}, please see \emph{Examples}. } \description{ -Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns \code{se_min} and \code{se_max}. See Examples for a real live example. +Create a prediction model to predict antimicrobial resistance for the next years on statistical solid ground. Standard errors (SE) will be returned as columns \code{se_min} and \code{se_max}. See \emph{Examples} for a real live example. } \details{ -Valid options for the statistical model are: +Valid options for the statistical model (parameter \code{model}) are: \itemize{ - \item{\code{"binomial"} or \code{"binom"} or \code{"logit"}: a generalised linear regression model with binomial distribution} - \item{\code{"loglin"} or \code{"poisson"}: a generalised log-linear regression model with poisson distribution} - \item{\code{"lin"} or \code{"linear"}: a linear regression model} +\item \code{"binomial"} or \code{"binom"} or \code{"logit"}: a generalised linear regression model with binomial distribution +\item \code{"loglin"} or \code{"poisson"}: a generalised log-linear regression model with poisson distribution +\item \code{"lin"} or \code{"linear"}: a linear regression model } } \section{Interpretation of S, I and R}{ In 2019, the European Committee on Antimicrobial Susceptibility Testing (EUCAST) has decided to change the definitions of susceptibility testing categories S, I and R as shown below (\url{http://www.eucast.org/newsiandr/}). Results of several consultations on the new definitions are available on the EUCAST website under "Consultations". - \itemize{ - \item{\strong{S} - }{Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent.} - \item{\strong{I} - }{Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection.} - \item{\strong{R} - }{Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure.} +\item \strong{S} - Susceptible, standard dosing regimen: A microorganism is categorised as "Susceptible, standard dosing regimen", when there is a high likelihood of therapeutic success using a standard dosing regimen of the agent. +\item \strong{I} - Susceptible, increased exposure: A microorganism is categorised as "Susceptible, Increased exposure" when there is a high likelihood of therapeutic success because exposure to the agent is increased by adjusting the dosing regimen or by its concentration at the site of infection. +\item \strong{R} - Resistant: A microorganism is categorised as "Resistant" when there is a high likelihood of therapeutic failure even when there is increased exposure. } Exposure is a function of how the mode of administration, dose, dosing interval, infusion time, as well as distribution and excretion of the antimicrobial agent will influence the infecting organism at the site of infection. -This AMR package honours this new insight. Use \code{\link{susceptibility}()} (equal to \code{\link{proportion_SI}()}) to determine antimicrobial susceptibility and \code{\link{count_susceptible}()} (equal to \code{\link{count_SI}()}) to count susceptible isolates. +This AMR package honours this new insight. Use \code{\link[=susceptibility]{susceptibility()}} (equal to \code{\link[=proportion_SI]{proportion_SI()}}) to determine antimicrobial susceptibility and \code{\link[=count_susceptible]{count_susceptible()}} (equal to \code{\link[=count_SI]{count_SI()}}) to count susceptible isolates. } \section{Read more on our website!}{ @@ -95,7 +120,10 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \examples{ -x <- resistance_predict(example_isolates, col_ab = "AMX", year_min = 2010, model = "binomial") +x <- resistance_predict(example_isolates, + col_ab = "AMX", + year_min = 2010, + model = "binomial") plot(x) ggplot_rsi_predict(x) @@ -134,13 +162,15 @@ if (!require(ggplot2)) { scale_y_continuous(limits = c(0, 1), breaks = seq(0, 1, 0.1), labels = paste0(seq(0, 100, 10), "\%")) + - labs(title = expression(paste("Forecast of amoxicillin resistance in ", + labs(title = expression(paste("Forecast of Amoxicillin Resistance in ", italic("E. coli"))), - y = "\%IR", + y = "\%R", x = "Year") + theme_minimal(base_size = 13) } } \seealso{ -The \code{\link{portion}} function to calculate resistance, \cr \code{\link{lm}} \code{\link{glm}} +The \code{\link[=proportion]{proportion()}} functions to calculate resistance + +Models: \code{\link[=lm]{lm()}} \code{\link[=glm]{glm()}} } diff --git a/man/rsi_translation.Rd b/man/rsi_translation.Rd index 2c558b744..673e03e26 100644 --- a/man/rsi_translation.Rd +++ b/man/rsi_translation.Rd @@ -5,22 +5,22 @@ \alias{rsi_translation} \title{Data set for RSI interpretation} \format{A \code{\link{data.frame}} with 13,975 observations and 9 variables: -\describe{ - \item{\code{guideline}}{Name of the guideline} - \item{\code{method}}{Either "MIC" or "DISK"} - \item{\code{site}}{Body site, e.g. "Oral" or "Respiratory"} - \item{\code{mo}}{Microbial ID, see \code{\link{as.mo}}} - \item{\code{ab}}{Antibiotic ID, see \code{\link{as.ab}}} - \item{\code{ref_tbl}}{Info about where the guideline rule can be found} - \item{\code{disk_dose}}{Dose of the used disk diffusion method} - \item{\code{breakpoint_S}}{Lowest MIC value or highest number of millimeters that leads to "S"} - \item{\code{breakpoint_R}}{Highest MIC value or lowest number of millimeters that leads to "R"} +\itemize{ +\item \code{guideline}\cr Name of the guideline +\item \code{method}\cr Either "MIC" or "DISK" +\item \code{site}\cr Body site, e.g. "Oral" or "Respiratory" +\item \code{mo}\cr Microbial ID, see \code{\link[=as.mo]{as.mo()}} +\item \code{ab}\cr Antibiotic ID, see \code{\link[=as.ab]{as.ab()}} +\item \code{ref_tbl}\cr Info about where the guideline rule can be found +\item \code{disk_dose}\cr Dose of the used disk diffusion method +\item \code{breakpoint_S}\cr Lowest MIC value or highest number of millimeters that leads to "S" +\item \code{breakpoint_R}\cr Highest MIC value or lowest number of millimeters that leads to "R" }} \usage{ rsi_translation } \description{ -Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link{as.rsi}} to transform MICs or disks measurements to RSI values. +Data set to interpret MIC and disk diffusion to RSI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2019). Use \code{\link[=as.rsi]{as.rsi()}} to transform MICs or disks measurements to RSI values. } \section{Read more on our website!}{ diff --git a/man/skewness.Rd b/man/skewness.Rd index a5efcdaf0..e78e00d44 100644 --- a/man/skewness.Rd +++ b/man/skewness.Rd @@ -16,7 +16,7 @@ skewness(x, na.rm = FALSE) \method{skewness}{data.frame}(x, na.rm = FALSE) } \arguments{ -\item{x}{a vector of values, a \code{matrix} or a \code{data frame}} +\item{x}{a vector of values, a \code{\link{matrix}} or a \code{\link{data.frame}}} \item{na.rm}{a logical value indicating whether \code{NA} values should be stripped before the computation proceeds.} } @@ -31,5 +31,5 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https:// } \seealso{ -\code{\link{kurtosis}} +\code{\link[=kurtosis]{kurtosis()}} } diff --git a/man/translate.Rd b/man/translate.Rd index 54476b533..d1bbd23bb 100644 --- a/man/translate.Rd +++ b/man/translate.Rd @@ -8,7 +8,7 @@ get_locale() } \description{ -For language-dependent output of AMR functions, like \code{\link{mo_name}}, \code{\link{mo_type}} and \code{\link{ab_name}}. +For language-dependent output of AMR functions, like \code{\link[=mo_name]{mo_name()}}, \code{\link[=mo_type]{mo_type()}} and \code{\link[=ab_name]{ab_name()}}. } \details{ Strings will be translated to foreign languages if they are defined in a local translation file. Additions to this file can be suggested at our repository. The file can be found here: \url{https://gitlab.com/msberends/AMR/blob/master/data-raw/translations.tsv}. @@ -17,9 +17,9 @@ Currently supported languages can be found if running: \code{unique(AMR:::transl Please suggest your own translations \href{https://gitlab.com/msberends/AMR/issues/new?issue[title]=Translation\%20suggestion}{by creating a new issue on our repository}. -This file will be read by all functions where a translated output can be desired, like all \code{\link{mo_property}} functions (\code{\link{mo_fullname}}, \code{\link{mo_type}}, etc.). +This file will be read by all functions where a translated output can be desired, like all \code{\link[=mo_property]{mo_property()}} functions (\code{\link[=mo_fullname]{mo_fullname()}}, \code{\link[=mo_type]{mo_type()}}, etc.). -The system language will be used at default, if that language is supported. The system language can be overwritten with \code{\link{getOption}("AMR_locale")}. +The system language will be used at default, if that language is supported. The system language can be overwritten with \code{Sys.setenv(AMR_locale = yourlanguage)}. } \section{Read more on our website!}{ diff --git a/tests/testthat/test-mo_history.R b/tests/testthat/test-mo_history.R index 04d83ed57..92f06634b 100644 --- a/tests/testthat/test-mo_history.R +++ b/tests/testthat/test-mo_history.R @@ -18,27 +18,3 @@ # ANY WARRANTY OR LIABILITY. # # Visit our website for more info: https://msberends.gitlab.io/AMR. # # ==================================================================== # - -# context("mo_history.R") -# -# test_that("mo_history works", { -# clean_mo_history(force = TRUE) -# expect_equal(read_mo_history(force = TRUE), -# NULL) -# -# expect_equal(as.character(suppressWarnings(as.mo("testsubject"))), "UNKNOWN") -# -# set_mo_history("testsubject", "B_ESCHR_COL", -# uncertainty_level = translate_allow_uncertain(TRUE), -# force = TRUE) -# -# expect_equal(get_mo_history("testsubject", -# uncertainty_level = translate_allow_uncertain(TRUE), -# force = TRUE), -# "B_ESCHR_COL") -# -# expect_equal(as.character(as.mo("testsubject", force_mo_history = TRUE)), "B_ESCHR_COL") -# -# expect_equal(colnames(read_mo_history(force = TRUE)), -# c("x", "mo", "uncertainty_level", "package_v")) -# })