Rev Language Reference


Calculates the majority-rule consensus topology from a trace of trees and summarizes branch lengths.


  • conTree
  • sumt


consensusTree(TraceTree trace, Probability cutoff, String file, Probability hpd, Bool mean, Bool sampledAncestors, Bool positiveBranchLengths)


trace : TraceTree (pass by reference)
The trace of tree samples.
cutoff : Probability (pass by value)
The minimum threshold for clade probabilities.
Default : 0.5
file : String (pass by value)
The name of the file for storing the tree.
hpd : Probability (pass by value)
The probability mass of the highest posterior density node age interval.
Default : 0.95
mean : Bool (pass by value)
Annotate node ages using the mean age instead of the median?
Default : FALSE
sampledAncestors : Bool (pass by value)
Annotate sampled ancestor probs?
Default : TRUE
positiveBranchLengths : Bool (pass by value)
Force negative branch lengths to be short but positive?
Default : FALSE

Return Type


# Read in tree trace
tree_trace = readTreeTrace("output/my.trees", burnin=0.25)

# Generate the majority-rule consensus tree
map_tree = consensusTree(trace=tree_trace, cutoff=0.5, file="consensus.tree")

See Also