Learn R Programming

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

TreeTools (version 1.9.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,855

Version

1.9.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

November 28th, 2022

Functions in TreeTools (1.9.0)

CladeSizes

Clade sizes
ClusterTable

Convert phylogenetic tree to ClusterTable
ArtificialExtinction

Artificial Extinction
ApeTime

Read modification time from "ape" Nexus file
CollapseNode

Collapse nodes on a phylogenetic tree
ClusterTable-methods

S3 methods for ClusterTable objects
CladisticInfo

Cladistic information content of a tree
AddTip

Add a tip to a phylogenetic tree
CharacterInformation

Character information content
AncestorEdge

Ancestral edge
EdgeDistances

Distance between edges
DescendantEdges

Identify descendant edges
DropTip

Drop leaves from tree
CompatibleSplits

Which splits are compatible?
ConstrainedNJ

Constrained neighbour-joining tree
Consensus

Construct consensus trees
ConsensusWithout

Reduced consensus, omitting specified taxa
DoubleFactorial

Double factorial
EdgeAncestry

Ancestors of an edge
EndSentence

Add full stop to end of a sentence
Hamming

Hamming distance between taxa in a phylogenetic dataset
KeptVerts

Identify vertices retained when leaves are dropped
GenerateTree

Generate pectinate, balanced or random trees
LeafLabelInterchange

Leaf label interchange
LabelSplits

Label splits
ListAncestors

List ancestors
ExtractTaxa

Extract taxa from a matrix block
EnforceOutgroup

Generate a tree with a specified outgroup
NPartitionPairs

Distributions of tips consistent with a partition pair
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
N1Spr

Number of trees one SPR step away
NSplits

Number of distinct splits
PairwiseDistances

Distances between each pair of trees
NRooted

Number of trees
ImposeConstraint

Force a tree to match a constraint
KeptPaths

Paths present in reduced tree
Neworder

Reorder edges of a phylogenetic tree
NodeDepth

Distance of each node from tree exterior
MorphoBankDecode

Decode MorphoBank text
MatrixToPhyDat

Convert between matrices and phyDat objects
PathLengths

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

Generate binary tree by collapsing polytomies
MSTEdges

Minimum spanning tree
NonDuplicateRoot

Non-duplicate root
NTip

Number of leaves in a phylogenetic tree
NewickTree

Write Newick Tree
NodeOrder

Order of each node in a tree
StringToPhyDat

Convert between strings and phyDat objects
RightmostCharacter

Rightmost character of string
RenumberTree

Reorder tree edges and nodes
ReadCharacters

Read phylogenetic characters from file
ReadTntTree

Parse TNT Tree
SplitsInBinaryTree

Maximum splits in an n-leaf tree
RenumberTips

Renumber a tree's tips
RootTree

Root or unroot a phylogenetic tree
Stemwardness

"Stemwardness" of a leaf
SampleOne

Quickly sample
Renumber

Renumber a tree's nodes and tips
Splits

Convert object to Splits
PolarizeSplits

Polarize splits on a single taxon
SplitMatchProbability

Probability of matching this well
SplitFrequency

Frequency of splits
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
SortTree

Sort tree
RootNode

Which node is a tree's root?
RoguePlot

Visualize position of rogue taxa
TipsInSplits

Tips contained within splits
TotalCopheneticIndex

Total Cophenetic Index
TreeNumber

Unique integer indices for bifurcating tree topologies
TreeIsRooted

Is tree rooted?
TreeTools-package

TreeTools
UnshiftTree

Add tree to start of list
WriteTntCharacters

Write morphological character matrix to TNT file
Unquote

Remove quotation marks from a string
TipLabels

Extract tip labels
UnrootedTreesMatchingSplit

Number of trees consistent with split
SupportColour

Colour for node support value
unrootedKeys

Integer representing shape of a tree
TrivialSplits

Identify and remove trivial splits
as.multiPhylo

Convert object to multiPhylo class
brewer

Brewer palettes
as.Newick

Write a phylogenetic tree in Newick format
SpectrumLegend

Produce a legend for continuous gradient scales
TrivialTree

Generate trivial trees
print.TreeNumber

Print TreeNumber object
nRootedShapes

Number of rooted / unrooted tree shapes
.RandomParent

Random parent vector
Subtree

Extract a subtree
Subsplit

Subset of a split on fewer leaves
TreesMatchingTree

Number of trees containing a tree
TreesMatchingSplit

Number of trees matching a bipartition split
sort.multiPhylo

Sort a list of phylogenetic trees
sapply64

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

Double factorials
edge_to_splits

Efficiently convert edge matrix to splits
match.Splits

Split matching
xor

Exclusive OR operation
logDoubleFactorials

Natural logarithms of double factorials