build_tree_trie_ensemble

build_tree_trie_ensemble(population: ~typing.Sequence[~typing.Union[HereditaryStratigraphicColumn, HereditaryStratigraphicSpecimen]], trie_postprocessors: ~typing.Sequence[~typing.Callable], taxon_labels: ~typing.Iterable | None = None, force_common_ancestry: bool = False, progress_wrap: ~typing.Callable = <function <lambda>>, seed: int | None = 1) List[DataFrame]

Estimate the phylogenetic history among hereditary stratigraphic columns by building a trie (a.k.a. prefix tree) of the differentia sequences of hereditary stratigraphic artifacts within a population.

Returns phylogeny reconstruction outcomes from alternate postprocessing schemes applied between trie contruction and conversion to an alife standard data frame, including ancestor taxon origin time estimation. Because the underlying pre-postprocess trie is only constructed once, this method allows for efficient comparison of potprocessing schemes.

Unless comparing alternate postprocessing schemes or applying a custom postprocessing option, end users should likely prefer build_tree_trie. This interface applies a single postprocess, set to a generally-appropriate default with a few other curated postprocesses specifiable by optional argument.

Parameters

population: Sequence[HereditaryStratigraphicArtifact]

Hereditary stratigraphic columns corresponding to extant population members.

Each member of population will correspond to a unique leaf node in the reconstructed tree.

trie_postprocessors: Iterable[Callable]

Tree postprocess functors.

Must take trie of type TrieInnerNode, p_differentia_collision of type float, mutate of type bool, and progress_wrap of type Callable params. Must returned postprocessed trie (type TrieInnerNode). Several

Each postprocess will be called indpendently to produce a returned postprocessed variant. Use CompoundTriePostprocessor to chain postprocess functors that should be applied in succession.

taxon_labels: Optional[Iterable], optional

How should leaf nodes representing extant hereditary stratigraphic columns be named?

Label order should correspond to the order of corresponding hereditary stratigraphic columns within population. If None, taxons will be named according to their numerical index.

force_common_ancestry: bool, default False

How should columns that definitively share no common ancestry be handled?

If set to True, treat columns with no common ancestry as if they shared a common ancestor immediately before the genesis of the lineages. If set to False, columns within population that definitively do not share common ancestry will raise a ValueError.

progress_wrapCallable, default identity function

Wrapper applied around generation iterator and row generator for final phylogeny compilation process.

Pass tqdm or equivalent to display progress bars.

seed: int, default 1

Controls tiebreaking decisions in the algorithm.

Pass an int for reproducible output across multiple function calls. The default value, 1, ensures reproducible output. Pass None to use existing RNG context directly.

Returns

typing.List[pd.DataFrame]

Reconstructed phylogenetic trees with each postprocessor applied, in alife standard format.