cassiopeia.pp.convert_lineage_profile_to_character_matrix

cassiopeia.pp.convert_lineage_profile_to_character_matrix(lineage_profile, indel_priors=None, missing_state_indicator=- 1)[source]

Converts a lineage profile to a character matrix.

Takes in a lineage profile summarizing the explicit indel identities observed at each cut site in a cell and converts this into a character matrix where the indels are abstracted into integers.

Note

The lineage profile is converted directly into a character matrix, without performing any collapsing of duplicate states. Instead, this should have been done in the previous step, when calling convert_alleletable_to_lineage_profile().

Parameters
lineage_profile : DataFrameDataFrame

Lineage profile

indel_priors : DataFrame, NoneOptional[DataFrame] (default: None)

Dataframe mapping indels to prior probabilities

missing_state_indicator : intint (default: -1)

State to indicate missing data

Return type

Tuple[DataFrame, Dict[int, Dict[int, float]], Dict[int, Dict[int, str]]]Tuple[DataFrame, Dict[int, Dict[int, float]], Dict[int, Dict[int, str]]]

Returns

A character matrix, prior probability dictionary, and mapping from

character/state pairs to indel identities.