tracts.phase_type.hybrid_pedigree#

Functions

HP_loglik(mig_matrix_f, mig_matrix_m, rho_f, ...)

Calculates the maximum-likelihood in a Poisson Random Field, when admixture is modelled using the hybrid-pedigree refinement of the DC or DF models.

HP_tract_length_histogram_multi_windowed(...)

Calculates the tract length histogram for the hybrid-pedigree refinement of the DC or DF model for multiple chromosome lengths.

all_possible_trees_as_arrays(T, N[, mig_at_last])

Generates all possible trees representing the migration settings in a pedigree of T generations with N ancestral populations.

density_hybrid_pedigree(which_migration, ...)

Computes the tract length density or histogram for a given pedigree configuration, as specified by the which_migration-th element of migration_list, using the Hybrid-Pedigree refinement of the DC or DF model.

generate_trees(current_gen, max_gen, N[, ...])

Recursively generates all possible binary trees representing the migration settings in a pedigree of max_gen generations.

get_pedigree(T)

Generates a matrix representing a pedigree structure of a given number of generation.

hybrid_pedigree_distribution(mig_matrix_f, ...)

This function computes the tract length distribution as a Phase-type mixture on a finite chromosome of length L, using the Hybrid-Pedigree refinement of the DC or DF model.

prob_of_pop_setting(ms, ...)

Computes the probabily of a given configuration of migrant ancestors in the pedigree, as specified by the ms-th element of all_possible_migrations_list.

tree_to_array(tree, max_nodes)

Convert a tree to its array representation.