Learn R Programming

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

TreeTools (version 1.7.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, 2021) , 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.0

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

March 21st, 2022

Functions in TreeTools (1.7.0)

AncestorEdge

Ancestral edge
CollapseNode

Collapse nodes on a phylogenetic tree
CharacterInformation

Character information content
ArtificialExtinction

Artificial Extinction
CladisticInfo

Cladistic information content of a tree
Consensus

Construct consensus trees
ApeTime

Read modification time from 'ape' Nexus file
AddTip

Add a tip to a phylogenetic tree
CompatibleSplits

Which splits are compatible?
EnforceOutgroup

Generate a tree with a specified outgroup
CladeSizes

Clade sizes
EndSentence

Add full stop to end of a sentence
EdgeDistances

Distance between edges
ConsensusWithout

Reduced consensus, omitting specified taxa
KeptVerts

Identify vertices retained when leaves are dropped
ConstrainedNJ

Constrained neighbour-joining tree
LabelSplits

Label splits
ListAncestors

List ancestors
LeafLabelInterchange

Leaf label interchange
ExtractTaxa

Extract taxa from a matrix block
MSTEdges

Minimum spanning tree
NJTree

Generate a neighbour joining tree
NPartitionPairs

Distributions of tips consistent with a partition pair
NodeOrder

Order of each node in a tree
MakeTreeBinary

Generate binary tree by collapsing polytomies
NTip

Number of leaves in a phylogenetic tree
NDescendants

Count descendants for each node in a tree
N1Spr

Number of trees one SPR step away
NewickTree

Write Newick Tree
Neworder

Reorder edges of a phylogenetic tree
GenerateTree

Generate pectinate, balanced or random trees
Hamming

Hamming distance between taxa in a phylogenetic dataset
PathLengths

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

Distance of each node from tree exterior
NonDuplicateRoot

Non-duplicate root
DropTip

Drop leaves from tree
SampleOne

Quickly sample
RootTree

Root or unroot a phylogenetic tree
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
RenumberTree

Reorder tree edges and nodes
SplitMatchProbability

Probability of matching this well
RightmostCharacter

Rightmost character of string
MorphoBankDecode

Decode MorphoBank text
PairwiseDistances

Distances between each pair of trees
ReadCharacters

Read phylogenetic characters from file
MatrixToPhyDat

Convert between matrices and phyDat objects
Subtree

Extract a subtree
SupportColour

Colour for node support value
TipLabels

Extract tip labels
TipsInSplits

Tips contained within splits
ImposeConstraint

Force a tree to match a constraint
EdgeAncestry

Ancestors of an edge
NRooted

Number of trees
KeptPaths

Paths present in reduced tree
Splits

Convert object to Splits
TreeNumber

Unique integer indices for bifurcating tree topologies
SplitsInBinaryTree

Maximum splits in an n-leaf tree
xor

Exclusive OR operation
as.Newick

Write a phylogenetic tree in Newick format
ReadTntTree

Parse TNT Tree
.RandomParent

Random parent vector
DescendantEdges

Identify descendant edges
DoubleFactorial

Double factorial
StringToPhyDat

Convert between strings and phyDat objects
brewer

Brewer palettes
Unquote

Remove quotation marks from a string
UnrootedTreesMatchingSplit

Number of trees consistent with split
PolarizeSplits

Polarize splits on a single taxon
unrootedKeys

Integer representing shape of a tree
as.multiPhylo

Convert object to multiPhylo class
Lobo.data

Data from Zhang et al. 2016
NSplits

Number of distinct splits
sort.multiPhylo

Sort a list of phylogenetic trees
sapply64

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

Is tree rooted?
TotalCopheneticIndex

Total Cophenetic Index
RootNode

Which node is a tree's root?
doubleFactorials

Double factorials
RoguePlot

Visualize position of rogue taxa
Subsplit

Subset of a split on fewer leaves
Stemwardness

'Stemwardness' of a leaf
edge_to_splits

Efficiently convert edge matrix to splits
MRCA

Most recent common ancestor
TreeTools-package

TreeTools
match.Splits

Split matching
RenumberTips

Renumber a tree's tips
SortTree

Sort tree
UnshiftTree

Add tree to start of list
SingleTaxonTree

Generate a single taxon tree
WriteTntCharacters

Write morphological character matrix to TNT file
Renumber

Renumber a tree's nodes and tips
logDoubleFactorials

Natural logarithms of double factorials
SpectrumLegend

Produce a legend for continuous gradient scales
SplitFrequency

Frequency of splits
print.TreeNumber

Print TreeNumber object
TreesMatchingSplit

Number of trees matching a bipartition split
TreesMatchingTree

Number of trees containing a tree
TrivialSplits

Identify and remove trivial splits
nRootedShapes

Number of rooted / unrooted tree shapes