1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 02:03:04 +02:00

(v1.1.0.9020) updated taxonomy

This commit is contained in:
2020-05-27 16:37:49 +02:00
parent ae1969b941
commit 86d44054f0
55 changed files with 68063 additions and 70233 deletions

View File

@ -56,11 +56,11 @@ test_that("creation of data sets is valid", {
expect_lt(nrow(df[which(df$prevalence == 2), ]), nrow(df[which(df$prevalence == 3), ]))
expect_true(all(c("mo", "fullname",
"kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies",
"rank", "col_id", "species_id", "source", "ref", "prevalence",
"rank", "ref", "species_id", "source", "prevalence", "snomed",
"kingdom_index", "fullname_lower", "g_species") %in% colnames(df)))
olddf <- create_MO.old_lookup()
expect_true(all(c("col_id", "col_id_new", "fullname", "ref", "prevalence",
expect_true(all(c("fullname", "fullname_new", "ref", "prevalence",
"fullname_lower", "g_species") %in% colnames(olddf)))
old <- make_trans_tbl()

View File

@ -34,7 +34,6 @@ test_that("as.mo works", {
expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI")
expect_equal(as.character(as.mo("Escherichia coli")), "B_ESCHR_COLI")
expect_equal(as.character(as.mo(22242416)), "B_ESCHR_COLI")
expect_equal(as.character(as.mo(112283007)), "B_ESCHR_COLI")
expect_equal(as.character(as.mo("Escherichia species")), "B_ESCHR")
expect_equal(as.character(as.mo("Escherichia")), "B_ESCHR")
@ -45,7 +44,7 @@ test_that("as.mo works", {
expect_equal(as.character(as.mo("Klebsiella")), "B_KLBSL")
expect_equal(as.character(as.mo("K. pneu rhino")), "B_KLBSL_PNMN_RHNS") # K. pneumoniae subspp. rhinoscleromatis
expect_equal(as.character(as.mo("Bartonella")), "B_BRTNL")
expect_equal(as.character(as.mo("C. difficile")), "B_CTRDM_DFFC")
expect_equal(as.character(as.mo("C. difficile")), "B_CRDDS_DFFC")
expect_equal(as.character(as.mo("L. pneumophila")), "B_LGNLL_PNMP")
expect_equal(as.character(as.mo("Strepto")), "B_STRPT")
expect_equal(as.character(as.mo("Streptococcus")), "B_STRPT") # not Peptostreptoccus
@ -99,11 +98,11 @@ test_that("as.mo works", {
# unprevalent MO
expect_identical(
as.character(
as.mo(c("burnod",
"B. nodosa",
"B nodosa",
"Burkholderia nodosa"))),
rep("B_BRKHL_NODS", 4))
as.mo(c("parnod",
"P. nodosa",
"P nodosa",
"Paraburkholderia nodosa"))),
rep("B_PRBRK_NODS", 4))
# empty values
expect_identical(as.character(as.mo(c("", NA, NaN))), rep(NA_character_, 3))
@ -239,7 +238,7 @@ test_that("as.mo works", {
# Salmonella (City) are all actually Salmonella enterica spp (City)
expect_equal(suppressWarnings(mo_name(c("Salmonella Goettingen", "Salmonella Typhimurium", "Salmonella Group A"))),
c("Salmonella enterica", "Salmonella typhimurium", "Salmonella"))
c("Salmonella enterica", "Salmonella enterica", "Salmonella"))
# no virusses
expect_equal(as.character(as.mo("Virus")), NA_character_)

View File

@ -93,8 +93,7 @@ test_that("mo_property works", {
expect_identical(suppressWarnings(mo_ref("Chlamydia psittaci")), "Page, 1968")
expect_identical(mo_ref("Chlamydophila psittaci"), "Everett et al., 1999")
expect_equal(mo_snomed("Escherichia coli"),
c(112283007, 116395006, 116396007, 103429008, 83285000, 116394005, 407166006, 457914007))
expect_equal(mo_snomed("Escherichia coli"), 112283007)
# old codes must throw a warning in mo_* family
expect_warning(mo_name(c("B_ESCHR_COL", "B_STPHY_AUR")))