TreeSearch (version 0.4.0)

IWScoreMorphy: Profile Parsimony Score

Description

Calculate a tree's Profile Parsimony score with a given dataset, after Faith and Trueman (2001).

Usage

IWScoreMorphy(parent, child, dataset, concavity = 10L,
  minLength = attr(dataset, "min.length"), ...)

ProfileScore(tree, dataset)

ProfileScoreMorphy(parent, child, dataset, ...)

ProfileInitMorphy(dataset)

ProfileDestroyMorphy(dataset)

Arguments

parent

Integer vector corresponding to the first column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 1].

child

Integer vector corresponding to the second column of the edge matrix of a tree of class phylo, i.e. tree$edge[, 2].

dataset

Dataset of class phyDat. The dataset should have been prepared using dataset <- PrepareDataProfile(dataset); if this step has not been completed, the dataset will be (time-consumingly) prepared within the function. In subsidiary functions, the dataset will have been initialized using ProfileInitMorphy, must be destroyed using ProfileDestroyMorphy.

concavity

A numeric value to use as the concavity constant (k) in implied weighting. Defaults to 10; TNT sets a default of 3, but this is too low in some circumstances (Smith, 2019).

minLength

Integer vector specifying the minimum length possible for each character in dataset, perhaps calculated using MinimumLength.

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

tree

A tree of class phylo.

Value

Zero minus the profile score (because the optimization algorithm treats smaller numbers as better)

Functions

  • IWScoreMorphy: Scorer for Implied Weighting dataset.

  • ProfileScoreMorphy: Scorer for initialized dataset.

  • ProfileInitMorphy: Initialize dataset by adding morphyObjs attribute.

  • ProfileDestroyMorphy: Free memory from morphyObjs initialized by ProfileScoreMorphy().

References

Faith2001TreeSearch

Examples

Run this code
# NOT RUN {
  data(referenceTree)
  data(congreveLamsdellMatrices)
  # In actual use, the dataset should be prepared with a much higher
  # precision: try 1e+06?
  # Of course, gaining higher precision takes substantially longer.
  dataset <- suppressWarnings(
    PrepareDataProfile(congreveLamsdellMatrices[[42]], precision = 1e+03))
  ProfileScore(referenceTree, dataset)

# }

Run the code above in your browser using DataLab