Learn R Programming

TreeSearch (version 1.6.1)

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

Description

TreeLength() uses the Morphy library Brazeau2017TreeSearch to calculate a parsimony score for a tree, handling inapplicable data according to the algorithm of Brazeau2019;textualTreeSearch. Trees may be scored using equal weights, implied weights Goloboff1993TreeSearch, or profile parsimony Faith2001TreeSearch.

Usage

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

TreeLength(tree, dataset, concavity = Inf)

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

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

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

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

Fitch(tree, dataset)

Value

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

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. Perhaps load into R using ReadAsPhyDat. Additive (ordered) characters can be handled using Decompose.

concavity

Determines the degree to which extra steps beyond the first are penalized. Specify a numeric value to use implied weighting Goloboff1993TreeSearch; 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 Goloboff2018,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, (which underperforms step weighting approaches Goloboff2008,Goloboff2018,Goloboff2019,Smith2019TreeSearch). Specify "profile" to employ an approximation of profile parsimony Faith2001TreeSearch.

...

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

Author

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

References

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

Run this code
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]])

Run the code above in your browser using DataLab