Request the record for a sequenced specimen or gene in ToL using its ToL ID.
lookup_tol(id, type = c("specimen", "gene"), .wait = 0.1)
A string containing a valid ToL ID.
The type of record to lookup, either specimen
or gene
.
Time to wait before making a request, to help rate limiting.
A tol_{type}
object, which is a simple structure with fields
for each of the fields returned by the lookup API,
as well as the the httr response object.
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 lookup API allows users to retrieve taxonomic and sequencing information for a specific sequenced specimen or gene using the unique ToL ID. If this is not known, it can be found out using the ToL search API.
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
search_tol()
to search ToL using taxonomic information.
download_tol()
to download a file from the ToL SFTP server.
load_tol()
load a file from the ToL SFTP server.
Other ToL functions:
download_tol()
,
load_tol()
# retrieve information for a particular specimen
lookup_tol("1296")
#> No encoding supplied: defaulting to UTF-8.
#> <ToL specimen id: 1296>
#> Species: Anisosepalum alboviolaceum
#> Family: Acanthaceae
#> Order: Lamiales
#> Collector: Champluvier, D.
#> Project: PAFTOL
#> No. of reads: 289,138
#> Sequencing platform: HiSeq
#> Suspicious placement: FALSE
# print a summary of the returned information
r <- lookup_tol("1296")
#> No encoding supplied: defaulting to UTF-8.
print(r)
#> <ToL specimen id: 1296>
#> Species: Anisosepalum alboviolaceum
#> Family: Acanthaceae
#> Order: Lamiales
#> Collector: Champluvier, D.
#> Project: PAFTOL
#> No. of reads: 289,138
#> Sequencing platform: HiSeq
#> Suspicious placement: FALSE
# tidy into a tibble
r <- lookup_tol("1296")
#> No encoding supplied: defaulting to UTF-8.
tidy(r)
#> # A tibble: 1 × 20
#> age collector collector_no country fasta_file_url gene_stats genus
#> <int> <chr> <chr> <lgl> <chr> <list> <lis>
#> 1 1995 Champluvier, D. 5295 NA http://sftp.kew.o… <tibble [… <tib…
#> # … with 13 more variables: herbcat_url <lgl>, id <int>,
#> # is_suspicious_placement <lgl>, material_source <list>,
#> # museum_barcode <lgl>, project <list>, raw_reads <list>, sequence_id <int>,
#> # species <list>, specimen_reference <chr>, specimen_source <chr>,
#> # taxonomy <list>, voucher_no <lgl>
# extract the returned gene stats for the specimen
r <- lookup_tol("1296")
#> No encoding supplied: defaulting to UTF-8.
tidied <- tidy(r)
tidied$gene_stats
#> [[1]]
#> # A tibble: 1 × 2
#> bp_recovered genes_recovered
#> <int> <int>
#> 1 136851 337
#>
# expand the taxonomy info
r <- lookup_tol("1296")
#> No encoding supplied: defaulting to UTF-8.
tidied <- tidy(r)
tidyr::unnest(tidied, cols=taxonomy, names_sep="_")
#> # A tibble: 1 × 23
#> age collector collector_no country fasta_file_url gene_stats genus
#> <int> <chr> <chr> <lgl> <chr> <list> <lis>
#> 1 1995 Champluvier, D. 5295 NA http://sftp.kew.o… <tibble [… <tib…
#> # … with 16 more variables: herbcat_url <lgl>, id <int>,
#> # is_suspicious_placement <lgl>, material_source <list>,
#> # museum_barcode <lgl>, project <list>, raw_reads <list>, sequence_id <int>,
#> # species <list>, specimen_reference <chr>, specimen_source <chr>,
#> # taxonomy_family <chr>, taxonomy_genus <chr>, taxonomy_order <chr>,
#> # taxonomy_species <chr>, voucher_no <lgl>
# retrieve information for a particular gene
lookup_tol("51", type="gene")
#> No encoding supplied: defaulting to UTF-8.
#> <ToL gene id: 51>
#> Exemplar name: AAAS
#> Exemplar source species: Arabidopsis thaliana (Mouse-ear cress)
#> No. species: 2905
#> No. genera: 2294
#> Avg. recovered length: 493.4949
#> Avg. % recovered: 86.3
# print a summary of the returned information
r <- lookup_tol("51", type="gene")
#> No encoding supplied: defaulting to UTF-8.
print(r)
#> <ToL gene id: 51>
#> Exemplar name: AAAS
#> Exemplar source species: Arabidopsis thaliana (Mouse-ear cress)
#> No. species: 2905
#> No. genera: 2294
#> Avg. recovered length: 493.4949
#> Avg. % recovered: 86.3
# tidy into a tibble
r <- lookup_tol("51", type="gene")
#> No encoding supplied: defaulting to UTF-8.
tidy(r)
#> # A tibble: 1 × 16
#> alignment_file_url average_contig_… average_contig_le… exemplar_access…
#> <chr> <dbl> <dbl> <chr>
#> 1 http://sftp.kew.org/pub/… 493. 86.3 Q8GWR1
#> # … with 12 more variables: exemplar_hyperlink <chr>, exemplar_name <chr>,
#> # exemplar_species <chr>, fasta_file_url <chr>, genera_count <int>, id <int>,
#> # internal_name <chr>, newick_file <chr>, newick_file_path_name <chr>,
#> # sequence_count <int>, species_count <int>, tree_file_url <chr>