cassiopeia.data.get_lca_characters

cassiopeia.data.get_lca_characters(vecs, missing_state_indicator)[source]

Builds the character vector of the LCA of a list of character vectors, obeying Camin-Sokal Parsimony.

For each index in the reconstructed vector, imputes the non-missing character if only one of the constituent vectors has a missing value at that index, and imputes missing value if all have a missing value at that index.

Parameters
vecs : List[Union[List[int], List[Tuple[int, …]]]]List[Union[List[int], List[Tuple[int, …]]]]

A list of character vectors to generate an LCA for

missing_state_indicator : intint

The character representing missing values

Return type

List[int]List[int]

Returns

A list representing the character vector of the LCA