alifestd_coarsen_taxa_asexual_make_agg

alifestd_coarsen_taxa_asexual_make_agg(phylogeny_df: DataFrame, default_agg: str = 'first') Dict[str, str]

Build per-column aggregation rules for asexual taxa coarsening.

Parameters

phylogeny_dfpd.DataFrame

Input phylogeny table.

default_aggstr, default “first”

Aggregation function to apply to any column not in the hard-coded overrides.

Returns

Dict[str, str]

Mapping of column name to aggregation method. Four columns are overridden as follows:

  • “destruction_time”: “last”

  • “is_root”: “first”

  • “origin_time”: “first”

Columns named

  • “ancestor_id”

  • “ancestor_list”

  • “branch_length”

  • “edge_length”

  • “id”

  • “is_leaf”

will be excluded from the result. All other (non-excluded) columns use default_agg.