Learn R Programming

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

TreeTools (version 1.7.2)

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

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R. Smith

Last Published

May 24th, 2022

Functions in TreeTools (1.7.2)

ApeTime

Read modification time from 'ape' Nexus file
CollapseNode

Collapse nodes on a phylogenetic tree
AddTip

Add a tip to a phylogenetic tree
CladisticInfo

Cladistic information content of a tree
DescendantEdges

Identify descendant edges
DoubleFactorial

Double factorial
EnforceOutgroup

Generate a tree with a specified outgroup
EdgeDistances

Distance between edges
ClusterTable-methods

S3 methods for ClusterTable objects
EndSentence

Add full stop to end of a sentence
NonDuplicateRoot

Non-duplicate root
KeptPaths

Paths present in reduced tree
ImposeConstraint

Force a tree to match a constraint
NodeOrder

Order of each node in a tree
CharacterInformation

Character information content
CompatibleSplits

Which splits are compatible?
StringToPhyDat

Convert between strings and phyDat objects
AncestorEdge

Ancestral edge
ConstrainedNJ

Constrained neighbour-joining tree
ConsensusWithout

Reduced consensus, omitting specified taxa
MSTEdges

Minimum spanning tree
CladeSizes

Clade sizes
PolarizeSplits

Polarize splits on a single taxon
ExtractTaxa

Extract taxa from a matrix block
LeafLabelInterchange

Leaf label interchange
MatrixToPhyDat

Convert between matrices and phyDat objects
NRooted

Number of trees
MorphoBankDecode

Decode MorphoBank text
ListAncestors

List ancestors
NJTree

Generate a neighbour joining tree
NPartitionPairs

Distributions of tips consistent with a partition pair
NSplits

Number of distinct splits
Consensus

Construct consensus trees
KeptVerts

Identify vertices retained when leaves are dropped
Lobo.data

Data from Zhang et al. 2016
LabelSplits

Label splits
MRCA

Most recent common ancestor
TipsInSplits

Tips contained within splits
TipLabels

Extract tip labels
RenumberTree

Reorder tree edges and nodes
GenerateTree

Generate pectinate, balanced or random trees
MakeTreeBinary

Generate binary tree by collapsing polytomies
logDoubleFactorials

Natural logarithms of double factorials
match.Splits

Split matching
RoguePlot

Visualize position of rogue taxa
NTip

Number of leaves in a phylogenetic tree
RootNode

Which node is a tree's root?
NewickTree

Write Newick Tree
Hamming

Hamming distance between taxa in a phylogenetic dataset
N1Spr

Number of trees one SPR step away
RightmostCharacter

Rightmost character of string
SingleTaxonTree

Generate a single taxon tree
SplitMatchProbability

Probability of matching this well
SplitInformation

Phylogenetic information content of splitting leaves into two partitions
TreeIsRooted

Is tree rooted?
TreesMatchingSplit

Number of trees matching a bipartition split
TreeTools-package

TreeTools
TotalCopheneticIndex

Total Cophenetic Index
SortTree

Sort tree
NDescendants

Count descendants for each node in a tree
Neworder

Reorder edges of a phylogenetic tree
print.TreeNumber

Print TreeNumber object
nRootedShapes

Number of rooted / unrooted tree shapes
PathLengths

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

Renumber a tree's tips
Renumber

Renumber a tree's nodes and tips
PairwiseDistances

Distances between each pair of trees
ReadCharacters

Read phylogenetic characters from file
NodeDepth

Distance of each node from tree exterior
ReadTntTree

Parse TNT Tree
TreeNumber

Unique integer indices for bifurcating tree topologies
unrootedKeys

Integer representing shape of a tree
RootTree

Root or unroot a phylogenetic tree
Subtree

Extract a subtree
UnshiftTree

Add tree to start of list
SampleOne

Quickly sample
SupportColour

Colour for node support value
Splits

Convert object to Splits
SplitsInBinaryTree

Maximum splits in an n-leaf tree
doubleFactorials

Double factorials
WriteTntCharacters

Write morphological character matrix to TNT file
as.Newick

Write a phylogenetic tree in Newick format
as.multiPhylo

Convert object to multiPhylo class
UnrootedTreesMatchingSplit

Number of trees consistent with split
Unquote

Remove quotation marks from a string
edge_to_splits

Efficiently convert edge matrix to splits
brewer

Brewer palettes
xor

Exclusive OR operation
.RandomParent

Random parent vector
Stemwardness

'Stemwardness' of a leaf
SpectrumLegend

Produce a legend for continuous gradient scales
SplitFrequency

Frequency of splits
Subsplit

Subset of a split on fewer leaves
TrivialSplits

Identify and remove trivial splits
sort.multiPhylo

Sort a list of phylogenetic trees
TreesMatchingTree

Number of trees containing a tree
sapply64

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

Artificial Extinction
ClusterTable

Convert phylogenetic tree to ClusterTable
DropTip

Drop leaves from tree
EdgeAncestry

Ancestors of an edge