haploid_highd Overview

The following lists all methods and attributes of haploid_highd, grouped according to purpose and function. Member functions are shown with the prefix haploid_highd.*. If you have initialized for example as pop=haploid_highd(L), the prefix in your program needs to be pop.*.

Note

Clicking on the name of the function will take you to a more detailed explanation listing all arguments.

Initialization, copy, and storage

haploid_highd.__init__ Construct a high-dimensional population with certain parameters.
haploid_highd.copy Copy population into new instance.
haploid_highd.dump Dump a population to binary file, for later use.
load_haploid_highd Load a population from a compressed pickle file

Attributes

haploid_highd.L Number of loci (read-only)
haploid_highd.number_of_loci Number of loci (read-only)
haploid_highd.N Population size (read-only)
haploid_highd.population_size Population size (read-only)
haploid_highd.number_of_traits Number of traits (read-only)
haploid_highd.generation Current generation (read-only)
haploid_highd.participation_ratio Participation ratio (read-only)
haploid_highd.number_of_clones Number of non-empty clones (read-only)
haploid_highd.carrying_capacity current carrying capacity of the environment
haploid_highd.circular is the genome circular?
haploid_highd.outcrossing_rate outcrossing rate (probability of sexual reproduction per generation)
haploid_highd.crossover_rate crossover rate (probability of crossover per site per generation)
haploid_highd.recombination_model Model of recombination to use
haploid_highd.mutation_rate mutation rate (per site per generation)
haploid_highd.trait_weights weight of each trait on fitness

Status

haploid_highd.status Print a status list of the population parameters

Initialize the population

haploid_highd.set_wildtype Initialize a population of wildtype individuals
haploid_highd.set_allele_frequencies Initialize the population according to the given allele frequencies in linkage equilibrium.
haploid_highd.set_genotypes Initialize population with fixed counts for specific genotypes.
haploid_highd.add_genotype Add new individuals to the population with certain genotypes

Set phenotypes and fitness function

haploid_highd.trait_weights weight of each trait on fitness
haploid_highd.set_trait_additive Set the additive part of a trait
haploid_highd.add_trait_coefficient Add a coefficient to the trait landscape.
haploid_highd.set_random_trait_epistasis Set a random epistatic term in the genotype-phenotype map.
haploid_highd.clear_trait Clear a trait landscape.
haploid_highd.clear_traits Clear all trait landscapes

The following methods are shortcuts if you have only one trait and will not work for populations with more than one trait:

haploid_highd.set_fitness_additive Shortcut for set_trait_additive when there is only one trait
haploid_highd.add_fitness_coefficient Shortcut for add_trait_coefficient when there is only one trait
haploid_highd.set_random_epistasis Shortcut for set_random_trait_epistasis when there is only one trait
haploid_highd.clear_fitness Shortcut for clear_trait when there is only one trait

Evolution

haploid_highd.evolve Evolve for some generations.
haploid_highd.bottleneck Make the population undergo a bottleneck
haploid_highd.unique_clones Recompress the clone structure
haploid_highd.flip_single_locus Take a random clone, flip the allele at the selected locus and create a new clone.
haploid_highd.calc_stat Calculate trait and fitness statistics for the population

Random Sampling

haploid_highd.random_clone Get a random clone
haploid_highd.random_clones Get random clones
haploid_highd.random_genomes Get a sample of random genomes from the population

Clone structure and genotypes

haploid_highd.get_clone_size Get the size of a clone
haploid_highd.get_clone_sizes Get the size of all clones.
haploid_highd.get_genotype
haploid_highd.get_genotypes Get all genotypes of the population.

Get allele frequencies and linkage disequilibria

haploid_highd.get_allele_frequency Get the frequency of the + allele at the selected locus
haploid_highd.get_allele_frequencies Get all allele frequencies
haploid_highd.get_pair_frequency Get the joint frequency of two + alleles
haploid_highd.get_chi Get \(\chi_i\) of an allele
haploid_highd.get_LD Get linkage disequilibrium
haploid_highd.get_chi2 Get \(\chi_{ij}\)
haploid_highd.get_moment Get moment of two alleles in the -/+ basis

Analyze fitness and trait distributions

haploid_highd.calc_stat Calculate trait and fitness statistics for the population
haploid_highd.get_trait_additive Get an array with the additive coefficients of all loci of a trait.
haploid_highd.get_trait_epistasis Get the epistatic terms of the genotype/phenotype map of the chosen trait.
haploid_highd.get_trait_statistics Get the mean and variance of a trait in the population.
haploid_highd.get_trait_covariance Get the covariance of two traits in the population.
haploid_highd.get_fitness Get the fitness of an individual
haploid_highd.get_fitnesses Get the fitness of all clones.
haploid_highd.get_fitness_statistics Get the mean and variance of the fitness in the population.
haploid_highd.get_fitness_histogram Calculate the fitness histogram of a population sample.
haploid_highd.plot_fitness_histogram Plot a distribution of fitness of a population sample.

Divergence and Diversity

haploid_highd.get_divergence_statistics Get the mean and variance of the divergence in the population.
haploid_highd.get_diversity_statistics Get the mean and variance of the diversity in the population.
haploid_highd.get_divergence_histogram Get the divergence histogram restricted to those chunks of the genome.
haploid_highd.get_diversity_histogram Get the diversity histogram restricted to those chunks of the genome.
haploid_highd.plot_divergence_histogram Plot the divergence histogram of a population sample.
haploid_highd.plot_diversity_histogram Plot the diversity histogram of a population sample.

Genealogies and Trees

haploid_highd.track_locus_genealogy Track the genealogy of some loci.
haploid_highd.genealogy Genealogy of the tracked loci.