alifestd_screen_trait_defined_clades_fitch_asexual

alifestd_screen_trait_defined_clades_fitch_asexual(phylogeny_df: ~pandas.core.frame.DataFrame, mutate: bool = False, *, mask_trait_absent: ~numpy.ndarray, mask_trait_present: ~numpy.ndarray, progress_wrap: ~typing.Callable = <function <lambda>>) ndarray

Perform a maximum parsimony screen for trait-defined clades using Fitch’s algorithm.

The mask_trait_absent parameter can be used to exclude nodes from consideration, for instance &’ing with alifestd_mark_leaves can be used to only consider traits on leaves.

Pass tqdm or equivalent as progress_wrap to display a progress bar.

Default root state is assumed to be False.

Returns a numpy array of bool with the same length as the input DataFrame, with array elements as the number of nodes in the clade that have the trait. Returned array matches row order of the input DataFrame.