TreeLength: Calculate the parsimony score of a tree given a dataset

IWScoreR Documentation

Calculate the parsimony score of a tree given a dataset

Description

TreeLength() uses the Morphy library \insertCiteBrazeau2017TreeSearch to calculate a parsimony score for a tree, handling inapplicable data according to the algorithm of \insertCiteBrazeau2019;textualTreeSearch. Trees may be scored using equal weights, implied weights \insertCiteGoloboff1993TreeSearch, or profile parsimony \insertCiteFaith2001TreeSearch.

Usage

IWScore(tree, dataset, concavity = 10L, ...)

TreeLength(tree, dataset, concavity = Inf)

## S3 method for class 'phylo'
TreeLength(tree, dataset, concavity = Inf)

## S3 method for class 'numeric'
TreeLength(tree, dataset, concavity = Inf)

## S3 method for class 'list'
TreeLength(tree, dataset, concavity = Inf)

## S3 method for class 'multiPhylo'
TreeLength(tree, dataset, concavity = Inf)

Fitch(tree, dataset)

Arguments

tree

A tree of class phylo, a list thereof (optionally of class multiPhylo), or an integer – in which case tree random trees will be uniformly sampled.

dataset

A phylogenetic data matrix of phangorn class phyDat, whose names correspond to the labels of any accompanying tree.

concavity

Determines the degree to which extra steps beyond the first are penalized. Specify a numeric value to use implied weighting \insertCiteGoloboff1993TreeSearch; concavity specifies k in k / e + k. A value of 10 is recommended; TNT sets a default of 3, but this is too low in some circumstances \insertCiteGoloboff2018,Smith2019TreeSearch. Better still explore the sensitivity of results under a range of concavity values, e.g. k = 2 ^ (1:7). Specify Inf to weight each additional step equally. Specify "profile" to employ profile parsimony \insertCiteFaith2001TreeSearch.

...

unused; allows additional parameters specified within ... to be received by the function without throwing an error.

Value

TreeLength() returns a numeric vector containing the score for each tree in tree.

Author(s)

Martin R. Smith (using Morphy C library, by Martin Brazeau)

References

\insertAllCited

See Also

  • Conduct tree search using MaximizeParsimony() (command line), EasyTrees() (graphical user interface), or TreeSearch() (custom optimality criteria).

  • See score for each character: CharacterLength().

Other tree scoring: CharacterLength(), LengthAdded(), MinimumLength(), MorphyTreeLength(), TaxonInfluence()

Examples

data("inapplicable.datasets")
tree <- TreeTools::BalancedTree(inapplicable.phyData[[1]])
TreeLength(tree, inapplicable.phyData[[1]])
TreeLength(tree, inapplicable.phyData[[1]], concavity = 10)
TreeLength(tree, inapplicable.phyData[[1]], concavity = "profile")
TreeLength(5, inapplicable.phyData[[1]])

TreeSearch documentation built on Aug. 26, 2023, 9:06 a.m.