phylomatic_names: Phylomatic names

Description Usage Arguments Value Authentication Examples

View source: R/phylomatic_names.R

Description

Get family names to make Phylomatic input object, and output input string to Phylomatic for use in the function phylomatic

Usage

1
phylomatic_names(taxa, format = "isubmit", db = "ncbi")

Arguments

taxa

quoted tsn number (taxonomic serial number)

format

output format, isubmit (you can paste in to the Phylomatic website), or 'rsubmit' to use in fxn phylomatic_tree

db

One of "ncbi", "itis", or "apg". if you use "apg", no HTTP requests are made (no internet connection needed), whereas if you use "ncbi" or "itis" you do need an internet connection. IMPORTANT: see Authentication below if using "ncbi".

Value

string (e.g., "pinaceae/pinus/pinus_contorta"), in Phylomatic submission format

Authentication

NCBI Entrez doesn't require that you use an API key, but you get higher rate limit with a key, from 3 to 10 requests per second, so do get one. Run taxize::use_entrez() or see https://ncbiinsights.ncbi.nlm.nih.gov/2017/11/02/new-api-keys-for-the-e-utilities/ for instructions.

NCBI API key handling logic is done inside of the taxize package, used inside this function.

Save your API key with the name ENTREZ_KEY as an R option in your .Rprofile file, or as environment variables in either your .Renviron file or .bash_profile file, or .zshrc file (if you use oh-my-zsh) or similar. See Startup for help on R options and environment variables. You cannot pass in your API key in this function.

Remember to restart your R session (and to start a new shell window/tab if you're using the shell) to take advantage of the new R options or environment variables.

We strongly recommend using environment variables over R options.

Examples

1
2
3
4
5
6
7
8
## Not run: 
mynames <- c("Poa annua", "Salix goodingii", "Helianthus annuus")
phylomatic_names(taxa = mynames, format='rsubmit')
phylomatic_names(mynames, format='rsubmit', db="apg")
phylomatic_names(mynames, format='isubmit', db="ncbi")
phylomatic_names(mynames, format='isubmit', db="apg")

## End(Not run)

brranching documentation built on Dec. 6, 2018, 1:03 a.m.