Tree manipulation

Functions for editing phylogenetic trees.

AddTip() AddTipEverywhere()

Add a tip to a phylogenetic tree

CollapseNode() CollapseEdge()

Collapse nodes on a phylogenetic tree

ConsensusWithout() MarkMissing()

Reduced consensus, omitting specified taxa

DropTip() KeepTip()

Drop tips from tree

EnforceOutgroup()

Generate a tree with a specific outgroup

ImposeConstraint() AddUnconstrained()

Force a tree to match a constraint

LeafLabelInterchange()

Leaf label interchange

MakeTreeBinary()

Generate binary tree by collapsing polytomies

Renumber()

Renumber a tree's nodes and tips

RenumberTips()

Renumber a tree's tips

RootTree() RootOnNode() UnrootTree()

Root or unroot a phylogenetic tree

SingleTaxonTree()

Generate a single taxon tree

SortTree()

Sort tree

Subtree()

Extract a subtree

Tree navigation

Functions to navigate phylogenetic trees.

CladeSizes()

Clade sizes

DescendantEdges() AllDescendantEdges()

Identify descendant edges

EdgeAncestry()

Ancestors of an edge

EdgeDistances()

Distance between edges

ListAncestors() AllAncestors()

List ancestors

MRCA()

Most recent common ancestor

NDescendants()

Count descendants for each node in a tree

NodeDepth()

Distance of each node from tree exterior

NodeOrder()

Order of each node in a tree

RootNode()

Which node is a tree's root?

Tree creation

Functions to generate phylogenetic trees.

ConstrainedNJ()

Constrained neighbour-joining tree

RandomTree() PectinateTree() BalancedTree() StarTree()

Generate pectinate, balanced or random trees

NJTree()

Generate a neighbour joining tree

SingleTaxonTree()

Generate a single taxon tree

as.TreeNumber() as.phylo(<numeric>) as.phylo(<TreeNumber>)

Unique integer indices for bifurcating tree topologies

print(<TreeNumber>)

Print TreeNumber object

Tree properties

Functions describing properties of trees.

CladisticInfo() PhylogeneticInfo() PhylogeneticInformation() CladisticInformation()

Cladistic information content of a tree

Consensus()

Consensus trees

SisterSize() RootNodeDistance() RootNodeDist()

'Stemwardness' of a leaf

TotalCopheneticIndex() TCIContext()

Total Cophenetic Index

ConsensusWithout() MarkMissing()

Reduced consensus, omitting specified taxa

NTip()

Number of leaves in a phylogenetic tree

NSplits() NPartitions()

Number of distinct splits

PairwiseDistances()

Distances between each pair of trees

TipLabels() AllTipLabels()

Extract tip labels

TreeIsRooted()

Is tree rooted?

Phylogenetic data

Functions for modifying and evaluating datasets.

StringToPhyDat() StringToPhydat() PhyToString() PhyDatToString() PhydatToString()

Convert between strings and phyDat objects

ArtificialExtinction() ArtEx()

Artificial Extinction

Parsers

Functions to parse or write files.

as.Newick()

Write a phylogenetic tree in Newick format

ApeTime()

Read modification time from 'ape' Nexus file

ExtractTaxa() NexusTokens()

Extract taxa from a matrix block

NewickTree()

Write Newick Tree

ReadCharacters() ReadTntCharacters() ReadNotes() ReadAsPhyDat() ReadTntAsPhyDat() PhyDat()

Read phylogenetic characters from file

ReadTntTree() TntText2Tree() TNTText2Tree()

Parse TNT Tree

StringToPhyDat() StringToPhydat() PhyToString() PhyDatToString() PhydatToString()

Convert between strings and phyDat objects

WriteTntCharacters()

Write morphological character matrix to TNT file

EndSentence()

Add full stop to end of a sentence

MorphoBankDecode()

Decode MorphoBank text

RightmostCharacter()

Rightmost character of string

Unquote()

Remove quotation marks from a string

Split manipulation

Functions that manipulate bipartition splits.

Subsplit()

Subset of a split on fewer leaves

TrivialSplits() WithoutTrivialSplits()

Identify and remove trivial splits

LabelSplits()

Label splits

NSplits() NPartitions()

Number of distinct splits

NTip()

Number of leaves in a phylogenetic tree

PolarizeSplits()

Polarize splits on a single taxon

SplitFrequency() SplitNumber() ForestSplits() TreeSplits()

Frequency of splits

as.Splits() as.logical(<Splits>)

Convert object to Splits

SplitsInBinaryTree()

Maximum splits in an n-leaf tree

TipLabels() AllTipLabels()

Extract tip labels

TipsInSplits() SplitImbalance()

Tips contained within splits

match() `%in%` in.Splits()

Split matching

Information and combinatorics

Functions to calculate factorial quantities.

N1Spr() IC1Spr()

Number of trees one SPR step away

DoubleFactorial() DoubleFactorial64() LnDoubleFactorial() Log2DoubleFactorial() LogDoubleFactorial() LnDoubleFactorial.int() LogDoubleFactorial.int()

Double factorial

NPartitionPairs()

Distributions of tips consistent with a partition pair

CladisticInfo() PhylogeneticInfo() PhylogeneticInformation() CladisticInformation()

Cladistic information content of a tree

NRooted() NUnrooted() NRooted64() NUnrooted64() LnUnrooted() LnUnrooted.int() Log2Unrooted() Log2Unrooted.int() LnRooted() LnRooted.int() Log2Rooted() Log2Rooted.int() LnUnrootedSplits() Log2UnrootedSplits() NUnrootedSplits() LnUnrootedMult() Log2UnrootedMult() NUnrootedMult()

Number of trees

TreesMatchingTree() LnTreesMatchingTree() Log2TreesMatchingTree()

Number of trees containing a tree

CharacterInformation()

Character information content

SplitInformation() MultiSplitInformation()

Phylogenetic information content of splitting leaves into two partitions

SplitMatchProbability() LnSplitMatchProbability()

Probability of matching this well

TreesMatchingSplit() LnTreesMatchingSplit() Log2TreesMatchingSplit()

Number of trees matching a bipartition split

UnrootedTreesMatchingSplit() LnUnrootedTreesMatchingSplit() Log2UnrootedTreesMatchingSplit()

Number of trees consistent with split

Split support

Calculate and depict support for splits (‘edges’ / ‘nodes’) in trees.

LabelSplits()

Label splits

SplitFrequency() SplitNumber() ForestSplits() TreeSplits()

Frequency of splits

SupportColour() SupportColor()

Colour for node support value

Datasets

Data that accompanies the package.

brewer

Brewer palettes

doubleFactorials

Double factorials

Lobo.data Lobo.phy

Data from Zhang et al. 2016

logDoubleFactorials

Natural logarithms of double factorials

nRootedShapes nUnrootedShapes

Number of rooted / unrooted tree shapes

Utility functions

Miscellaneous functions to simplify or expedite basic functionality.

as.multiPhylo()

Convert object to multiPhylo class

MSTEdges() MSTLength()

Minimum spanning tree

RightmostCharacter()

Rightmost character of string

SampleOne()

Quickly sample

sapply64() vapply64() replicate64()

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

UnshiftTree()

Add tree to start of list