Skip to content

Main content

Trait State Parsimony Cost Tool

Look up one directed state-transition cost in an explicit supplied parsimony matrix.

Loading tool…

Description

Return the directed matrix cell for parent-to-child transition.

A trait-transition model assigns costs to changes between states. A directed cost lookup is one input to ancestral reconstruction; the matrix may encode asymmetry and need not behave like a physical distance.

Return the directed matrix cell for parent-to-child transition.

When to use this tool

Use Trait State Parsimony Cost when you need a supplied trait-transition cost.

How to use the tool and how it works

  1. Enter parentState, childState, states, costs. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read cost. Use the output convention below.

Require unique states, known parent/child and a square nonnegative cost matrix. Return the directed matrix cell for parent-to-child transition.1

Input fieldMeaning and unitsAccepted input
parentStateParent StateRequired. Text; maximum UTF-16 length 8192.
childStateChild StateRequired. Text; maximum UTF-16 length 8192.
statesStatesRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
costsCostsRequired. Array of array of finite number; maximum items 128; maximum items 128.
Output fieldInterpretationReturned shape
costCostRequired. Finite number.
json
{
  "input": {
    "parentState": "A",
    "childState": "B",
    "states": [
      "A",
      "B"
    ],
    "costs": [
      [
        0,
        2
      ],
      [
        3,
        0
      ]
    ]
  },
  "output": {
    "cost": 2
  }
}

Limitations and assumptions

  • Costs need not be symmetric or satisfy a metric. One lookup is not a full ancestral-state reconstruction or tree-parsimony solution.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Run the complete ancestral-state or parsimony method on the intended tree. Review state definitions, transition assumptions and missing observations rather than inferring a reconstruction from one matrix entry.

References

  1. Calculation and input contract: evolutionary-biology/trait-state-parsimony-cost — tool.io

Similar or alternative tools