AssignOriginTimeSampleNaiveTriePostprocessor

class AssignOriginTimeSampleNaiveTriePostprocessor[source]

Functor to assign origin time property to trie nodes sampled between the node’s rank and the minimum rank among its children.

A prior may be provided to customize sampling distribution used.

__init__(prior: ~hstrat.phylogenetic_inference.priors._detail._PriorBase.PriorBase = <hstrat.phylogenetic_inference.priors.ArbitraryPrior object>, assigned_property: str = 'origin_time') None[source]

Initialize functor instance.

Parameters

priorPriorBase, default ArbitraryPrior()

Prior distribution of ancestor origin times.

Used to calculate interval samples.

assigned_propertystr, default “origin_time”

The property name for the assigned origin time.

Methods

__init__(prior: ~hstrat.phylogenetic_inference.priors._detail._PriorBase.PriorBase = <hstrat.phylogenetic_inference.priors.ArbitraryPrior object>, assigned_property: str = 'origin_time') None[source]

Initialize functor instance.

Parameters

priorPriorBase, default ArbitraryPrior()

Prior distribution of ancestor origin times.

Used to calculate interval samples.

assigned_propertystr, default “origin_time”

The property name for the assigned origin time.

__call__(trie: ~hstrat.phylogenetic_inference.tree._impl._TrieInnerNode.TrieInnerNode, p_differentia_collision: float, mutate: bool = False, progress_wrap: ~typing.Callable = <function AssignOriginTimeSampleNaiveTriePostprocessor.<lambda>>) TrieInnerNode[source]

Assign origin times to trie nodes.

Parameters

trieTrieInnerNode

The input trie to be postprocessed.

p_differentia_collisionfloat

Probability of a randomly-generated differentia matching an existing differentia.

Not used in the current implementation.

mutatebool, default False

Are side effects on the input argument trie allowed?

progress_wraptyping.Callable, optional

Pass tqdm or equivalent to report progress.

Returns

TrieInnerNode

The postprocessed trie with assigned origin times.