Learn R Programming

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

TreeTools (version 1.7.3)

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

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

July 20th, 2022

Functions in TreeTools (1.7.3)

ClusterTable

Convert phylogenetic tree to ClusterTable
ArtificialExtinction

Artificial Extinction
ClusterTable-methods

S3 methods for ClusterTable objects
AncestorEdge

Ancestral edge
CladeSizes

Clade sizes
CollapseNode

Collapse nodes on a phylogenetic tree
EndSentence

Add full stop to end of a sentence
EdgeDistances

Distance between edges
DescendantEdges

Identify descendant edges
DoubleFactorial

Double factorial
Consensus

Construct consensus trees
CompatibleSplits

Which splits are compatible?
DropTip

Drop leaves from tree
EdgeAncestry

Ancestors of an edge
LabelSplits

Label splits
KeptVerts

Identify vertices retained when leaves are dropped
NJTree

Generate a neighbour joining tree
NPartitionPairs

Distributions of tips consistent with a partition pair
NSplits

Number of distinct splits
NRooted

Number of trees
ConsensusWithout

Reduced consensus, omitting specified taxa
GenerateTree

Generate pectinate, balanced or random trees
ListAncestors

List ancestors
LeafLabelInterchange

Leaf label interchange
MatrixToPhyDat

Convert between matrices and phyDat objects
EnforceOutgroup

Generate a tree with a specified outgroup
ConstrainedNJ

Constrained neighbour-joining tree
ExtractTaxa

Extract taxa from a matrix block
Lobo.data

Data from Zhang et al. 2016
Hamming

Hamming distance between taxa in a phylogenetic dataset
NDescendants

Count descendants for each node in a tree
PathLengths

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

Distances between each pair of trees
N1Spr

Number of trees one SPR step away
MRCA

Most recent common ancestor
Renumber

Renumber a tree's nodes and tips
RenumberTips

Renumber a tree's tips
RootNode

Which node is a tree's root?
RoguePlot

Visualize position of rogue taxa
Neworder

Reorder edges of a phylogenetic tree
NodeDepth

Distance of each node from tree exterior
MorphoBankDecode

Decode MorphoBank text
NodeOrder

Order of each node in a tree
StringToPhyDat

Convert between strings and phyDat objects
PolarizeSplits

Polarize splits on a single taxon
NonDuplicateRoot

Non-duplicate root
Splits

Convert object to Splits
SortTree

Sort tree
SingleTaxonTree

Generate a single taxon tree
ReadCharacters

Read phylogenetic characters from file
ReadTntTree

Parse TNT Tree
TreeNumber

Unique integer indices for bifurcating tree topologies
SplitsInBinaryTree

Maximum splits in an n-leaf tree
UnshiftTree

Add tree to start of list
TotalCopheneticIndex

Total Cophenetic Index
WriteTntCharacters

Write morphological character matrix to TNT file
TreeIsRooted

Is tree rooted?
RootTree

Root or unroot a phylogenetic tree
SampleOne

Quickly sample
ImposeConstraint

Force a tree to match a constraint
RenumberTree

Reorder tree edges and nodes
RightmostCharacter

Rightmost character of string
logDoubleFactorials

Natural logarithms of double factorials
Stemwardness

'Stemwardness' of a leaf
Subsplit

Subset of a split on fewer leaves
match.Splits

Split matching
TreeTools-package

TreeTools
KeptPaths

Paths present in reduced tree
unrootedKeys

Integer representing shape of a tree
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
SplitMatchProbability

Probability of matching this well
as.Newick

Write a phylogenetic tree in Newick format
doubleFactorials

Double factorials
TreesMatchingSplit

Number of trees matching a bipartition split
edge_to_splits

Efficiently convert edge matrix to splits
MakeTreeBinary

Generate binary tree by collapsing polytomies
MSTEdges

Minimum spanning tree
NTip

Number of leaves in a phylogenetic tree
TreesMatchingTree

Number of trees containing a tree
TipLabels

Extract tip labels
TipsInSplits

Tips contained within splits
NewickTree

Write Newick Tree
Unquote

Remove quotation marks from a string
UnrootedTreesMatchingSplit

Number of trees consistent with split
TrivialSplits

Identify and remove trivial splits
as.multiPhylo

Convert object to multiPhylo class
sort.multiPhylo

Sort a list of phylogenetic trees
sapply64

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

Produce a legend for continuous gradient scales
.RandomParent

Random parent vector
SplitFrequency

Frequency of splits
brewer

Brewer palettes
SupportColour

Colour for node support value
Subtree

Extract a subtree
nRootedShapes

Number of rooted / unrooted tree shapes
xor

Exclusive OR operation
print.TreeNumber

Print TreeNumber object
CharacterInformation

Character information content
ApeTime

Read modification time from "ape" Nexus file
CladisticInfo

Cladistic information content of a tree
AddTip

Add a tip to a phylogenetic tree