fishtree_phylogeny: Get a phylogeny from the Fish Tree of Life

Description Usage Arguments Details Value References See Also Examples

View source: R/functions.R

Description

Retrieves a phylogeny via the Fish Tree of Life API. If neither 'species' nor 'rank' are specified, returns the entire phylogeny.

Usage

1
2
3
4
5
fishtree_phylogeny(
  species,
  rank,
  type = c("chronogram", "phylogram", "chronogram_mrca", "phylogram_mrca")
)

Arguments

species

(Optionally) subset the results based on a vector of species names.

rank

(Optionally) subset the results based on the supplied taxonomic rank.

type

Either '"chronogram"' or '"phylogram"'. A chronogram has branch lengths proportional to units of time, while a phylogram has branch lengths proportional to the amount of character change. When retrieving a phylogeny by rank, and that rank is not recovered as monophyletic, acceptable types also include '"chronogram_mrca"' and '"phylogram_mrca"', which returns a tree with *all* species descending from the common ancestor of species in the specified rank.

Details

For maximum interoperability, 'species' considers spaces and underscores equivalently. Internally, the phylogenies use underscores.

Value

An object of class '"phylo"'.

References

Rabosky, D. L., Chang, J., Title, P. O., Cowman, P. F., Sallan, L., Friedman, M., Kashner, K., Garilao, C., Near, T. J., Coll, M., Alfaro, M. E. (2018). An inverse latitudinal gradient in speciation rate for marine fishes. Nature, 559(7714), 392–395. doi:10.1038/s41586-018-0273-1

See Also

fishtree_rogues, read.tree, force.ultrametric

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
# Get a phylogeny for a taxonomic rank
surgeons <- fishtree_phylogeny(rank = "Acanthuridae")

# Get a phylogeny for only certain species
genomic_fish <- c("Oryzias latipes", "Tetraodon nigroviridis",
                  "Gasterosteus aculeatus", "Danio rerio")
fishtree_phylogeny(species = genomic_fish)

# Chronograms may not be ultrametric due to numerical precision issues
# Consider using phytools::force.ultrametric
ape::is.ultrametric(surgeons)
ape::is.ultrametric(surgeons, tol = 0.00001)

# Difference between MRCA trees and regular trees
gobies_mrca <- fishtree_phylogeny(rank = "Gobiidae", type = "chronogram_mrca")
gobies <- fishtree_phylogeny(rank = "Gobiidae", type = "chronogram")
# MRCA trees will have more tips for non-monophyletic groups
length(gobies_mrca$tip.label) > length(gobies$tip.label)
# Drop rogue tips in the MRCA tree
rogue_gobies <- fishtree_rogues("Gobiidae")
pruned_gobies <- ape::drop.tip(gobies_mrca, rogue_gobies)
# Now the trees are identical
setequal(gobies$tip.label, pruned_gobies$tip.label)

## End(Not run)

fishtree documentation built on Jan. 31, 2021, 1:06 a.m.