Learn R Programming

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

TreeTools (version 1.8.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.8.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

September 15th, 2022

Functions in TreeTools (1.8.0)

CharacterInformation

Character information content
CladisticInfo

Cladistic information content of a tree
ApeTime

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

S3 methods for ClusterTable objects
CladeSizes

Clade sizes
ArtificialExtinction

Artificial Extinction
ClusterTable

Convert phylogenetic tree to ClusterTable
AddTip

Add a tip to a phylogenetic tree
CollapseNode

Collapse nodes on a phylogenetic tree
AncestorEdge

Ancestral edge
ConstrainedNJ

Constrained neighbour-joining tree
DropTip

Drop leaves from tree
DoubleFactorial

Double factorial
ConsensusWithout

Reduced consensus, omitting specified taxa
DescendantEdges

Identify descendant edges
EdgeAncestry

Ancestors of an edge
Consensus

Construct consensus trees
EdgeDistances

Distance between edges
CompatibleSplits

Which splits are compatible?
EndSentence

Add full stop to end of a sentence
GenerateTree

Generate pectinate, balanced or random trees
KeptPaths

Paths present in reduced tree
EnforceOutgroup

Generate a tree with a specified outgroup
ImposeConstraint

Force a tree to match a constraint
LeafLabelInterchange

Leaf label interchange
ListAncestors

List ancestors
MorphoBankDecode

Decode MorphoBank text
MatrixToPhyDat

Convert between matrices and phyDat objects
MRCA

Most recent common ancestor
ExtractTaxa

Extract taxa from a matrix block
NPartitionPairs

Distributions of tips consistent with a partition pair
NJTree

Generate a neighbour joining tree
MSTEdges

Minimum spanning tree
LabelSplits

Label splits
Lobo.data

Data from Zhang et al. 2016
NTip

Number of leaves in a phylogenetic tree
KeptVerts

Identify vertices retained when leaves are dropped
MakeTreeBinary

Generate binary tree by collapsing polytomies
NodeOrder

Order of each node in a tree
Neworder

Reorder edges of a phylogenetic tree
Hamming

Hamming distance between taxa in a phylogenetic dataset
NSplits

Number of distinct splits
NRooted

Number of trees
N1Spr

Number of trees one SPR step away
NDescendants

Count descendants for each node in a tree
NewickTree

Write Newick Tree
ReadTntTree

Parse TNT Tree
PolarizeSplits

Polarize splits on a single taxon
NonDuplicateRoot

Non-duplicate root
Renumber

Renumber a tree's nodes and tips
StringToPhyDat

Convert between strings and phyDat objects
ReadCharacters

Read phylogenetic characters from file
RenumberTips

Renumber a tree's tips
NodeDepth

Distance of each node from tree exterior
SplitMatchProbability

Probability of matching this well
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
RightmostCharacter

Rightmost character of string
Splits

Convert object to Splits
RenumberTree

Reorder tree edges and nodes
SpectrumLegend

Produce a legend for continuous gradient scales
PathLengths

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

Distances between each pair of trees
RoguePlot

Visualize position of rogue taxa
TreeNumber

Unique integer indices for bifurcating tree topologies
unrootedKeys

Integer representing shape of a tree
Subsplit

Subset of a split on fewer leaves
SplitsInBinaryTree

Maximum splits in an n-leaf tree
Stemwardness

"Stemwardness" of a leaf
SingleTaxonTree

Generate a single taxon tree
SortTree

Sort tree
TipLabels

Extract tip labels
RootNode

Which node is a tree's root?
RootTree

Root or unroot a phylogenetic tree
TreeIsRooted

Is tree rooted?
TreesMatchingTree

Number of trees containing a tree
TrivialSplits

Identify and remove trivial splits
TotalCopheneticIndex

Total Cophenetic Index
SplitFrequency

Frequency of splits
Subtree

Extract a subtree
SampleOne

Quickly sample
Unquote

Remove quotation marks from a string
as.multiPhylo

Convert object to multiPhylo class
as.Newick

Write a phylogenetic tree in Newick format
TipsInSplits

Tips contained within splits
edge_to_splits

Efficiently convert edge matrix to splits
doubleFactorials

Double factorials
UnrootedTreesMatchingSplit

Number of trees consistent with split
nRootedShapes

Number of rooted / unrooted tree shapes
SupportColour

Colour for node support value
sapply64

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

Add tree to start of list
WriteTntCharacters

Write morphological character matrix to TNT file
brewer

Brewer palettes
.RandomParent

Random parent vector
print.TreeNumber

Print TreeNumber object
sort.multiPhylo

Sort a list of phylogenetic trees
xor

Exclusive OR operation
match.Splits

Split matching
TreeTools-package

TreeTools
TreesMatchingSplit

Number of trees matching a bipartition split
logDoubleFactorials

Natural logarithms of double factorials