October 2026
trees-consensus - Summarize sampled trees and support for their relationships.
trees-consensus [OPTIONS] SAMPLED-TREES [SAMPLED-TREES ...]
A sample of evolutionary trees describes uncertainty about how the sampled taxa (species or other named leaves) are related. trees-consensus summarizes that sample either by counting complete tree topologies or by counting individual relationships. A topology is the branching arrangement, ignoring branch lengths.
A branch divides the leaves into two groups, called a split. The support for a split is the fraction of retained trees containing it. For trees sampled from a Bayesian posterior distribution, that fraction estimates its posterior probability (PP). Support for a split can be high even when no complete topology is common.
By default, write a majority-consensus tree to standard output. It contains splits present in strictly more than half the retained trees. Unresolved nodes leave relationships unspecified where the sample does not establish a majority. The consensus combines relationships and need not be a topology that occurred in the sample.
Other summaries answer different questions:
Supply one or more Newick or NEXUS tree-sample files. Newick samples contain one tree per line. Use - for standard input. All files must contain the same taxon set after --ignore, although their leaf orders may differ. Trees are interpreted as unrooted; an artificial degree-two root is suppressed.
Selection is applied separately to each file:
A percentage skip uses the shortest run's length after --until to determine one common count, rounded down, which is discarded from every run. For example, runs of 100 and 200 trees with --skip 10% each lose 10 trees. This does not remove 10% independently from each run. Percentages below 100% retain part of every nonempty run before thinning.
The maximum is per file, not a limit on the pooled total. Thinning to a maximum includes the first and last selected trees; a maximum of one retains the first. The retained samples are pooled with equal weight per tree, so a longer retained run contributes more observations.
Ordinary consensus, greedy, and MAP outputs are Newick trees. Internal branch labels give split support as fractions between 0 and 1. When branch lengths are available, each branch receives its mean length over the retained trees containing that split. Thus a MAP output uses the most frequent topology with estimated branch lengths, rather than copying one sampled tree's lengths.
The default majority tree is produced only when none of --consensus, --greedy-consensus, --map-tree, --extended-consensus, or --extended-consensus-L is supplied. --report alone does not suppress it. Use named destinations to keep a report and tree output separate.
The optional report includes the sample size, topology and split counts, the most frequent topologies, a 95% topology credible-set size, and supported splits. The credible set accumulates topologies in decreasing frequency until their combined sample frequency reaches 95%; it is not a collection of branch-support intervals.
Report PP values are observed fractions, n/N. LOD is base-10 log odds with one added observation on each side: log10((n + 1)/(N - n + 1)). This keeps unanimous observations finite. It is not a Bayes factor. Partial splits can also have a ratio field: the base-10 logarithm of their odds improvement over the strongest other reported candidate that implies them.
An extended consensus begins with a Newick tree for full splits, followed by partial splits such as:
A B | C D [ E ]
This expresses the separation of A and B from C and D without specifying E's placement. The bracketed taxa are excluded from that relationship. Extended output is therefore richer than a single ordinary Newick tree. --extended-consensus-L adds estimated lengths in the extended format read by draw-tree.
@ prevents file interpretation.
A partial-split search examines subsets of taxa derived from the majority tree, then uses promising results to explore further subsets. It continues until no new candidates remain. The controls below concern candidate search and report selection; they do not replace the thresholds for ordinary or greedy consensus trees.
For sample.trees containing eight copies of
((A,B),C,D); and two copies of ((A,C),B,D);,
use --skip 0 to analyze all ten. The majority tree
retains AB|CD with support 0.8. A threshold of 0.8 excludes it,
producing an unresolved tree:
trees-consensus sample.trees --skip 0 > majority.tree
trees-consensus sample.trees --skip 0 --consensus 0.8 > conservative.treePool retained samples from two runs and write different summaries separately:
trees-consensus run1.trees run2.trees --map-tree MAP.tree \
--consensus 0.5:c50.tree,0.8:c80.tree --report support.txtRequest a unanimous or greedy summary:
trees-consensus sample.trees --skip 0 --consensus 1 > strict.tree
trees-consensus sample.trees --skip 0 --greedy-consensus greedy.treeExplore relationships that remain supported when some taxa are excluded:
trees-consensus run1.trees run2.trees --extended-consensus 0.5:extended.tree \
--report partial-support.txttrees-bootstrap(1), partitions-supported(1), tree-mean-lengths(1), draw-tree(1), trees-to-SRQ(1)
BAli-Phy online help: https://www.bali-phy.org/docs.php.
Please send bug reports to bali-phy-users@googlegroups.com.