1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 07:26:13 +01:00
AMR/data-raw/internals.R

43 lines
2.2 KiB
R
Raw Normal View History

2019-06-01 20:40:49 +02:00
# EUCAST rules ----
# For editing the reference file, these values can all be used for target antibiotics:
# "aminoglycosides", "tetracyclines", "polymyxins", "macrolides", "glycopeptides",
# "streptogramins", "cephalosporins", "cephalosporins_without_CAZ", "carbapenems",
# "minopenicillins", "ureidopenicillins", "fluoroquinolones", "all_betalactams",
# and all separate EARS-Net letter codes like "AMC". They can be separated by comma: "AMC, fluoroquinolones".
# The mo_property can be any column name from the AMR::microorganisms data set, or "genus_species" or "gramstain".
2019-06-11 14:18:25 +02:00
# The EUCAST guideline contains references to the 'Burkholderia cepacia complex'. The species in this group can be found in:
# LiPuma JJ, Curr Opin Pulm Med. 2005 Nov;11(6):528-33. (PMID 16217180).
2019-06-01 20:40:49 +02:00
eucast_rules_file <- dplyr::arrange(
.data = utils::read.delim(file = "data-raw/eucast_rules.tsv",
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
strip.white = TRUE,
na = c(NA, "", NULL)),
reference.rule_group,
reference.rule)
# Translations -----
translations_file <- utils::read.delim(file = "data-raw/translations.tsv",
2019-06-01 20:40:49 +02:00
sep = "\t",
stringsAsFactors = FALSE,
header = TRUE,
blank.lines.skip = TRUE,
fill = TRUE,
strip.white = TRUE,
encoding = "UTF-8",
fileEncoding = "UTF-8",
na.strings = c(NA, "", NULL),
allowEscapes = TRUE, # else "\\1" will be imported as "\\\\1"
quote = "")
2019-06-01 20:40:49 +02:00
# Export to package as internal data ----
usethis::use_data(eucast_rules_file, translations_file,
internal = TRUE,
overwrite = TRUE,
version = 2)
# Remove from global environment ----
rm(eucast_rules_file)
rm(translations_file)