cassiopeia.pp.convert_lineage_profile_to_character_matrix#
- cassiopeia.pp.convert_lineage_profile_to_character_matrix(lineage_profile, indel_priors=None, missing_allele_indicator=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
DataFrame
Lineage profile
- indel_priors
Optional
[DataFrame
] (default:None
) Dataframe mapping indels to prior probabilities
- missing_allele_indicator
Optional
[str
] (default:None
) An allele that is being used to represent missing data.
- missing_state_indicator
int
(default:-1
) State to indicate missing data
- lineage_profile
- Return type:
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.