Learn R Programming

TreeTools (version 1.13.0)

Create, Modify and Analyse Phylogenetic Trees

Description

Efficient implementations of functions for the creation, modification and analysis of phylogenetic trees. Applications include: generation of trees with specified shapes; tree rearrangement; analysis of tree shape; rooting of trees and extraction of subtrees; calculation and depiction of split support; plotting the position of rogue taxa (Klopfstein & Spasojevic 2019) ; calculation of ancestor-descendant relationships, of 'stemwardness' (Asher & Smith, 2022) , and of tree balance (Mir et al. 2013, Lemant et al. 2022) , ; artificial extinction (Asher & Smith, 2022) ; import and export of trees from Newick, Nexus (Maddison et al. 1997) , and TNT formats; and analysis of splits and cladistic information.

Copy Link

Version

Install

install.packages('TreeTools')

Monthly Downloads

1,498

Version

1.13.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

January 10th, 2025

Functions in TreeTools (1.13.0)

EdgeAncestry

Ancestors of an edge
ConsensusWithout

Reduced consensus, omitting specified taxa
DescendantEdges

Identify descendant edges
ConstrainedNJ

Constrained neighbour-joining tree
EdgeDistances

Distance between edges
Decompose

Decompose additive (ordered) phylogenetic characters
DoubleFactorial

Double factorial
Consensus

Construct consensus trees
CompatibleSplits

Which splits are compatible?
DropTip

Drop leaves from tree
Hamming

Hamming distance between taxa in a phylogenetic dataset
ExtractTaxa

Extract taxa from a matrix block
EnforceOutgroup

Generate a tree with a specified outgroup
KeptVerts

Identify vertices retained when leaves are dropped
EndSentence

Add full stop to end of a sentence
GenerateTree

Generate pectinate, balanced or random trees
J1Index

Robust universal tree balance index
LabelSplits

Label splits
MSTEdges

Minimum spanning tree
MRCA

Most recent common ancestor
Lobo.data

Data from Zhang et al. 2016
MatrixToPhyDat

Convert between matrices and phyDat objects
MatchEdges

Match nodes and edges between trees
NJTree

Generate a neighbour joining tree
MakeTreeBinary

Generate binary tree by collapsing polytomies
NDescendants

Count descendants for each node in a tree
ListAncestors

List ancestors
LeafLabelInterchange

Leaf label interchange
ReadTntTree

Parse TNT Tree
NewickTree

Write Newick Tree
ReadMrBayesTrees

Read posterior tree sample produced by MrBayes
ImposeConstraint

Force a tree to match a constraint
Neworder

Reorder edges of a phylogenetic tree
Renumber

Renumber a tree's nodes and tips
NodeDepth

Distance of each node from tree exterior
NodeNumbers

Numeric index of each node in a tree NodeNumbers() returns a sequence corresponding to the nodes in a tree
RenumberTips

Renumber a tree's tips
NSplits

Number of distinct splits
NTip

Number of leaves in a phylogenetic tree
N1Spr

Number of trees one SPR step away
KeptPaths

Paths present in reduced tree
MorphoBankDecode

Decode MorphoBank text
NPartitionPairs

Distributions of tips consistent with a partition pair
PairwiseDistances

Distances between each pair of trees
NRooted

Number of trees
NodeOrder

Number of edges incident to each node in a tree
StringToPhyDat

Convert between strings and phyDat objects
PathLengths

Calculate length of paths between each pair of vertices within tree
RoguePlot

Visualize position of rogue taxa
RootTree

Root or unroot a phylogenetic tree
SortTree

Sort tree
PolarizeSplits

Polarize splits on a single taxon
ReadCharacters

Read phylogenetic characters from file
RenumberTree

Reorder tree edges and nodes
RightmostCharacter

Rightmost character of string
SplitFrequency

Frequency of splits
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
SplitMatchProbability

Probability of matching this well
SupportColour

Colour for node support value
TipLabels

Extract tip labels
SampleOne

Select element at random
SpectrumLegend

Produce a legend for continuous gradient scales
RootNode

Which node is a tree's root?
SplitsInBinaryTree

Maximum splits in an n-leaf tree
Stemwardness

"Stemwardness" of a leaf
Splits

Convert object to Splits
unrootedKeys

Integer representing shape of a tree
Subsplit

Subset of a split on fewer leaves
Subtree

Extract a subtree
TreeTools-package

TreeTools
TipTimedTree

Display time-calibrated tree using tip information only
TipsInSplits

Tips contained within splits
TreeIsRooted

Is tree rooted?
TreeNumber

Unique integer indices for bifurcating tree topologies
edge_to_splits

Efficiently convert edge matrix to splits
TrivialSplits

Identify and remove trivial splits
TopologyOnly

Remove metadata from trees
TotalCopheneticIndex

Total Cophenetic Index
TrivialTree

Generate trivial trees
TreesMatchingSplit

Number of trees matching a bipartition split
TreesMatchingTree

Number of trees containing a tree
WriteTntCharacters

Write morphological character matrix to TNT file
UnshiftTree

Add tree to start of list
.RandomParent

Random parent vector
nRootedShapes

Number of rooted / unrooted tree shapes
match,Splits,Splits-method

Split matching
match,phylo,phylo-method

Tree matching
brewer

Brewer palettes
doubleFactorials

Double factorials
is.TreeNumber

Is an object a TreeNumber object?
as.Newick

Write a phylogenetic tree in Newick format
logDoubleFactorials

Natural logarithms of double factorials
Unquote

Remove quotation marks from a string
UnrootedTreesMatchingSplit

Number of trees consistent with split
sort.multiPhylo

Sort a list of phylogenetic trees
xor

Exclusive OR operation
print.TreeNumber

Print TreeNumber object
as.multiPhylo

Convert object to multiPhylo class
root_on_node

Wrapper for internal C function root_on_node()
sapply64

Apply a function that returns 64-bit integers over a list or vector
AddTip

Add a tip to a phylogenetic tree
ClusterTable-methods

S3 methods for ClusterTable objects
CladisticInfo

Cladistic information content of a tree
ApeTime

Read modification time from "ape" Nexus file
ArtificialExtinction

Artificial Extinction
CladeSizes

Clade sizes
CollapseNode

Collapse nodes on a phylogenetic tree
ClusterTable

Convert phylogenetic tree to ClusterTable
CharacterInformation

Character information content
AncestorEdge

Ancestral edge