As a consequence, very old microbial codes (from AMR v0.5.0 and lower) are not supported anymore. Use as.mo() on your microorganism names or codes to transform them to current abbreviations used in this package.
Dramatic improvement of the algorithm behind as.ab(), making many more input errors translatable, such as digitalised health care records, using too few or too many vowels or consonants and many more
Added progress bar
@@ -277,17 +283,15 @@
The as.ab() function will now throw a note if more than 1 antimicrobial drug could be retrieved from a single input value.
-
Fixed a bug where eucast_rules() would not work on a tibble when the tibble or dplyr package was loaded
-
All *_join_microorganisms() functions and bug_drug_combinations() now return the original data class (e.g. tibbles and data.tables)
-
Fixed a bug for using grouped versions of rsi_df(), proportion_df() and count_df(), and fixed a bug where not all different antimicrobial results were added as rows
-
Improved auto-determination for columns of types <mo> and <Date>
-
Fixed a bug where eucast_rules() would not work on a tibble when the tibble or dplyr package was loaded
+
All *_join_microorganisms() functions and bug_drug_combinations() now return the original data class (e.g. tibbles and data.tables)
+
Fixed a bug for using grouped versions of rsi_df(), proportion_df() and count_df(), and fixed a bug where not all different antimicrobial results were added as rows
+
Improved auto-determination for columns of types <mo> and <Date>
@@ -306,7 +306,7 @@
C (Chromista), F (Fungi), P (Protozoa)
-
Values that cannot be coered will be considered 'unknown' and will get the MO code UNKNOWN.
+
Values that cannot be coerced will be considered 'unknown' and will get the MO code UNKNOWN.
Use the mo_* 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:
@@ -327,17 +327,17 @@
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.:
+
The level of uncertainty can be set using the argument allow_uncertain. The default is allow_uncertain = TRUE, which is equal to uncertainty level 2. Using allow_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.
+
With the default setting (allow_uncertain = TRUE, level 2), below examples will lead to valid results:
"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.
"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.
-
The level of uncertainty can be set using the argument allow_uncertain. The default is allow_uncertain = TRUE, which is equal to uncertainty level 2. Using allow_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 a data.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 a data.frame with all values that could be coerced based on an old, previously accepted taxonomic name.
+
There are three helper functions that can be run after using the as.mo() function:
+
Use mo_uncertainties() to get a data.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 full taxonomic name of the microorganism, and L is the Levenshtein distance between that full name and the user input.
+
Use mo_failures() to get a charactervector with all values that could not be coerced to a valid value.
+
Use mo_renamed() to get a data.frame with all values that could be coerced based on old, previously accepted taxonomic names.
@@ -345,9 +345,9 @@
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.
+
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 Klebsiella, Pseudomonas and Legionella.
+
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. This group consequently contains all less common and rare human pathogens.
+
Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans.
@@ -282,7 +282,7 @@ The lifecycle of this function is maturing<
# [1] "tetr"guess_ab_col(df, "J01AA07", verbose=TRUE)
-# Note: Using column `tetr` as input for "J01AA07".
+# NOTE: Using column `tetr` as input for `J01AA07` (tetracycline).# [1] "tetr"# WHONET codes
diff --git a/docs/reference/index.html b/docs/reference/index.html
index 546c551a..7ef22ddb 100644
--- a/docs/reference/index.html
+++ b/docs/reference/index.html
@@ -81,7 +81,7 @@
AMR (for R)
- 1.2.0.9034
+ 1.2.0.9035
Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; doi: 10.1099/ijsem.0.002786
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))
3 entries of Trichomonas (Trichomonas vaginalis, and its family and genus)
+
1 entry of Candida (Candida krusei), that is not (yet) in the Catalogue of Life
1 entry of Blastocystis (Blastocystis hominis), although it officially does not exist (Noel et al. 2005, PMID 15634993)
5 other 'undefined' entries (unknown, unknown Gram negatives, unknown Gram positives, unknown yeast and unknown fungus)
6 families under the Enterobacterales order, according to Adeolu et al. (2016, PMID 27620848), that are not (yet) in the Catalogue of Life
@@ -284,8 +285,9 @@
-
Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
+(from https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date/complete-list-readme)
+
In February 2020, the DSMZ records were merged with the List of Prokaryotic names with Standing in Nomenclature (LPSN).
The repository of this AMR package contains a file comprising this exact data set: https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This file allows for machine reading EUCAST and CLSI guidelines, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
+
The repository of this AMR package contains a file comprising this exact data set: https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt. This file allows for machine reading EUCAST and CLSI guidelines, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically.
Read more on our website!
diff --git a/git_premaster.sh b/git_premaster.sh
index 1aa872dd..38ac696a 100755
--- a/git_premaster.sh
+++ b/git_premaster.sh
@@ -85,7 +85,7 @@ if [ -z "$3" ]; then
# combine tag (e.g. 0.1.0) and commit number (like 40) increased by 9000 to indicate beta version
new_version="$current_tag.$((current_commit + 9000))" # results in 0.1.0.9040
# add date to 2nd line of NEWS.md when no version number was set
- sed -i -- "2s/.*/## \Last updated: $(date '+%d-%b-%Y')\<\/small\>/" NEWS.md
+ sed -i -- "2s/.*/## \Last updated: $(date '+%e %B %Y')\<\/small\>/" NEWS.md
else
# version number set in command
new_version=$3
diff --git a/man/as.mo.Rd b/man/as.mo.Rd
index 49dacd78..7a1b9295 100644
--- a/man/as.mo.Rd
+++ b/man/as.mo.Rd
@@ -44,7 +44,7 @@ This excludes \emph{Enterococci} at default (who are in group D), use \code{Lanc
\item{...}{other parameters passed on to functions}
}
\value{
-A \code{\link{character}} vector with class \code{\link{mo}}
+A \code{\link{character}} \code{\link{vector}} with additional class \code{\link{mo}}
}
\description{
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}.
@@ -66,7 +66,7 @@ A microorganism ID from this package (class: \code{\link{mo}}) typically looks l
C (Chromista), F (Fungi), P (Protozoa)
}
-Values that cannot be coered will be considered 'unknown' and will get the MO code \code{UNKNOWN}.
+Values that cannot be coerced will be considered 'unknown' and will get the MO code \code{UNKNOWN}.
Use the \code{\link[=mo_property]{mo_*}} functions to get properties based on the returned code, see Examples.
@@ -92,20 +92,20 @@ In addition, the \code{\link[=as.mo]{as.mo()}} function can differentiate four l
\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.:
+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.
+
+With the default setting (\code{allow_uncertain = TRUE}, level 2), below examples will lead to valid results:
\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.
}
-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{\link[=as.mo]{as.mo()}} function:
+There are three helper functions that can be run after using the \code{\link[=as.mo]{as.mo()}} function:
\itemize{
-\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.
+\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 full taxonomic 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{character}} \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 old, previously accepted taxonomic names.
}
}
@@ -113,11 +113,11 @@ There are three helper functions that can be run after then \code{\link[=as.mo]{
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 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 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{Klebsiella}, \emph{Pseudomonas} and \emph{Legionella}.
-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 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}. This group consequently contains all less common and rare human pathogens.
-Group 3 (least prevalent microorganisms) consists of all other microorganisms.
+Group 3 (least prevalent microorganisms) consists of all other microorganisms. This group contains microorganisms most probably not found in humans.
}
}
\section{Source}{
diff --git a/man/guess_ab_col.Rd b/man/guess_ab_col.Rd
index a6893c4a..71b1931a 100644
--- a/man/guess_ab_col.Rd
+++ b/man/guess_ab_col.Rd
@@ -43,7 +43,7 @@ guess_ab_col(df, "J01AA07") # ATC code of tetracycline
# [1] "tetr"
guess_ab_col(df, "J01AA07", verbose = TRUE)
-# Note: Using column `tetr` as input for "J01AA07".
+# NOTE: Using column `tetr` as input for `J01AA07` (tetracycline).
# [1] "tetr"
# WHONET codes
diff --git a/man/microorganisms.Rd b/man/microorganisms.Rd
index a23c19dd..afd9f2c7 100755
--- a/man/microorganisms.Rd
+++ b/man/microorganisms.Rd
@@ -3,9 +3,9 @@
\docType{data}
\name{microorganisms}
\alias{microorganisms}
-\title{Data set with 67,150 microorganisms}
+\title{Data set with 67,151 microorganisms}
\format{
-A \code{\link{data.frame}} with 67,150 observations and 16 variables:
+A \code{\link{data.frame}} with 67,151 observations and 16 variables:
\itemize{
\item \code{mo}\cr ID of microorganism as used by this package
\item \code{fullname}\cr Full name, like \code{"Escherichia coli"}
@@ -23,7 +23,7 @@ Catalogue of Life: Annual Checklist (public online taxonomic database), \url{htt
Parte, A.C. (2018). LPSN — List of Prokaryotic names with Standing in Nomenclature (bacterio.net), 20 years on. International Journal of Systematic and Evolutionary Microbiology, 68, 1825-1829; doi: 10.1099/ijsem.0.002786
-Leibniz Institute DSMZ-German Collection of Microorganisms and Cell Cultures, Germany, Prokaryotic Nomenclature Up-to-Date, \url{https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date} (check included 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{https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date} and \url{https://lpsn.dsmz.de} (check included version with \code{\link[=catalogue_of_life_version]{catalogue_of_life_version()}}).
}
\usage{
microorganisms
@@ -37,6 +37,7 @@ Manually added were:
\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{Candida} (\emph{Candida krusei}), that is not (yet) in the Catalogue of Life
\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 (yet) in the Catalogue of Life
@@ -58,8 +59,9 @@ The file in R format (with preserved data structure) can be found here:
\section{About the records from DSMZ (see source)}{
Names of prokaryotes are defined as being validly published by the International Code of Nomenclature of Bacteria. Validly published are all names which are included in the Approved Lists of Bacterial Names and the names subsequently published in the International Journal of Systematic Bacteriology (IJSB) and, from January 2000, in the International Journal of Systematic and Evolutionary Microbiology (IJSEM) as original articles or in the validation lists.
+\emph{(from \url{https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date/complete-list-readme})}
-From: \url{https://www.dsmz.de/services/online-tools/prokaryotic-nomenclature-up-to-date/complete-list-readme}
+In February 2020, the DSMZ records were merged with the List of Prokaryotic names with Standing in Nomenclature (LPSN).
}
\section{Catalogue of Life}{
diff --git a/man/rsi_translation.Rd b/man/rsi_translation.Rd
index 23dd966b..7b2134f2 100644
--- a/man/rsi_translation.Rd
+++ b/man/rsi_translation.Rd
@@ -26,7 +26,7 @@ rsi_translation
Data set to interpret MIC and disk diffusion to R/SI values. Included guidelines are CLSI (2011-2019) and EUCAST (2011-2020). Use \code{\link[=as.rsi]{as.rsi()}} to transform MICs or disks measurements to R/SI values.
}
\details{
-The repository of this \code{AMR} package contains a file comprising this exact data set: \url{https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}. This file \strong{allows for machine reading EUCAST and CLSI guidelines}, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. This file is updated automatically.
+The repository of this \code{AMR} package contains a file comprising this exact data set: \url{https://github.com/msberends/AMR/blob/master/data-raw/rsi_translation.txt}. This file \strong{allows for machine reading EUCAST and CLSI guidelines}, which is almost impossible with the Excel and PDF files distributed by EUCAST and CLSI. The file is updated automatically.
}
\section{Read more on our website!}{
diff --git a/pkgdown/extra.js b/pkgdown/extra.js
index e2163abb..c1268b17 100644
--- a/pkgdown/extra.js
+++ b/pkgdown/extra.js
@@ -24,7 +24,7 @@
// Add updated Font Awesome 5.8.2 library
$('head').append('');
-$( document ).ready(function() {
+$(document).ready(function() {
// add SurveyMonkey
// $('body').append('');
@@ -90,8 +90,9 @@ $( document ).ready(function() {
}
$(".template-authors").html(doct_tit($(".template-authors").html()));
$(".template-citation-authors").html(doct_tit($(".template-citation-authors").html()));
+ $('.template-citation-authors h1').eq(0).text('How to cite');
+ $('.template-citation-authors h1').eq(1).text('All contributors');
$(".developers").html(doct_tit($(".developers").html()));
- // $("footer").html(doct_tit($("footer").html()));
// Edit title of manual
$('.template-reference-index h1').text('Manual');
diff --git a/tests/testthat/test-data.R b/tests/testthat/test-data.R
index ff5ab5d1..3f01a127 100644
--- a/tests/testthat/test-data.R
+++ b/tests/testthat/test-data.R
@@ -38,6 +38,7 @@ test_that("data sets are valid", {
expect_true(all(rsi_translation$mo %in% microorganisms$mo))
expect_false(any(is.na(microorganisms.codes$code)))
expect_false(any(is.na(microorganisms.codes$mo)))
+ expect_false(any(microorganisms.translation$mo_old %in% microorganisms$mo))
# antibiotic names must always be coercible to their original AB code
expect_identical(antibiotics$ab, as.ab(antibiotics$name))
@@ -62,10 +63,7 @@ test_that("creation of data sets is valid", {
olddf <- create_MO.old_lookup()
expect_true(all(c("fullname", "fullname_new", "ref", "prevalence",
"fullname_lower", "g_species") %in% colnames(olddf)))
-
- old <- make_trans_tbl()
- expect_gt(length(old), 0)
-
+
})
test_that("CoL version info works", {
diff --git a/tests/testthat/test-mo.R b/tests/testthat/test-mo.R
index 4006b6d0..61790de7 100644
--- a/tests/testthat/test-mo.R
+++ b/tests/testthat/test-mo.R
@@ -24,6 +24,8 @@ context("mo.R")
test_that("as.mo works", {
skip_on_cran()
+
+ library(dplyr)
MOs <- microorganisms %>% filter(!is.na(mo), nchar(mo) > 3)
expect_identical(as.character(MOs$mo), as.character(as.mo(MOs$mo)))
@@ -50,7 +52,6 @@ test_that("as.mo works", {
expect_equal(as.character(as.mo("Streptococcus")), "B_STRPT") # not Peptostreptoccus
expect_equal(as.character(as.mo("Estreptococos grupo B")), "B_STRPT_GRPB")
expect_equal(as.character(as.mo("Group B Streptococci")), "B_STRPT_GRPB")
- expect_equal(as.character(suppressWarnings(as.mo("B_STRPTC"))), "B_STRPT") # old MO code (<=v0.5.0)
expect_equal(as.character(suppressWarnings(as.mo("B_STRPT_PNE"))), "B_STRPT_PNMN") # old MO code (<=v0.8.0)
expect_equal(as.character(as.mo(c("GAS", "GBS"))), c("B_STRPT_GRPA", "B_STRPT_GRPB"))
@@ -144,9 +145,7 @@ test_that("as.mo works", {
expect_identical(as.character(as.mo("S. sanguinis", Lancefield = TRUE)), "B_STRPT_GRPH") # group H
expect_identical(as.character(as.mo("S. salivarius", Lancefield = FALSE)), "B_STRPT_SLVR")
expect_identical(as.character(as.mo("S. salivarius", Lancefield = TRUE)), "B_STRPT_GRPK") # group K
-
- library(dplyr)
-
+
# select with one column
expect_identical(
example_isolates[1:10, ] %>%
@@ -259,11 +258,7 @@ test_that("as.mo works", {
expect_true(example_isolates %>% pull(mo) %>% is.mo())
expect_error(translate_allow_uncertain(5))
-
- # very old MO codes (<= v0.5.0)
- expect_equal(suppressWarnings(as.character(as.mo("F_CCCCS_NEO"))), "F_CRYPT_NFRM")
- expect_equal(suppressWarnings(as.character(as.mo("F_CANDD_GLB"))), "F_CANDD_GLBR")
-
+
# debug mode
expect_output(print(suppressMessages(suppressWarnings(as.mo("kshgcjkhsdgkshjdfsfvsdfv", debug = TRUE, allow_uncertain = 3)))))