alifestd_find_pair_mrca_id_asexual

alifestd_find_pair_mrca_id_asexual(phylogeny_df: DataFrame, first: int, second: int, *, mutate: bool = False, is_topologically_sorted: bool | None = None, has_contiguous_ids: bool | None = None) int | None

Find the Most Recent Common Ancestor of two taxa.

Parameters

phylogeny_dfpd.DataFrame

Phylogeny in alife standard format.

firstint

First taxon id.

secondint

Second taxon id.

mutatebool, default False

If True, allows in-place modification of phylogeny_df.

is_topologically_sortedbool, optional

If provided, skips the topological sort check. If None (default), the check is performed automatically.

has_contiguous_idsbool, optional

If provided, skips the contiguous ids check. If None (default), the check is performed automatically.

Returns

int or None

The id of the most recent common ancestor, or None if no common ancestor exists.