Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ott names #87

Merged
merged 4 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions R/datelife_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ make_datelife_query <- function(input = c("Rhea americana", "Pterocnemia pennata
species_list <- get_opentree_species(taxon_name = cleaned_names_tnrs$unique_name,
ott_id = cleaned_names_tnrs$ott_id,
synth_tree_only = TRUE)
cleaned_names <- species_list$species_names
cleaned_names <- unname(species_list$tnrs_names)
ott_ids <- species_list$ott_ids
} else {
# example: df <- get_ott_children(ott_ids = 698424, ott_rank = "species")
Expand Down Expand Up @@ -169,7 +169,11 @@ make_datelife_query <- function(input = c("Rhea americana", "Pterocnemia pennata
ifelse(length(cleaned_names) <= 10,
".",
paste("... omitted ", length(cleaned_names) - 10, "taxon names.")))
message("DateLife query done!\n")
if(length(cleaned_names) < 1) {
message("ERROR: No names retained for search\n")
} else{
message("DateLife query made!\n")
}
return(structure(datelife_query_return, class = "datelifeQuery"))
}
#' Process a phylo object or a character string to determine if it's correct newick
Expand Down
2 changes: 1 addition & 1 deletion R/opentree_taxonomy.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ check_ott_input <- function(input = NULL, ott_ids = NULL, ...) {
message(input)
stop("OTT ids are NULL.")
}
if (is.numeric(input$ott_id) & !is.na(input$ott_id)) {
if (all(is.numeric(input$ott_id) & !is.na(input$ott_id))) {
ott_ids <- input$ott_ids
names(ott_ids) <- input$cleaned_names
} else {
Expand Down