Learn R Programming

taxize (version 0.6.6)

phylomatic_tree: Query Phylomatic for a phylogenetic tree.

Description

Query Phylomatic for a phylogenetic tree.

Usage

phylomatic_tree(taxa, taxnames = TRUE, get = "GET", informat = "newick",
  method = "phylomatic", storedtree = "R20120829", treeuri = NULL,
  taxaformat = "slashpath", outformat = "newick", clean = "true",
  db = "apg", verbose = TRUE, ...)

Arguments

taxa
Phylomatic format input of taxa names.
taxnames
If true, we get the family names for you to attach to your species names to send to Phylomatic API. If FALSE, you have to provide the strings in the right format.
get
'GET' or 'POST' format for submission to the website.
informat
One of newick, nexml, or cdaordf. If using a stored tree, informat should always be newick.
method
One of phylomatic or convert
storedtree
One of R20120829 (Phylomatic tree R20120829 for plants), smith2011 (Smith 2011, plants), or binindaemonds2007 (Bininda-Emonds 2007, mammals).
treeuri
URL for a phylogenetic tree in newick format.
taxaformat
Only option is slashpath for now. Leave as is.
outformat
One of newick, nexml, or fyt.
clean
Return a clean tree or not.
db
One of "ncbi", "itis", or "apg". If there are gymnosperms in your taxa list, don't use apg, intead use ncbi or itis.
verbose
Print messages (default: TRUE).
...
Curl options passed on to GET or POST

Value

  • Newick formatted tree or nexml text.

Details

Use the web interface here http://phylodiversity.net/phylomatic/

Examples

Run this code
# Input taxonomic names
taxa <- c("Poa annua", "Phlox diffusa", "Helianthus annuus")
tree <- phylomatic_tree(taxa=taxa, get = 'POST')
plot(tree, no.margin=TRUE)

# Genus names
taxa <- c("Poa", "Phlox", "Helianthus")
tree <- phylomatic_tree(taxa=taxa, storedtree='R20120829', get='POST')
plot(tree, no.margin=TRUE)

# Lots of names
taxa <- c("Poa annua", "Collomia grandiflora", "Lilium lankongense", "Phlox diffusa",
"Iteadaphne caudata", "Gagea sarmentosa", "Helianthus annuus")
tree <- phylomatic_tree(taxa=taxa, get = 'POST')
plot(tree, no.margin=TRUE)

# Output NeXML format
taxa <- c("Gonocarpus leptothecus", "Gonocarpus leptothecus", "Lilium lankongense")
out <- phylomatic_tree(taxa=taxa, get = 'POST', outformat = "nexml")
cat(out)

# Lots of names, note that when you have enough names (number depends on length of individual
# names, so there's no per se rule), you will get an error when using \code{get='GET'},
# when that happens use \code{get='POST'}
spp <- names_list("species", 200)
# (out <- phylomatic_tree(taxa = spp, get = "GET"))
(out <- phylomatic_tree(taxa = spp, get = "POST"))
plot(out)

# Pass in a tree from a URL on the web
spp <- c('Abies amabilis','Abies balsamea','Abies bracteata','Abies concolor','Abies fraseri',
   'Abies grandis','Abies lasiocarpa','Abies magnifica','Abies procera','Acacia berlandieri')
spp <- c('Pinus koraiensis', 'Pinus sibirica', 'Pinus albicaulis', 'Pinus lambertiana',
         'Pinus bungeana', 'Pinus strobus', 'Pinus_cembra')
url <- "http://datadryad.org/bitstream/handle/10255/dryad.8791/final_tree.tre?sequence=1"
phylomatic_tree(taxa=spp, treeuri=url)

# If there gymnosperms in your taxa list, use db of itis or ncbi
taxa <- c('Abies amabilis','Abies balsamea','Abies grandis','Abies lasiocarpa',
'Abies magnifica','Abies procera','Acacia berlandieri','Poa annua')
(tree1 <- phylomatic_tree(taxa=taxa, db="ncbi"))
plot(tree1)

Run the code above in your browser using DataLab