alifestd_mask_monomorphic_clades_asexual
- alifestd_mask_monomorphic_clades_asexual(phylogeny_df: DataFrame, mutate: bool = False, *, trait_mask: ndarray, trait_values: ndarray) DataFrame
Compute a mask marking “monomorphic” clades where all members with a trait defined value share the same trait value.
Clades containing no members with a defined trait value are considered monomorphic. All leaf nodes are considered monomorphic.
Parameters
- phylogeny_dfpd.DataFrame
DataFrame containing the phylogeny, including an ancestor_id column.
- mutatebool, default=False
If False, operates on a copy of phylogeny_df; if True, modifies phylogeny_df in place (but still returns it).
- trait_masknp.ndarray
Boolean array marking the nodes that have a defined trait value, aligned with phylogeny_df.index.
- trait_valuesnp.ndarray
Array of trait values aligned with phylogeny_df.index.
Returns
pd.DataFrame