ropensci/rotl

Name: rotl

Owner: rOpenSci

Description: Interface to Open Tree of Life API

Created: 2014-09-16 02:46:12.0

Updated: 2017-03-21 20:18:49.0

Pushed: 2017-09-19 22:01:31.0

Homepage: null

Size: 841

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Build status codecov.io CRAN RStudio mirror downloads Research software impact

An R interface to Open Tree API

rotl is an R package to interact with the Open Tree of Life data APIs. It was initially developed as part of the NESCENT/OpenTree/Arbor hackathon.

Client libraries to interact with the Open Tree of Life API also exists for Python and Ruby.

Installation

The current stable version is available from CRAN, and can be installed by typing the following at the prompt in R:

all.packages("rotl")

If you want to test the development version, you first need to install ghit (ghit is a more lightweight version of devtools if your sole purpose is to install packages that are hosted on GitHub).

all.packages("ghit")

Then you can install rotl using:

ary(ghit) # or library(devtools)
all_github("ropensci/rotl")
Vignettes

There are three vignettes:

The vignettes are also available from CRAN: How to use rotl?, Data mashups, and Using the Open Tree synthesis in a comparative analysis.

Quick start
Get a little bit of the big Open Tree tree

Taxonomic names are represented in the Open Tree by numeric identifiers, the ott_ids (Open Tree Taxonomy identifiers). To extract a portion of a tree from the Open Tree, you first need to find ott_ids for a set of names using the tnrs_match_names function:

ary(rotl)
 <- c("Pongo", "Pan", "Gorilla", "Hoolock", "Homo")
olved_names <- tnrs_match_names(apes))
##   search_string unique_name approximate_match ott_id is_synonym flags
## 1         pongo       Pongo             FALSE 417949      FALSE      
## 2           pan         Pan             FALSE 417957      FALSE      
## 3       gorilla     Gorilla             FALSE 417969      FALSE      
## 4       hoolock     Hoolock             FALSE 712902      FALSE      
## 5          homo        Homo             FALSE 770309      FALSE      
##   number_matches
## 1              2
## 2              2
## 3              1
## 4              1
## 5              1

Now we can get the tree with just those tips:

- tol_induced_subtree(ott_ids=ott_id(resolved_names))
(tr)

The code above can be summarized in a single pipe:

ary(magrittr)
r expressed as a pipe:
ongo", "Pan", "Gorilla", "Hoolock", "Homo") %>%
tnrs_match_names %>%
ott_id %>%
tol_induced_subtree %>%
plot

Citation and Manuscript

To cite rotl in publications pleases use:

Michonneau, F., Brown, J. W. and Winter, D. J. (2016), rotl: an R package to interact with the Open Tree of Life data. Methods in Ecology and Evolution. 7(12):1476-1481. doi: 10.1111/2041-210X.12593

You may also want to cite the paper for the Open Tree of Life

Hinchliff, C. E., et al. (2015). Synthesis of phylogeny and taxonomy into a comprehensive tree of life. Proceedings of the National Academy of Sciences 112.41 (2015): 12764-12769 doi: 10.1073/pnas.1423041112

The manuscript in Methods in Ecology and Evolution includes additional examples on how to use the package. The manuscript and the code it contains are also hosted on GitHub at: https://github.com/fmichonneau/rotl-ms

Versioning

Starting with v3.0.0 of the package, the major and minor version numbers (the first 2 digits of the version number) will be matched to those of the API. The patch number (the 3rd digit of the version number) will be used to reflect bug fixes and other changes that are independent from changes to the API.

rotl can be used to access other versions of the API (if they are available) but most likely the high level functions will not work. Instead, you will need to parse the output yourself using the “raw” returns from the unexported low-level functions (all prefixed with a .). For instance to use the tnrs/match_names endpoint for v2 of the API:

:::.tnrs_match_names(c("pan", "pango", "gorilla", "hoolock", "homo"), otl_v="v2")
Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.