Learn R Programming

⚠️There's a newer version (1.13.1) of this package.Take me there.

TreeTools (version 1.9.2)

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) ; 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,384

Version

1.9.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

April 27th, 2023

Functions in TreeTools (1.9.2)

EdgeDistances

Distance between edges
DropTip

Drop leaves from tree
ConsensusWithout

Reduced consensus, omitting specified taxa
CompatibleSplits

Which splits are compatible?
DescendantEdges

Identify descendant edges
Consensus

Construct consensus trees
ConstrainedNJ

Constrained neighbour-joining tree
EdgeAncestry

Ancestors of an edge
EndSentence

Add full stop to end of a sentence
DoubleFactorial

Double factorial
KeptPaths

Paths present in reduced tree
EnforceOutgroup

Generate a tree with a specified outgroup
ImposeConstraint

Force a tree to match a constraint
KeptVerts

Identify vertices retained when leaves are dropped
LabelSplits

Label splits
Hamming

Hamming distance between taxa in a phylogenetic dataset
GenerateTree

Generate pectinate, balanced or random trees
ExtractTaxa

Extract taxa from a matrix block
LeafLabelInterchange

Leaf label interchange
ListAncestors

List ancestors
N1Spr

Number of trees one SPR step away
MakeTreeBinary

Generate binary tree by collapsing polytomies
MSTEdges

Minimum spanning tree
NJTree

Generate a neighbour joining tree
MRCA

Most recent common ancestor
Lobo.data

Data from Zhang et al. 2016
NDescendants

Count descendants for each node in a tree
MorphoBankDecode

Decode MorphoBank text
NSplits

Number of distinct splits
NewickTree

Write Newick Tree
MatrixToPhyDat

Convert between matrices and phyDat objects
NRooted

Number of trees
NTip

Number of leaves in a phylogenetic tree
Neworder

Reorder edges of a phylogenetic tree
NodeDepth

Distance of each node from tree exterior
NodeOrder

Order of each node in a tree
NonDuplicateRoot

Non-duplicate root
PathLengths

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

Distances between each pair of trees
NPartitionPairs

Distributions of tips consistent with a partition pair
Renumber

Renumber a tree's nodes and tips
RenumberTips

Renumber a tree's tips
ReadTntTree

Parse TNT Tree
ReadCharacters

Read phylogenetic characters from file
StringToPhyDat

Convert between strings and phyDat objects
PolarizeSplits

Polarize splits on a single taxon
SampleOne

Quickly sample
SplitMatchProbability

Probability of matching this well
RootTree

Root or unroot a phylogenetic tree
Splits

Convert object to Splits
SplitFrequency

Frequency of splits
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
RenumberTree

Reorder tree edges and nodes
SortTree

Sort tree
RightmostCharacter

Rightmost character of string
SpectrumLegend

Produce a legend for continuous gradient scales
RoguePlot

Visualize position of rogue taxa
SplitsInBinaryTree

Maximum splits in an n-leaf tree
RootNode

Which node is a tree's root?
TreeIsRooted

Is tree rooted?
TreeNumber

Unique integer indices for bifurcating tree topologies
unrootedKeys

Integer representing shape of a tree
TreeTools-package

TreeTools
TotalCopheneticIndex

Total Cophenetic Index
as.multiPhylo

Convert object to multiPhylo class
TipsInSplits

Tips contained within splits
as.Newick

Write a phylogenetic tree in Newick format
TrivialSplits

Identify and remove trivial splits
doubleFactorials

Double factorials
SupportColour

Colour for node support value
logDoubleFactorials

Natural logarithms of double factorials
TipLabels

Extract tip labels
Stemwardness

"Stemwardness" of a leaf
TrivialTree

Generate trivial trees
Subsplit

Subset of a split on fewer leaves
Subtree

Extract a subtree
sort.multiPhylo

Sort a list of phylogenetic trees
sapply64

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

Efficiently convert edge matrix to splits
xor

Exclusive OR operation
.RandomParent

Random parent vector
Unquote

Remove quotation marks from a string
UnrootedTreesMatchingSplit

Number of trees consistent with split
TreesMatchingTree

Number of trees containing a tree
brewer

Brewer palettes
TreesMatchingSplit

Number of trees matching a bipartition split
print.TreeNumber

Print TreeNumber object
nRootedShapes

Number of rooted / unrooted tree shapes
match.Splits

Split matching
UnshiftTree

Add tree to start of list
WriteTntCharacters

Write morphological character matrix to TNT file
AddTip

Add a tip to a phylogenetic tree
CharacterInformation

Character information content
ApeTime

Read modification time from "ape" Nexus file
ClusterTable-methods

S3 methods for ClusterTable objects
CollapseNode

Collapse nodes on a phylogenetic tree
ClusterTable

Convert phylogenetic tree to ClusterTable
ArtificialExtinction

Artificial Extinction
CladisticInfo

Cladistic information content of a tree
CladeSizes

Clade sizes
AncestorEdge

Ancestral edge