Learn R Programming

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

TreeTools (version 1.10.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) ; 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,996

Version

1.10.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

August 19th, 2023

Functions in TreeTools (1.10.0)

EndSentence

Add full stop to end of a sentence
DropTip

Drop leaves from tree
ListAncestors

List ancestors
LeafLabelInterchange

Leaf label interchange
ConstrainedNJ

Constrained neighbour-joining tree
ConsensusWithout

Reduced consensus, omitting specified taxa
ImposeConstraint

Force a tree to match a constraint
KeptPaths

Paths present in reduced tree
Consensus

Construct consensus trees
GenerateTree

Generate pectinate, balanced or random trees
CompatibleSplits

Which splits are compatible?
EnforceOutgroup

Generate a tree with a specified outgroup
ExtractTaxa

Extract taxa from a matrix block
NTip

Number of leaves in a phylogenetic tree
MRCA

Most recent common ancestor
Hamming

Hamming distance between taxa in a phylogenetic dataset
NewickTree

Write Newick Tree
Lobo.data

Data from Zhang et al. 2016
EdgeAncestry

Ancestors of an edge
DescendantEdges

Identify descendant edges
DoubleFactorial

Double factorial
MSTEdges

Minimum spanning tree
MakeTreeBinary

Generate binary tree by collapsing polytomies
MatrixToPhyDat

Convert between matrices and phyDat objects
MorphoBankDecode

Decode MorphoBank text
Renumber

Renumber a tree's nodes and tips
KeptVerts

Identify vertices retained when leaves are dropped
N1Spr

Number of trees one SPR step away
Neworder

Reorder edges of a phylogenetic tree
RenumberTree

Reorder tree edges and nodes
NRooted

Number of trees
RightmostCharacter

Rightmost character of string
NodeDepth

Distance of each node from tree exterior
NDescendants

Count descendants for each node in a tree
NSplits

Number of distinct splits
SortTree

Sort tree
RoguePlot

Visualize position of rogue taxa
RootNode

Which node is a tree's root?
TreeNumber

Unique integer indices for bifurcating tree topologies
SampleOne

Quickly sample
RenumberTips

Renumber a tree's tips
SplitFrequency

Frequency of splits
RootTree

Root or unroot a phylogenetic tree
NPartitionPairs

Distributions of tips consistent with a partition pair
NJTree

Generate a neighbour joining tree
TotalCopheneticIndex

Total Cophenetic Index
SpectrumLegend

Produce a legend for continuous gradient scales
LabelSplits

Label splits
as.Newick

Write a phylogenetic tree in Newick format
WriteTntCharacters

Write morphological character matrix to TNT file
TreeIsRooted

Is tree rooted?
PolarizeSplits

Polarize splits on a single taxon
PairwiseDistances

Distances between each pair of trees
SplitsInBinaryTree

Maximum splits in an n-leaf tree
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
NodeOrder

Number of edges incident to each node in a tree
StringToPhyDat

Convert between strings and phyDat objects
TipTimedTree

Display time-calibrated tree using tip information only
ReadCharacters

Read phylogenetic characters from file
Stemwardness

"Stemwardness" of a leaf
PathLengths

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

Read posterior tree sample produced by MrBayes
TipsInSplits

Tips contained within splits
TreesMatchingTree

Number of trees containing a tree
unrootedKeys

Integer representing shape of a tree
ReadTntTree

Parse TNT Tree
SplitMatchProbability

Probability of matching this well
TrivialSplits

Identify and remove trivial splits
as.multiPhylo

Convert object to multiPhylo class
nRootedShapes

Number of rooted / unrooted tree shapes
TipLabels

Extract tip labels
Splits

Convert object to Splits
SupportColour

Colour for node support value
print.TreeNumber

Print TreeNumber object
UnrootedTreesMatchingSplit

Number of trees consistent with split
UnshiftTree

Add tree to start of list
doubleFactorials

Double factorials
Unquote

Remove quotation marks from a string
.RandomParent

Random parent vector
TrivialTree

Generate trivial trees
sort.multiPhylo

Sort a list of phylogenetic trees
xor

Exclusive OR operation
sapply64

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

Brewer palettes
match.Splits

Split matching
logDoubleFactorials

Natural logarithms of double factorials
is.TreeNumber

Is an object a TreeNumber object?
TreesMatchingSplit

Number of trees matching a bipartition split
edge_to_splits

Efficiently convert edge matrix to splits
TreeTools-package

TreeTools
Subsplit

Subset of a split on fewer leaves
Subtree

Extract a subtree
CladisticInfo

Cladistic information content of a tree
ApeTime

Read modification time from "ape" Nexus file
CollapseNode

Collapse nodes on a phylogenetic tree
CharacterInformation

Character information content
ClusterTable

Convert phylogenetic tree to ClusterTable
ArtificialExtinction

Artificial Extinction
CladeSizes

Clade sizes
AddTip

Add a tip to a phylogenetic tree
AncestorEdge

Ancestral edge
ClusterTable-methods

S3 methods for ClusterTable objects
EdgeDistances

Distance between edges