search_tol: Search Kew's Tree of Life for specimens or genes.

View source: R/tol.R

search_tolR Documentation

Search Kew's Tree of Life for specimens or genes.

Description

Query Kew's Tree of Life for specimens that have been sampled for sequencing.

Usage

search_tol(query = "", genes = FALSE, limit = 50, page = 1, .wait = 0.2)

Arguments

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.

Details

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.

Value

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.

References

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

Examples

# 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)


barnabywalker/kewr documentation built on July 5, 2022, 5:37 p.m.