a Perl script for manipulating trees after phylogenetic reconstruction
Version 0.9.1
by Qiyun Zhu (qiyunzhu@gmail.com)
- Annotate tips (IDs -> full taxa names).
- Compute average confidence value across tree.
- Scale up/down branch lengths.
- Remove branch lengths and keep topology only.
- Collapse nodes with confidence values lower than a cutoff.
- Convert between Newick and Nexus formats, with confidence values kept.
- Compatible with trees generated by RAxML, PhyML, MrBayes, BEAST or other popular phylogenetics programs.
perl AfterPhylo.pl [options(s)] [tree(s)]
One or more trees in Newick or Nexus format.
-
-format=<newick or nexus>
Convert tree format to Newick or Nexus.
-
-annotate=<annotation table>
Annotate tree tips (append a string to each tip label)
Annotation table format: plain text file with each line like
ID<tab>name
. -
-replace
When annotating, ignore ID instead of appending (must be used with
-annotate
). -
-scale=<factor>
Scale up/down branch lengths by
<factor>
. -
-topology
Remove branch lengths (keep topology only).
-
-unlabeled
Remove node labels (confidence values or everything in brackets).
-
-confonly
Keep confidence values (bootstrap, posterior probability, etc) and remove everything else from complicated node labels.
-
-average
Compute average confidence value across tree.
-
-collapse=<number>
Collapse nodes with confidence value below
<number>
. -
-simplify
Simplify branch length values to six digits after decimal point.
Convert three MrBayes consensus trees into Newick format with posterior probabilities as node labels:
perl AfterPhylo.pl -confonly -format=newick tree1.nex tree2.nex tree3.nex
Prepare a starting tree for divergence time estimation in BEAST, with root height expanded from 1.0 to in 65 (Ma):
perl AfterPhylo.pl -scale=65 -format=nexus tree1.nwk
Compute the average bootstrap values of a tree:
perl AfterPhylo.pl -average tree1.nwk
Create a majority-rule consensus tree from an "all" tree:
perl AfterPhylo.pl -collapse=50 tree1.nwk
Replace tip labels with full taxa names
perl AfterPhylo.pl -annotate=translation_table.txt -replace tree1.nex
The file translation_table.txt
looks like:
HUMAN Homo sapiens
CHIMP Pan troglodytes
GORIL Gorilla gorilla
...
This program does not depend on any third-party modules.
Licensed under the BSD 2-clause license.