alifestd_collapse_unifurcations

alifestd_collapse_unifurcations(phylogeny_df: DataFrame, mutate: bool = False, root_ancestor_token: str = 'none') DataFrame

Pare record to bypass organisms with one ancestor and one descendant.

May leave a root unifurcation present. See alifestd_delete_unifurcating_roots_asexual.

The option root_ancestor_token will be sandwiched in brackets to create the ancestor list entry for genesis organisms. For example, the token “None” will yield the entry “[None]” and the token “” will yield the entry “[]”. Default “none”.

Input dataframe is not mutated by this operation unless mutate set True. If mutate set True, operation does not occur in place; still use return value to get transformed phylogeny dataframe.

See Also

alifestd_collapse_unifurcations_polars :

Polars-based implementation.