alifestd_find_pair_mrca_id_polars

alifestd_find_pair_mrca_id_polars(phylogeny_df: DataFrame, first: int, second: int, *, 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_dfpolars.DataFrame or polars.LazyFrame

The phylogeny as a dataframe in alife standard format.

Must represent an asexual phylogeny with contiguous ids and topologically sorted rows.

firstint

First taxon id.

secondint

Second taxon id.

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.

See Also

alifestd_find_pair_mrca_id_asexual :

Pandas-based implementation.