1
0
mirror of https://github.com/msberends/AMR.git synced 2026-07-19 11:10:54 +02:00
This commit is contained in:
2026-06-23 00:21:40 +02:00
parent 3d3f06be24
commit 57e45db320
120 changed files with 121694 additions and 94170 deletions

View File

@@ -81,12 +81,13 @@ test_that("test-data.R", {
}
}
AMR:::add_MO_lookup_to_AMR_env()
df <- AMR:::AMR_env$MO_lookup
expect_true(all(c(
"mo", "fullname", "status", "kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies", "rank", "ref", "source",
"lpsn", "lpsn_parent", "lpsn_renamed_to", "gbif", "gbif_parent", "gbif_renamed_to", "prevalence",
"snomed", "kingdom_index", "fullname_lower", "full_first", "species_first"
"snomed", "domain_index", "fullname_lower", "full_first", "species_first"
) %in% colnames(df)))
expect_inherits(AMR:::MO_CONS, "mo")

View File

@@ -30,8 +30,7 @@
test_that("test-mo_property.R", {
skip_on_cran()
expect_equal(mo_kingdom("Escherichia coli"), "Bacteria")
expect_equal(mo_kingdom("Escherichia coli"), mo_domain("Escherichia coli"))
expect_equal(mo_kingdom("Escherichia coli"), "Pseudomonadati")
expect_equal(mo_phylum("Escherichia coli"), "Pseudomonadota")
expect_equal(mo_class("Escherichia coli"), "Gammaproteobacteria")
expect_equal(mo_order("Escherichia coli"), "Enterobacterales")
@@ -71,12 +70,13 @@ test_that("test-mo_property.R", {
"Erysipelotrichia",
"Ktedonobacteria",
"Limnochordia",
"Limnocylindria",
"Mollicutes",
"Negativicutes",
"Nitriliruptoria",
"Rubrobacteria",
"Syntrophomonadia",
"Tepidiformia",
"Thermaerobacteria",
"Thermoflexia",
"Thermoleophilia",
"Thermolithobacteria"
@@ -92,7 +92,7 @@ test_that("test-mo_property.R", {
expect_equal(mo_gramstain("Escherichia coli", language = "en"), "Gram-negative")
expect_inherits(mo_taxonomy("Escherichia coli"), "list")
expect_equal(names(mo_taxonomy("Escherichia coli")), c(
"kingdom", "phylum", "class", "order",
"domain", "kingdom", "phylum", "class", "order",
"family", "genus", "species", "subspecies"
))
expect_equal(mo_synonyms("Escherichia coli"), NULL)
@@ -100,8 +100,8 @@ test_that("test-mo_property.R", {
expect_inherits(mo_synonyms(c("Candida albicans", "Escherichia coli")), "list")
expect_equal(names(mo_info("Escherichia coli")), c(
"mo", "rank",
"kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies",
"status", "synonyms", "gramstain", "oxygen_tolerance",
"domain", "kingdom", "phylum", "class", "order", "family", "genus", "species", "subspecies",
"status", "synonyms", "gramstain", "morphology", "oxygen_tolerance",
"url", "ref", "snomed", "lpsn", "mycobank", "gbif", "group_members"
))
expect_inherits(mo_info(c("Escherichia coli", "Staphylococcus aureus")), "list")
@@ -115,7 +115,7 @@ test_that("test-mo_property.R", {
expect_equal(
as.character(table(mo_pathogenicity(example_isolates$mo))),
c("1911", "66", "1", "22")
c("1915", "62", "1", "22")
)
expect_equal(mo_ref("Escherichia coli"), "Castellani et al., 1919")
@@ -185,7 +185,7 @@ test_that("test-mo_property.R", {
c("Shimwellia blattae", "Escherichia coli")
)
expect_identical(mo_ref("Chlamydia psittaci"), "Garcia-Lopez et al., 2019")
expect_identical(mo_ref("Chlamydia psittaci"), "Page, 1968")
expect_identical(mo_ref("Chlamydophila psittaci", keep_synonyms = TRUE), "Everett et al., 1999")
expect_true(112283007 %in% mo_snomed("Escherichia coli")[[1]])