View source: R/expanded_tree_from_jplace.r
expanded_tree_from_jplace | R Documentation |
Given a jplace
file (e.g., as generated by pplacer
or EPA-NG
), construct an expanded tree consisting of the original reference tree and additional tips representing the placed query sequences. The reference tree and placements are loaded from the jplace file. If multiple placements are listed for a query, this function can either add the best (maximum-likelihood) placement or all listed placements.
expanded_tree_from_jplace(file_path,
only_best_placements = TRUE,
max_names_per_query = 1)
file_path |
Character, the path to the input |
only_best_placements |
Logical, only keep the best placement of each query, i.e., the placement with maximum likelihood. |
max_names_per_query |
Positive integer, maximum number of sequence names to keep from each query. Only relevant if queries in the jplace file include multiple sequence names (these typically represent identical sequences). If greater than 1, and a query includes multiple sequence names, then each of these sequence names will be added as a tip to the tree. |
This function assumes version 3 of the jplace file format, as defined by Matsen et al. (2012).
A named list with the following elements:
tree |
Object of class "phylo", the extended tree constructed by adding the placements on the reference tree. |
placed_tips |
Integer vector, specifying which tips in the returned tree correspond to placements. |
reference_tree |
Object of class "phylo", the original reference tree loaded from the jplace file. This will be a subtree of |
Stilianos Louca
Frederick A. Matsen et al. (2012). A format for phylogenetic placements. PLOS One. 7:e31009
place_tips_taxonomically
## Not run:
# load jplace file and create expanded tree
J = expanded_tree_from_jplace("epa_ng_output.jplace")
# save the reference and expanded tree as Newick files
write_tree(J$reference_tree, file="reference.tre")
write_tree(J$tree, file="expanded.tre")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.