alifestd_mark_clade_duration_asexual

alifestd_mark_clade_duration_asexual(phylogeny_df: DataFrame, mutate: bool = False, *, mark_as: str = 'clade_duration') DataFrame

Add column clade_duration, containing the difference between each the origin_time of each node and the maximum origin_time of its descendants.

The output column name can be changed via the mark_as parameter.

Leaf nodes will have duration 0.

Dataframe reindexing (e.g., df.index) may be applied.

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.