From 6a25042c9b92a647e1a9d574907739fc9d8cfa48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?= Date: Tue, 13 Jun 2023 15:26:41 +0200 Subject: [PATCH 1/2] add score to hard-coded Mus --- R/opentree_taxonomy_general.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/opentree_taxonomy_general.R b/R/opentree_taxonomy_general.R index b33b4220..792991e0 100644 --- a/R/opentree_taxonomy_general.R +++ b/R/opentree_taxonomy_general.R @@ -50,7 +50,7 @@ tnrs_match.default <- function(input, reference_taxonomy = "ott", ...) { # enhan # cat("\n") # just to make the progress bar look better # hardcoding Mus: if (sum("mus" == tolower(input)) > 0) { - df["mus" == tolower(input), ] <- list("mus", "Mus (genus in Deuterostomia)", FALSE, 1068778, FALSE, "SIBLING_HIGHER", 3) + df["mus" == tolower(input), ] <- list("mus", "Mus (genus in Deuterostomia)", FALSE, 1, 1068778, FALSE, "SIBLING_HIGHER", 3) } rownames(df)[1] <- "1" # df[is.na(df$unique_name),1] <- input[is.na(df$unique_name)] # in case the unmatched input are dropped from final df From a561d7888f699f59c4586a0bda95e02b639452a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Michonneau?= Date: Thu, 15 Jun 2023 11:23:53 +0200 Subject: [PATCH 2/2] accommodate older rotl versions --- R/opentree_taxonomy_general.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/opentree_taxonomy_general.R b/R/opentree_taxonomy_general.R index 792991e0..b5eb13e2 100644 --- a/R/opentree_taxonomy_general.R +++ b/R/opentree_taxonomy_general.R @@ -50,7 +50,11 @@ tnrs_match.default <- function(input, reference_taxonomy = "ott", ...) { # enhan # cat("\n") # just to make the progress bar look better # hardcoding Mus: if (sum("mus" == tolower(input)) > 0) { - df["mus" == tolower(input), ] <- list("mus", "Mus (genus in Deuterostomia)", FALSE, 1, 1068778, FALSE, "SIBLING_HIGHER", 3) + if (packageVersion("rotl") >= 3.1.0) { + df["mus" == tolower(input), ] <- list("mus", "Mus (genus in Deuterostomia)", FALSE, 1, 1068778, FALSE, "SIBLING_HIGHER", 3) + } else { + df["mus" == tolower(input), ] <- list("mus", "Mus (genus in Deuterostomia)", FALSE, 1068778, FALSE, "SIBLING_HIGHER", 3) + } } rownames(df)[1] <- "1" # df[is.na(df$unique_name),1] <- input[is.na(df$unique_name)] # in case the unmatched input are dropped from final df