biotree - Tree manipulations based on BioPerl
biotree [options] <tree file>
biotree [-h | --help | -V | --version | --man]
biotree -t tree.newick # preview [t]ext tree biotree -l tree.newick # total tree [l]ength biotree -m tree.newick # [m]id-point rooting biotree -u tree.newick # list all OT[u]s biotree -d 'otu1,otu2,otu3' tree.newick # [d]elete these OTUs biotree -s 'otu1,otu2' tree.newick # [s]ubset these OTUs biotree -D '0.9' tree.newick # [D]elete low-support (< 0.9) branches biotree -r 'otu1' tree.newick # [r]eroot with a OTU as outgroup biotree -o 'tabtree' tree.newick # [o]utput tree in text format biotree --ci 'binary-trait' tree # consistency indices at informative sites
Designed as a UNIX-like utility, biotree reads a tree file and reformats branches and nodes based on these BioPerl modules: Bio::TreeIO, Bio::Tree::Tree, Bio::Tree::Node, and Bio::Tree::TreeFunctionsI.
Trees can be in any format supported by Bio::TreeIO in BioPerl. However, biotree has not been tested on all possible formats, so behavior may be unexpected with some. Currently, biotree does not support multiple trees per file.
biotree supports reading from STDIN, so that multiple tree manipulations could be chained using pipe ("|").
Draw an ASCII tree for quick preview (needs refinement). Default max screen width 100 characters.
Attach a file containing binary trait values and prints consistency index for informative sites (not verified)
Remove branch lengths from all nodes.
Remove all branch support values.
Identify clades based on branches that bisected by a cut line (half way to max by default).
Through error if cut is greater than the least deep OTU.
Get a subtree by removing specified OTUs
Remove branches supported by less than specified cutoff value, creating a multi-furcating tree.
Remove branches shorter than specified cutoff value, creating a multi-furcating tree.
Prints depth to root. Accepts node names and/or IDs.
Prints the distance between a pair of nodes or leaves.
Prints half-matrix list of distances between all leaves.
Edge-length abundance distribution, a statistics of tree balance (O'Dwyer et al. PNAS 2015)
Input file format. Accepts newick and nhx.
Prepends ID to each leaf/node label. Useful when identifying unlabled nodes, such as when using --otus-desc or --subset.
Adds clade labels to selected internal nodes, based on a file containing, on each line, an internal id and a label. Internal id could be obtained by using "--label nodes" or "-U 'all'".
Nodes not in the file are unlabeled (or removed if bootstrap value exists).
Returns ID of most recent common ancestor across provided nodes. Returns direct ancestor if single leaf/node provided.
Print total branch length.
Prints all nodes and branch lengths.
For making lineage-through-time plot: Divides tree into number of specified segments and counts branches up to height the segment. Returns: bin_number, branch_count, bin_floor, bin_ceiling.
Reroot tree at mid-point
Force a multi-furcating tree into a bifurcating tree (by randomly resolve nodes with multiple descendants)
Print leaf nodes with branch lengths.
Prints all OTU's that are descended from the given internal node (identifiable by running --label-nodes). If 'all', a complete list of all internal nodes and their descendents is returned instead (given in the order of "walking" through the tree from the root node).
Print total number of OTUs (leaves).
Output file format. Accepts newick, nhx, and tabtree.
Builds a tree of a random subset of the original tree's OTUs.
Rotate <OTU> to be the top tip
Rename tips according to a 2-column table
Reroot tree to specified node by creating new branch.
Flip two descendant nodes of an internal node (die if multi-furcation). Useful for plotting.
For each pair of OTUs, print 1/0 if they are (or not) sister OTUs.
Creates a tree of only the specified leaves/nodes and their descendants. Specifying a single internal node produces a subtree from that node.
Output tree with each possible pairs swapped (can't remember why this method was written, please ignore)
Print a matrix of tree shapes (input file for R Package apTreeshape)
Walks along the tree starting from the specified OTU and prints the total distance traveled while reaching each other OTU. Does not count any segment more than once. Useful when calculating evolutionary distance from a reference OTU.
Print a brief help message and exit.
Print the manual page and exit.
Print current release version of this command and exit.
Bio::BPWrapper::TreeManipulations, the underlying Perl Module
Qiu Lab wiki page
Github project wiki page
Newick utilities by Junier & Zdobnov (Bioinformatics, 2010, 26:1669)
Rocky Bernstein (testing & release)
Yözen Hernández yzhernand at gmail dot com (initial design of implementation)
Pedro Pegan (developer)
Lia Di (developer, --mid-point)
Weigang Qiu <weigang@genectr.hunter.cuny.edu> (maintainer)
Insert an option in biotree
Insert new code in lib/Bio/BPWrapper/TreeManipulations.pm. Test by using or adding a test file in test-files/.
Add documentation in POD in biotree
Bug: Bio::Tree reroot produces trees unreadable by R package "ape"
consistency index for DNA/protein alignments
Hernandez, Bernstein, Qiu, et al (2017). "BpWrappers: Command-line utilities for manipulation of sequences, alignments, and phylogenetic trees based on BioPerl". (In prep).
Stajich et al (2002). "The BioPerl Toolkit: Perl Modules for the Life Sciences". Genome Research 12(10):1611-1618.
To install Bio::BPWrapper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bio::BPWrapper
CPAN shell
perl -MCPAN -e shell install Bio::BPWrapper
For more information on module installation, please visit the detailed CPAN module installation guide.