ivy.chars.catpars module

ivy.chars.catpars.ancstates(tree, chardata, stepmatrix)[source]

Return parsimony ancestral states

Parameters:
  • tree (Node) – Root of tree
  • chardata (Dict) – Dict of tip labels mapping to character states
  • stepmatrix (np.array) – Step matrix. Create default step matrix with default_costmatrix().
Returns:

Internal nodes mapping to reconstructed states.

Return type:

dict

ivy.chars.catpars.binary_deltran(tree, chardata, stepmatrix)[source]
ivy.chars.catpars.default_costmatrix(numstates, dtype=<type 'int'>)[source]

a square array with zeroes along the diagonal, ones elsewhere

ivy.chars.catpars.downpass(node, states, stepmatrix, chardata, node2dpv=None)[source]
ivy.chars.catpars.minstates(v)[source]

return the indices of v that equal the minimum

ivy.chars.catpars.uppass(node, states, stepmatrix, node2dpv, node2upm={}, node2ancstates=None)[source]