Learn R Programming

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

TreeSearch

This package exists to allow parsimony-style tree searches in R.

It extends the basic functionality available in phangorn, with a view to making tree search faster and more efficient, and allowing user-defined optimality criteria to be employed.

Implied weighting and heuristic searches such as the Parsimony Ratchet are implemented (function: Ratchet). Browse the vignettes (with vignette(package = "TreeSearch") to get started.

Installation

Install and load the library from CRAN as follows:

install.packages('TreeSearch')
library('TreeSearch')

If you're feeling brave, you can install the development version thus:

if(!require(devtools)) install.packages("devtools")
devtools::install_github('ms609/TreeSearch')

Optimailty criteria

TreeSearch allows the implementation of various optimality criteria, including

  • The Profile Parsimony approach introduced by Faith and Trueman (2001).
  • Successive Approximations weighting (Farris 1969).
  • Fitch parsimony with inapplicable data (Brazeau, Guillerme and Smith, 2017).

It is also possible to specify bespoke optimality criteria.

References

Brazeau, M. D., Guillerme, T. and Smith, M. R. 2017. Morphological phylogenetic analysis with inapplicable data. BioRχiv. doi:10.1101/209775

D. P. Faith, J. W. H. Trueman, Towards an inclusive philosophy for phylogenetic inference. Syst. Biol. 50, 331–350 (2001). doi:10.1080/10635150118627

Farris, J. S. (1969). A successive approximations approach to character weighting. Systematic Biology, 18(4), 374–385. doi:10.2307/2412182

Copy Link

Version

Install

install.packages('TreeSearch')

Monthly Downloads

1,977

Version

0.1.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Martin R Smith

Last Published

March 19th, 2018

Functions in TreeSearch (0.1.2)

AddTip

Add a tip to a phylogenetic tree
AllSPR

All SPR trees
ConsensusWithout

Consensus without taxa
AllAncestors

List all ancestral nodes
CladeSizes

Clade sizes
DFact

Double factorial
AsBinary

Convert a number to binary
C_node_depth

Node depth Wrapper for the ape function
Cladewise

Reorder tree Cladewise
AncestorEdge

Ancestral edge
EdgeAncestry

EdgeAncestry
Evaluate

Evaluate tree
EnforceOutgroup

Force taxa to form an outgroup
ExtractTaxa

Extract taxa from a matrix block
ICS

Information content per step
DescendantEdges

Descendant Edges
ICSteps

Information Content Steps
Fitch

Calculate parsimony score with inapplicable data
MatrixToList

Edge matrix to edge list
DoubleNNI

Double NNI
MatrixToPhyDat

Matrix to phydat
FitchSteps

Fitch score
Lobo.phy

Data from Zhang et al. 2016 in phyDat format
LogisticPoints

Logistic Points Extract points from a fitted model
LDFact

Log double factorial Handles odd and even inout numbers
MorphyWeights

Report the character weightings associated with a Morphy object
NRooted

Number of rooted/unrooted trees These functions return the number of rooted or unrooted trees consistent with a given pattern of splits.
NamedConstant

Named constant
LDFactorial

Log double factorial
MorphyTreeLength

Calculate parsimony score with inapplicable data
N1Spr

Number of trees on SPR step away Formula given by Given by Allen and Steel 2001.
NJTree

Neighbour Joining Tree
IWScore

Implied weights parsimony Score
IWScoreMorphy

Profile Parsimony Score
NNI

NNI
InfoAmounts

Amount of information in each character
MorphyErrorCheck

Check for error whilst modifying Morphy object
RearrangeEdges

Rearrange edges of a phylogenetic tree
PrepareDataProfile

Prepare data for Profile Parsimony
Renumber

Renumber a tree's nodes and tips
ListToMatrix

Edge list to edge matrix
SuccessiveWeights

Successive Weights
RandomTreeScore

Parsimony score of random postorder tree
RandomMorphyTree

Random postorder tree
Lobo.data

Raw data from Zhang et al. 2016
TBR

TBR
Ratchet

Parsimony Ratchet
MinimumSteps

Minimum steps
ReadCharacters

Read characters from Nexus file
RandomTree

Generate random tree topology from dataset
ReadTntTree

Parse TNT Tree
MorphyBootstrap

Ratchet bootstrapper
PhyDat2Morphy

Initialize a Morphy Object from a phyDat object
brewer

Brewer palettes
RenumberTips

Reorder tips
NeworderPhylo

neworder_phylo Wrapper for the ape function
congreveLamsdellMatrices

100 simulated data matrices
PhyToString

Extract character data from a phyDat object as a string
RenumberTree

Renumber tree Order edges and number nodes Wrapper for the C function RENUMBER_TREE
Subtree

Extract subtree
NeworderPruningwise

neworder_pruningwise Wrapper for the ape function
SPRWarning

TBR Warning Print a warning and return given tree
NonDuplicateRoot

Non-duplicate root
SuccessiveApproximations

Tree Search using Successive Approximations
TipsAreNames

Extract character data from dataset
inapplicable.datasets

Thirty Datasets with Inapplicable data
RightmostCharacter

Rightmost character of string
IWTreeSearch

Search for most parsimonious trees
OrderEdgesNumberNodes

Order edges and number nodes Wrapper for the C function
inapplicable.phyData

Thirty Datasets with Inapplicable data
SPR

Subtree Pruning and Rearrangement
UnloadTreeSearch

Unload this library
mpl_apply_tipdata

Commits parameters prior to nodal set calculations.
WithOneExtraStep

Number of trees with one extra step
StringToPhyDat

String to phyDat
SingleCharMorphy

Morphy object from single character
mpl_set_num_internal_nodes

Sets the number of internal nodes in the dataset
SampleOne

Quick sample
SingleTaxonTree

SingleTaxonTree
inapplicable.citations

Thirty Datasets with Inapplicable data
Suboptimality

Tree suboptimality
mpl_set_parsim_t

Sets a character's parsimony function type
mpl_delete_rawdata

Deletes the caller-input data.
mpl_attach_rawdata

Attach raw character state data (i.e. tip data).
UnloadMorphy

Destroy a Morphy Object
mpl_get_num_internal_nodes

Gets the number of internal nodal reconstruction sets being used by MorphyLib.
mpl_update_tip

Initial update of tip values following uppass reconstruction.
mpl_first_down_recon

Reconstructs the first (downpass) nodal reconstructions
mpl_first_up_recon

Reconstructs the second (uppass) nodal reconstructions.
mpl_get_numtaxa

Retrieve the number of taxa (rows) in the dataset.
referenceTree

Tree topology for matrix simulation
mpl_translate_error

Converts a numeric error code to human-readable format
mpl_get_charac_weight

Retrieve the weight of a character in the dataset
mpl_new_Morphy

Creates a new instance of a Morphy object
mpl_update_lower_root

Updates the nodal sets for a lower ('dummy') root node
mpl_get_num_charac

Retrieve the number of character (columns) in the dataset.
mpl_second_down_recon

Performs the second nodal reconstructions for characters with inapplicability.
SetMorphyWeights

Set the character weightings associated with a Morphy object
mpl_get_symbols

Retrieves the current list of symbols.
mpl_delete_Morphy

Destroys an instance of a Morphy object.
mpl_second_up_recon

Finalises the ancestral state reconstructions for characters with inapplicable values.
mpl_init_Morphy

Sets up the dimensions of the dataset.
mpl_attach_symbols

Attach a caller-specified list of symbols.
mpl_set_charac_weight

Set the weight of a character in the dataset
summary.morphyPtr

Details the attributes of a morphy object