phylomatic_local: Use Phylomatic locally - ideal for large queries

Description Usage Arguments Details Value Examples

View source: R/phylomatic_local.R

Description

Use Phylomatic locally - ideal for large queries

Usage

1
2
3
4
5
6
7
8
9
phylomatic_local(
  taxa,
  taxnames = TRUE,
  storedtree = "R20120829",
  db = "apg",
  lowercase = FALSE,
  nodes = FALSE,
  verbose = TRUE
)

Arguments

taxa

(character) Phylomatic format input of taxa names. required

taxnames

If TRUE (default), 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. See Details.

storedtree

One of R20120829 (Phylomatic tree R20120829 for plants), smith2011 (Smith 2011, plants), binindaemonds2007 (Bininda-Emonds 2007, mammals), or zanne2014 (Zanne et al. 2014, plants). Default: R20120829

db

(character) One of "ncbi", "itis", or "apg". Default: apg

lowercase

(logical) Convert all chars in taxa file to lowercase. Default: FALSE

nodes

(logical) label all nodes with default names. Default: FALSE

verbose

(logical) Print messages. Default: TRUE

Details

uses phylocomr::ph_phylomatic() under the hood

This function uses Phylomatic via Phylocom using the phylocomr package. The interface is slightly different from phylomatic(): there's no tree by URL available, and some of the parameters are not included here.

If you set taxnames = FALSE, you need to pass in a character vector, with each element like this example: "asteraceae/taraxacum/taraxacum_officinale", of the form "family/genus/genus_specfic epithet"

Value

Newick formatted tree as phylo object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library('ape')

# Input taxonomic names
taxa <- c("Poa annua", "Phlox diffusa", "Helianthus annuus")
(tree <- phylomatic_local(taxa))
plot(collapse.singles(tree), no.margin=TRUE)

taxa <- c("Poa annua", "Collomia grandiflora", "Lilium lankongense",
"Phlox diffusa", "Iteadaphne caudata", "Gagea sarmentosa",
"Helianthus annuus")
(tree <- phylomatic_local(taxa))
plot(collapse.singles(tree), no.margin=TRUE)

library("taxize")
spp <- names_list("species", 500)
length(spp)
(tree <- phylomatic_local(spp))

## End(Not run)

Example output

preparing names...
processing with phylomatic...

Phylogenetic tree with 3 tips and 3 internal nodes.

Tip labels:
[1] "poa_annua"         "phlox_diffusa"     "helianthus_annuus"
Node labels:
[1] "euphyllophyte"         "poales_to_asterales"   "ericales_to_asterales"

Rooted; includes branch lengths.
preparing names...
processing with phylomatic...

Phylogenetic tree with 7 tips and 7 internal nodes.

Tip labels:
	poa_annua, lilium_lankongense, gagea_sarmentosa, collomia_grandiflora, phlox_diffusa, helianthus_annuus, ...
Node labels:
	euphyllophyte, magnoliales_to_asterales, poales_to_asterales, , liliaceae, ericales_to_asterales, ...

Rooted; includes branch lengths.
[1] 500
preparing names...
processing with phylomatic...

Phylogenetic tree with 443 tips and 253 internal nodes.

Tip labels:
	alkanna_cappadocica, lithospermum_purpurascens, myosotis_adpressa, bourreria_rinconensis, plagiobothrys_hispidus, cestrum_zarucchianum, ...
Node labels:
	euphyllophyte, seedplants, nymphaeales_to_asterales, magnoliales_to_asterales, poales_to_asterales, eudicots, ...

Rooted; includes branch lengths.

brranching documentation built on May 11, 2021, 9:09 a.m.