Learn R Programming

TreeTools (version 1.12.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,345

Version

1.12.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 25th, 2024

Functions in TreeTools (1.12.0)

EdgeAncestry

Ancestors of an edge
DoubleFactorial

Double factorial
ConstrainedNJ

Constrained neighbour-joining tree
Consensus

Construct consensus trees
DropTip

Drop leaves from tree
EdgeDistances

Distance between edges
EndSentence

Add full stop to end of a sentence
ImposeConstraint

Force a tree to match a constraint
KeptVerts

Identify vertices retained when leaves are dropped
KeptPaths

Paths present in reduced tree
J1Index

Robust universal tree balance index
ListAncestors

List ancestors
Lobo.data

Data from Zhang et al. 2016
MatrixToPhyDat

Convert between matrices and phyDat objects
MorphoBankDecode

Decode MorphoBank text
LeafLabelInterchange

Leaf label interchange
MatchEdges

Match nodes and edges between trees
NPartitionPairs

Distributions of tips consistent with a partition pair
N1Spr

Number of trees one SPR step away
LabelSplits

Label splits
NDescendants

Count descendants for each node in a tree
MakeTreeBinary

Generate binary tree by collapsing polytomies
NJTree

Generate a neighbour joining tree
NodeOrder

Number of edges incident to each node in a tree
NodeNumbers

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

Distance of each node from tree exterior
Neworder

Reorder edges of a phylogenetic tree
EnforceOutgroup

Generate a tree with a specified outgroup
GenerateTree

Generate pectinate, balanced or random trees
MRCA

Most recent common ancestor
Hamming

Hamming distance between taxa in a phylogenetic dataset
NRooted

Number of trees
MSTEdges

Minimum spanning tree
ExtractTaxa

Extract taxa from a matrix block
NSplits

Number of distinct splits
ReadCharacters

Read phylogenetic characters from file
Renumber

Renumber a tree's nodes and tips
ReadTntTree

Parse TNT Tree
NTip

Number of leaves in a phylogenetic tree
RightmostCharacter

Rightmost character of string
PolarizeSplits

Polarize splits on a single taxon
RoguePlot

Visualize position of rogue taxa
StringToPhyDat

Convert between strings and phyDat objects
ReadMrBayesTrees

Read posterior tree sample produced by MrBayes
PathLengths

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

Which node is a tree's root?
RootTree

Root or unroot a phylogenetic tree
PairwiseDistances

Distances between each pair of trees
RenumberTips

Renumber a tree's tips
RenumberTree

Reorder tree edges and nodes
SortTree

Sort tree
NewickTree

Write Newick Tree
Subtree

Extract a subtree
SampleOne

Quickly sample
SupportColour

Colour for node support value
Stemwardness

"Stemwardness" of a leaf
Subsplit

Subset of a split on fewer leaves
SpectrumLegend

Produce a legend for continuous gradient scales
SplitMatchProbability

Probability of matching this well
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
Splits

Convert object to Splits
SplitsInBinaryTree

Maximum splits in an n-leaf tree
TreeTools-package

TreeTools
TreesMatchingSplit

Number of trees matching a bipartition split
TipsInSplits

Tips contained within splits
TopologyOnly

Remove metadata from trees
TotalCopheneticIndex

Total Cophenetic Index
SplitFrequency

Frequency of splits
TreeNumber

Unique integer indices for bifurcating tree topologies
Unquote

Remove quotation marks from a string
edge_to_splits

Efficiently convert edge matrix to splits
TrivialTree

Generate trivial trees
is.TreeNumber

Is an object a TreeNumber object?
brewer

Brewer palettes
as.multiPhylo

Convert object to multiPhylo class
TreeIsRooted

Is tree rooted?
sort.multiPhylo

Sort a list of phylogenetic trees
WriteTntCharacters

Write morphological character matrix to TNT file
xor

Exclusive OR operation
unrootedKeys

Integer representing shape of a tree
as.Newick

Write a phylogenetic tree in Newick format
TreesMatchingTree

Number of trees containing a tree
TrivialSplits

Identify and remove trivial splits
doubleFactorials

Double factorials
sapply64

Apply a function that returns 64-bit integers over a list or vector
print.TreeNumber

Print TreeNumber object
nRootedShapes

Number of rooted / unrooted tree shapes
root_on_node

Wrapper for internal C function root_on_node()
.RandomParent

Random parent vector
UnshiftTree

Add tree to start of list
TipLabels

Extract tip labels
match.Splits

Split matching
TipTimedTree

Display time-calibrated tree using tip information only
UnrootedTreesMatchingSplit

Number of trees consistent with split
logDoubleFactorials

Natural logarithms of double factorials
ApeTime

Read modification time from "ape" Nexus file
CharacterInformation

Character information content
ClusterTable-methods

S3 methods for ClusterTable objects
ClusterTable

Convert phylogenetic tree to ClusterTable
CollapseNode

Collapse nodes on a phylogenetic tree
CladeSizes

Clade sizes
CladisticInfo

Cladistic information content of a tree
ArtificialExtinction

Artificial Extinction
AddTip

Add a tip to a phylogenetic tree
AncestorEdge

Ancestral edge
ConsensusWithout

Reduced consensus, omitting specified taxa
CompatibleSplits

Which splits are compatible?
DescendantEdges

Identify descendant edges