search_tol | R Documentation |
Query Kew's Tree of Life for specimens that have been sampled for sequencing.
search_tol(query = "", genes = FALSE, limit = 50, page = 1, .wait = 0.2)
query |
The string to query the database with. |
genes |
Set to TRUE to download results for genes instead of specimens. |
limit |
An integer specifying the number of results to return. |
page |
An integer specify the page of results to request. |
.wait |
Time to wait before making a requests, to help rate limiting. |
The Tree of Life is a database of specimens sequenced as part of Kew's efforts to build a comprehensive evolutionary tree of life for flowering plants.
The search API allows users to query the database for specimens
based on their taxonomic information. Filtering and keyword-search
are not currently implemented. All searches are based on taxonomic
information, so Myrcia
and Myrtales
will return results, but
Brummitt
will not.
The search API also allows users to download information about sequenced
genes. There is currently no ability to search within the results for genes,
but a table of all genes can be accessed using keyword argument genes=TRUE
.
Returns an object of class tol_search
that is a simple
structure with slots for:
total
: the total number of results held in ToL for the query.
page
: the page of results requested.
limit
: the maximum number of results requested from the API.
results
: the query results parsed into a list.
query
: the query string submitted to the API.
response
: the httr response object.
Baker W.J., Bailey P., Barber V., Barker A., Bellot S., Bishop D., Botigue L.R., Brewer G., Carruthers T., Clarkson J.J., Cook J., Cowan R.S., Dodsworth S., Epitawalage N., Francoso E., Gallego B., Johnson M., Kim J.T., Leempoel K., Maurin O., McGinnie C., Pokorny L., Roy S., Stone M., Toledo E., Wickett N.J., Zuntini A.R., Eiserhardt W.L., Kersey P.J., Leitch I.J. & Forest F. 2021. A Comprehensive Phylogenomic Platform for Exploring the Angiosperm Tree of Life. Systematic Biology, 2021; syab035, https://doi.org/10.1093/sysbio/syab035
# get the first 50 of all sequenced specimens search_tol(limit=50) # search for all sequenced Myrcia specimens search_tol("Myrcia") # get all sequenced specimens search_tol(limit=5000) # search for a species name and print the results r <- search_tol("Myrcia guianensis") print(r) # simplify search results to a `tibble` r <- search_tol("Myrcia") tidy(r) # gene stats are nested in the results r <- search_tol("Myrcia") tidied <- tidy(r) tidyr::unnest(tidied, cols=gene_stats) # species names are nested in the results r <- search_tol("Myrcia") tidied <- tidy(r) tidyr::unnest(tidied, cols=species, names_sep="_") # as is higher taxonomy r <- search_tol("Myrcia") tidied <- tidy(r) tidyr::unnest(tidied, cols=species, names_sep="_") # search for all gene entries and print results r <- search_tol(genes=TRUE, limit=500) print(r) # tidy the returned genes tidy(r)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.