hstrat

Convenient library repack as a flat namespace.

Forwarded Modules

Modules defined elsewhere made available in this namespace for convenience. To view documentation for these modules, use the search bar or navigate to the source package manually.

depth_proportional_resolution_algo

Maintain constant size complexity and evenly-spaced strata.

depth_proportional_resolution_tapered_algo

Maintain constant size complexity and evenly-spaced strata.

fixed_resolution_algo

Accept linear size complexity to maintain fixed spacing between strata.

geom_seq_nth_root_algo

Maintain constant size complexity with recency-proportional strata spacing.

geom_seq_nth_root_tapered_algo

Maintain constant size complexity with recency-proportional strata spacing.

nominal_resolution_algo

Retain as few strata as possible.

perfect_resolution_algo

Retain all strata to ensure perfect resolution for MRCA estimation.

provided_stratum_ordered_stores

Built-in mutable sequence.

provided_stratum_retention_algorithms

Built-in mutable sequence.

pseudostochastic_algo

Retains strata probabilistically.

recency_proportional_resolution_algo

Provide log space complexity and recency-proportional strata spacing.

recency_proportional_resolution_curbed_algo

Eagerly utilize fixed stratum storage capacity size_curb to minimize recency-proportional MRCA uncertainty.

stochastic_algo

Retain strata probabilistically in a nondeterministic manner.

trie_postprocess

Implementation helpers.

Functions

assemblage_from_records(records[, ...])

Deserialize a population of HereditaryStratigraphicColumn`s into a `HereditaryStratigraphicAssemblage from a dict composed of builtin types.

ballpark_patristic_distance_between(first, ...)

Calculate a fast, rough estimate of the patristic distance between first and second.

ballpark_rank_of_mrca_between(first, second)

Calculate a fast, rough estimate of the rank of the MRCA beteen first and second.

ballpark_ranks_since_mrca_with(focal, other)

Calculate a fast, rough estimate of generations elapsed since MRCA with other.

build_distance_matrix_biopython(population, ...)

Compute all-pairs patristic distance among a population of extant hereditary stratigraphic columns as a BioPython DistanceMatrix.

build_distance_matrix_numpy(population, ...)

Compute all-pairs patristic distance among a population of extant hereditary stratigraphic columns.

build_tree(population, version_pin[, ...])

Estimate the phylogenetic history among hereditary stratigraphic columns.

build_tree_nj(population, estimator, prior)

Estimate the phylogenetic history among hereditary stratigraphic columns by using the "unweighted pair group method with neighbor joinint distance-based reconstruction method.

build_tree_trie(population[, taxon_labels, ...])

Estimate the phylogenetic history among hereditary stratigraphic columns by building a trie (a.k.a.

build_tree_trie_ensemble(population, ...[, ...])

Estimate the phylogenetic history among hereditary stratigraphic columns by building a trie (a.k.a.

build_tree_upgma(population, estimator, prior)

Estimate the phylogenetic history among hereditary stratigraphic columns by using the "unweighted pair group method with unweighted means" (UPGMA) distance-based reconstruction method.

calc_definitive_max_rank_of_first_retained_disparity_between(...)

Determine hard, exclusive upper bound on MRCA generation.

calc_definitive_max_rank_of_last_retained_commonality_between(...)

Determine latest possible generation of MRCA.

calc_definitive_min_ranks_since_first_retained_disparity_with(...)

Determine a hard, exclusive lower bound on generations since MRCA.

calc_definitive_min_ranks_since_last_retained_commonality_with(...)

Determine hard, inclusive lower bound on generations since MRCA.

calc_min_implausible_spurious_consecutive_differentia_collisions_between(...)

Determine amount of evidence required to indicate shared ancestry.

calc_patristic_distance_bounds_between(...)

What is the total phylogenetic distance along the branch path connecting first and second?

calc_probability_differentia_collision_between(...)

How likely are differentia collisions?

calc_rank_of_earliest_detectable_mrca_among(...)

After what generation is common ancstry robustly detectable?

calc_rank_of_earliest_detectable_mrca_between(...)

After what generation is common ancstry robustly detectable?

calc_rank_of_first_retained_disparity_between(...)

Determine upper bound on MRCA generation at given confidence.

calc_rank_of_last_retained_commonality_between(...)

Determine lower bound on generation of MRCA at confidence level.

calc_rank_of_mrca_bounds_among(population, prior)

Within what generation range did MRCA fall?

calc_rank_of_mrca_bounds_between(first, ...)

Within what generation range did MRCA fall?

calc_rank_of_mrca_bounds_provided_confidence_level(...)

Calculate provided confidence for a MRCA generation estimate.

calc_rank_of_mrca_uncertainty_among(...[, ...])

How wide is the estimate window for generation of MRCA?

calc_rank_of_mrca_uncertainty_between(first, ...)

How wide is the estimate window for generation of MRCA?

calc_ranks_since_earliest_detectable_mrca_with(...)

How many generations have elapsed since the first where common ancestry with other could be detected?

calc_ranks_since_first_retained_disparity_with(...)

Determine generations since divergence with particular confidence.

calc_ranks_since_last_retained_commonality_with(...)

Determine generations since MRCA with particular confidence.

calc_ranks_since_mrca_bounds_provided_confidence_level(...)

Calculate provided confidence for a MRCA generation estimate.

calc_ranks_since_mrca_bounds_with(focal, ...)

How many generations have elapsed since MRCA?

calc_ranks_since_mrca_uncertainty_with(...)

How wide is the estimation window for generations elapsed since MRCA?

col_from_int(value, differentia_bit_width, ...)

Deserialize a HereditaryStratigraphicColumn from an integer representation.

col_from_packet(packet, ...[, ...])

Deserialize a HereditaryStratigraphicColumn from a differentia packet and column configuration specification information.

col_from_packet_buffer(packet_buffer, ...[, ...])

Deserialize a HereditaryStratigraphicColumn from a buffer containing the differentia packet at the front, then stored differentia values.

col_from_records(records[, ...])

Deserialize a HereditaryStratigraphicColumn from a dict composed of builtin data types.

col_to_ascii(column[, discarded_strata, ...])

Create an ASCII table representation of HereditaryStratigraphicColumn state.

col_to_dataframe(column)

Create a pandas DataFrame with retained strata as rows.

col_to_int(column[, ...])

Serialize a HereditaryStratigraphicColumn to a binary representation as a Python int.

col_to_packet(column[, ...])

Serialize a HereditaryStratigraphicColumn to a binary buffer.

col_to_records(column)

Serialize a HereditaryStratigraphicColumn to a dict composed of builtin types.

col_to_specimen(column)

Create a postprocessing representation of the differentia retained by an extant HereditaryStratigraphicColumn, indexed by deposition rank.

compile_perfect_backtrack_phylogeny(population)

Compile phylogenetic history tracked using PerfectBacktrackHandle breadcrumbs.

compile_phylogeny_from_lineage_iters(population)

Compile phylogenetic history tracked using generic backtracking breadcrumbs.

descend_template_phylogeny(...[, demark, ...])

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_alifestd(...[, ...])

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_biopython(tree, ...)

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_dendropy(tree, ...)

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_naive(...[, ...])

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_networkx(tree, ...)

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

descend_template_phylogeny_posthoc(...[, ...])

Generate a population of hereditary stratigraphic columns that could have resulted from the template phylogeny.

diff_retained_ranks(first, second)

Return ranks retained by first but not second, and vice versa.

does_definitively_have_no_common_ancestor(...)

Does the hereditary stratigraphic record definitively prove that first and second could not possibly share a common ancestor?

does_definitively_share_no_common_ancestor(...)

Could the population possibly share a common ancestor?

does_have_any_common_ancestor(first, second)

Determine if common ancestry is evidenced with second.

does_share_any_common_ancestor(population[, ...])

Determine if common ancestry is evidenced within the population.

estimate_patristic_distance_between(first, ...)

Estimate the total phylogenetic distance along the branch path connecting the columns.

estimate_rank_of_mrca_between(first, second, ...)

At what generation did the most recent common ancestor of first and second occur?

estimate_rank_of_mrca_maximum_likelihood(...)

Estimate the most recent common ancestor (MRCA) at the rank with the highest posterior probability.

estimate_rank_of_mrca_naive(...)

Compute a simple, fast estimate the rank of the most recent common ancestor (MRCA).

estimate_rank_of_mrca_unbiased(...)

Compute an estimate for the rank of the most recent common ancestor (MRCA) that, on average, avoids systematic over- or under-estimation.

estimate_ranks_since_mrca_with(focal, other, ...)

How many generations have elapsed since focal's most recent common ancestor with other?

evolve_fitness_trait_population([...])

Run simple evolutionary simulation to generate sample phylogeny.

get_hstrat_version()

get_last_common_stratum_between(first, second)

Get the most recent stratum in common between first and second, if any.

get_nth_common_rank_between(first, second, n)

Return the nth rank retained by both columns.

iter_perfect_backtrack_lineage(handle)

Iterate up PerfectBacktrackHandle breadcrumbs for line of descent ending in handle, including handle.

mrca_uncertainty_absolute_barplot(...[, ...])

Profile distribution of retained rank spacing under a retention policy.

mrca_uncertainty_relative_barplot(...[, ...])

Profile distribution of retained rank spacing under a retention policy.

pack_differentiae(strata, differentia_bit_width)

Pack a sequence of differentiae together into a compact representation.

pack_differentiae_bytes(strata, ...[, ...])

Pack a sequence of differentiae together into a compact representation.

pack_differentiae_str(strata, ...)

Pack a sequence of differentiae together into a compact string representation.

policy_from_records(records)

Deserialize a stratum retention policy from a dict composed of builtin data types.

policy_panel_animate(...[, do_show, save_as])

Animate evolution of column and its properties under a retention policy.

policy_panel_plot(stratum_retention_policy, ...)

Holistically sketch stratum retention policy at a particular generation.

policy_to_records(policy)

Serialize a stratum retention policy to a dict composed of builtin types.

pop_from_records(records[, progress_wrap, ...])

Deserialize a sequence of `HereditaryStratigraphicColumn`s from a dict composed of builtin types.

pop_to_assemblage(columns[, progress_wrap])

Create a postprocessing representation of the differentia retained by a collection of HereditaryStratigraphicColumns.

pop_to_dataframe(columns[, progress_wrap])

Create a pandas DataFrame summarizing several columns, with retained strata as rows.

pop_to_records(columns[, progress_wrap])

Serialize a sequence of `HereditaryStratigraphicColumn`s to a dict composed of builtin types.

specimen_from_records(records)

Deserialize a HereditaryStratigraphicSpecimen from a dict composed of builtin data types.

strata_retained_frac_lineplot(...[, do_show, ax])

Plot fraction deposited strata that are retained at each generation.

strata_retained_num_lineplot(...[, do_show, ax])

Plot number deposited strata that are retained at each generation.

stratum_retention_animate(...[, do_show, ...])

Animate evolution of strata histories under a stratum retention policy.

stratum_retention_dripplot(...[, do_show, ...])

Show history of retained and purged strata at a particular generation.

unassemblage_from_records(records[, ...])

Deserialize a population of HereditaryStratigraphicColumn`s into a list of `HereditaryStratigraphiSpecimen from a dict composed of builtin types.

unpack_differentiae(packed_differentiae, ...)

Unpack a compact, concatenated base 64 representation into a sequence with each element represented as a distinct integer.

unpack_differentiae_bytes(...[, ...])

Unpack a compact, concatenated byte buffer representation into a sequence with each element represented as a distinct integer.

unpack_differentiae_str(packed_differentiae, ...)

Unpack a compact, concatenated base 64 representation into a sequence with each element represented as a distinct integer.

Classes

ArbitraryPrior

Enacts a prior probability density distribution on the generation of the most recent common ancestor (MRCA) between extant hereditary stratigraphic columns that is arbitrary, but computationally efficient.

AssignDestructionTimeYoungestPlusOneTriePostprocessor

Functor to assign a destruction time property to trie nodes.

AssignOriginTimeExpectedValueTriePostprocessor

Functor to assign origin time property to trie nodes using expected values over the distribution of possible differentia collisions.

AssignOriginTimeNaiveTriePostprocessor

Functor to assign origin time property to trie nodes calculated as the average of the node's rank and the minimum rank among its children.

AssignOriginTimeNodeRankTriePostprocessor

Functor to assign trie nodes' rank as their the origin time.

AssignOriginTimeSampleNaiveTriePostprocessor

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

CompoundTriePostprocessor

Functor to sequentially apply multiple trie postprocessors.

DecantingPhyloTracker

Data structure to enable perfect tracking over a fixed-size population with synchronous generations.

ExponentialPrior

Enacts a prior expectation that the generation of the most recent common ancestor (MRCA) between extant hereditary stratigraphic columns becomes exponentialy less likely with increasing antiquity.

GarbageCollectingPhyloTracker

Data structure to enable perfect tracking over a fixed-size population with synchronous generations.

GeometricPrior

Enacts a prior expectation that the generation of the most recent common ancestor (MRCA) between extant hereditary stratigraphic columns becomes exponentialy less likely with increasing antiquity.

HereditaryStratigraphicAssemblage

A collection of HereditaryStratigraphicSpecimens, padded to include entries for all ranks retained by any specimen within the assemblage.

HereditaryStratigraphicAssemblageSpecimen

Postprocessing representation of the differentia retained by an extant HereditaryStratigraphicColumn, indexed by deposition rank.

HereditaryStratigraphicColumn

Genetic annotation to enable phylogenetic inference.

HereditaryStratigraphicColumnBundle

Packages multiple HereditaryStratigraphicColumn instances together.

HereditaryStratigraphicSpecimen

Postprocessing representation of the differentia retained by an extant HereditaryStratigraphicColumn, indexed by deposition rank.

HereditaryStratum

Packages stratigraph data associated with a particular generation.

HereditaryStratumOrderedStoreDict

Interchangeable backing container for HereditaryStratigraphicColumn.

HereditaryStratumOrderedStoreList

Interchangeable backing container for HereditaryStratigraphicColumn.

HereditaryStratumOrderedStoreTree

Interchangeable backing container for HereditaryStratigraphicColumn.

MrcaUncertaintyAbsExactEvaluator

Enacts exact absolute MRCA uncertainty parameterization requirement.

MrcaUncertaintyAbsUpperBoundEvaluator

Enacts absolute MRCA uncertainty bound parameterization requirement.

MrcaUncertaintyRelExactEvaluator

Enacts exact relative MRCA uncertainty parameterization requirement.

MrcaUncertaintyRelUpperBoundEvaluator

Enacts relative MRCA uncertainty bound parameterization requirement.

NumStrataRetainedExactEvaluator

Enacts exact space complexity parameterization requirement.

NumStrataRetainedUpperBoundEvaluator

Enacts space complexity bound parameterization requirement.

PeelBackConjoinedLeavesTriePostprocessor

Functor to separate any TrieLeafNode instances that are direct siblings.

PerfectBacktrackHandle

Breadcrumb for perfectly backtracking a phylogenetic chain of descent.

PropertyAtLeastParameterizer

Parameterizes so evaluated property meets or exceeds a target value.

PropertyAtMostParameterizer

Parameterizes so evaluated property falls at or below a target value.

PropertyExactlyParameterizer

Parameterizes so evaluated property exactly equals a target value.

SampleAncestralRollbacksTriePostprocessor

Functor to correct for systematic overestimation of relatedness by sampling a compensatory adjustment to trie topology.

UniformPrior

Enacts a prior expectation that the generation of the most recent common ancestor (MRCA) is equally likely to occur at any generation since genesis.

Exceptions

UnsatisfiableParameterizationRequestError

Raised when parameter with required properties cannot be found.