Learn R Programming

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

TreeTools (version 1.9.1)

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.9.1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

March 20th, 2023

Functions in TreeTools (1.9.1)

CladeSizes

Clade sizes
AncestorEdge

Ancestral edge
CladisticInfo

Cladistic information content of a tree
ClusterTable

Convert phylogenetic tree to ClusterTable
ClusterTable-methods

S3 methods for ClusterTable objects
ArtificialExtinction

Artificial Extinction
CharacterInformation

Character information content
CollapseNode

Collapse nodes on a phylogenetic tree
ApeTime

Read modification time from "ape" Nexus file
AddTip

Add a tip to a phylogenetic tree
DropTip

Drop leaves from tree
ConstrainedNJ

Constrained neighbour-joining tree
EdgeDistances

Distance between edges
ConsensusWithout

Reduced consensus, omitting specified taxa
EndSentence

Add full stop to end of a sentence
Consensus

Construct consensus trees
DescendantEdges

Identify descendant edges
EdgeAncestry

Ancestors of an edge
DoubleFactorial

Double factorial
CompatibleSplits

Which splits are compatible?
GenerateTree

Generate pectinate, balanced or random trees
Hamming

Hamming distance between taxa in a phylogenetic dataset
KeptVerts

Identify vertices retained when leaves are dropped
KeptPaths

Paths present in reduced tree
LeafLabelInterchange

Leaf label interchange
LabelSplits

Label splits
EnforceOutgroup

Generate a tree with a specified outgroup
ExtractTaxa

Extract taxa from a matrix block
ImposeConstraint

Force a tree to match a constraint
ListAncestors

List ancestors
NPartitionPairs

Distributions of tips consistent with a partition pair
MorphoBankDecode

Decode MorphoBank text
Lobo.data

Data from Zhang et al. 2016
NJTree

Generate a neighbour joining tree
MakeTreeBinary

Generate binary tree by collapsing polytomies
NDescendants

Count descendants for each node in a tree
N1Spr

Number of trees one SPR step away
MSTEdges

Minimum spanning tree
MRCA

Most recent common ancestor
MatrixToPhyDat

Convert between matrices and phyDat objects
PathLengths

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

Number of trees
PairwiseDistances

Distances between each pair of trees
NSplits

Number of distinct splits
NTip

Number of leaves in a phylogenetic tree
NonDuplicateRoot

Non-duplicate root
NewickTree

Write Newick Tree
NodeOrder

Order of each node in a tree
NodeDepth

Distance of each node from tree exterior
Neworder

Reorder edges of a phylogenetic tree
PolarizeSplits

Polarize splits on a single taxon
Renumber

Renumber a tree's nodes and tips
StringToPhyDat

Convert between strings and phyDat objects
RightmostCharacter

Rightmost character of string
RenumberTips

Renumber a tree's tips
RootNode

Which node is a tree's root?
RoguePlot

Visualize position of rogue taxa
ReadTntTree

Parse TNT Tree
RenumberTree

Reorder tree edges and nodes
ReadCharacters

Read phylogenetic characters from file
RootTree

Root or unroot a phylogenetic tree
SplitFrequency

Frequency of splits
SortTree

Sort tree
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
SampleOne

Quickly sample
Stemwardness

"Stemwardness" of a leaf
SpectrumLegend

Produce a legend for continuous gradient scales
SplitsInBinaryTree

Maximum splits in an n-leaf tree
Splits

Convert object to Splits
SplitMatchProbability

Probability of matching this well
TreeTools-package

TreeTools
SupportColour

Colour for node support value
TipsInSplits

Tips contained within splits
TreeIsRooted

Is tree rooted?
Subtree

Extract a subtree
Subsplit

Subset of a split on fewer leaves
TreeNumber

Unique integer indices for bifurcating tree topologies
TipLabels

Extract tip labels
TotalCopheneticIndex

Total Cophenetic Index
unrootedKeys

Integer representing shape of a tree
TrivialSplits

Identify and remove trivial splits
TreesMatchingTree

Number of trees containing a tree
UnshiftTree

Add tree to start of list
as.multiPhylo

Convert object to multiPhylo class
TreesMatchingSplit

Number of trees matching a bipartition split
UnrootedTreesMatchingSplit

Number of trees consistent with split
TrivialTree

Generate trivial trees
as.Newick

Write a phylogenetic tree in Newick format
Unquote

Remove quotation marks from a string
WriteTntCharacters

Write morphological character matrix to TNT file
edge_to_splits

Efficiently convert edge matrix to splits
doubleFactorials

Double factorials
sapply64

Apply a function that returns 64-bit integers over a list or vector
sort.multiPhylo

Sort a list of phylogenetic trees
brewer

Brewer palettes
nRootedShapes

Number of rooted / unrooted tree shapes
match.Splits

Split matching
.RandomParent

Random parent vector
print.TreeNumber

Print TreeNumber object
xor

Exclusive OR operation
logDoubleFactorials

Natural logarithms of double factorials