ph_phylomatic: phylomatic

Description Usage Arguments Details References Examples

View source: R/phylomatic.R

Description

Phylomatic is a tool for extracting a phylogeny from a master phylogeny using only a user-supplied list of taxa.

Usage

1
2
ph_phylomatic(taxa, phylo, tabular = FALSE, lowercase = FALSE,
  nodes = FALSE)

Arguments

taxa

(character) all taxa as a character vector (will be written to a temp file if provided) - OR a path to taxa file. Required. See Details.

phylo

(character/phylo) One of: phylogeny as a newick string (will be written to a temp file) - OR path to file with a newick string - OR a an ape phylo object. required.

tabular

(logical) Output a tabular representation of phylogeny. Default: FALSE

lowercase

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

nodes

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

Details

The taxa character vector must have each element of the form family/genus/genus_epithet. If a file is passed in, each line should have a family/genus/genus_epithet string - make sure only one per line, and a newline (i.e., press ENTER) at the end of each line

References

Phylomatic is also available as a web service (https://github.com/camwebb/phylomatic-ws) - but is based on a different code base (https://github.com/camwebb/phylomatic-ws) See Webb and Donoghue (2005) for more information on the goals of Phylomatic.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
taxa_file <- system.file("examples/taxa", package = "phylocomr")
phylo_file <- system.file("examples/phylo", package = "phylocomr")

# from strings
(taxa_str <- readLines(taxa_file))
(phylo_str <- readLines(phylo_file))
(tree <- ph_phylomatic(taxa = taxa_str, phylo = phylo_str))

# from files
taxa_file2 <- tempfile()
cat(taxa_str, file = taxa_file2, sep = '\n')
phylo_file2 <- tempfile()
cat(phylo_str, file = phylo_file2, sep = '\n')
(tree <- ph_phylomatic(taxa = taxa_file2, phylo = phylo_file2))

if (requireNamespace("ape")) {
  library(ape)
  plot(read.tree(text = tree))
}

phylocomr documentation built on Nov. 29, 2018, 9:05 a.m.