Skip to content

Commit

Permalink
Merge pull request #87 from phylotastic/ott-names
Browse files Browse the repository at this point in the history
Ott names, woo!
  • Loading branch information
LunaSare authored Dec 16, 2023
2 parents 9a24cff + 40d87d4 commit 52005cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit 52005cd

Please sign in to comment.