Template Function fwdpp::ts::remove_fixations_from_haploid_genomes¶
Defined in File remove_fixations_from_gametes.hpp
Function Documentation¶
-
template<typename
GenomeContainerType, typenameMutationContainerType, typenamemutation_count_container>
voidfwdpp::ts::remove_fixations_from_haploid_genomes(GenomeContainerType &haploid_genomes, const MutationContainerType &mutations, const mutation_count_container &mcounts, const mutation_count_container &mcounts_from_preserved_nodes, const fwdpp::uint_t twoN, const bool preserve_selected_fixations)¶ Removed fixed variants from haploid_genomes.
This function should be called immediately after simplification and mutation counting.
A mutation is removed from a haploid_genome if one of the following conditions holds:
The sum of mcounts and mcounts_from_preserved_nodes is zero.
mcounts == twoN, mcounts_from_preserved_nodes is zero, and preserve_selected_fixations is false or the mutation is neutral.
- Parameters
haploid_genomes: A haploid_genome containermutations: A mutation containermcounts: A container stating how many times each element in mutations is present in the currently-alive populationmcounts_from_preserved_nodes: A container recording the counts of each mutation in ancient samplestwoN: Twice the current population sizepreserve_selected_fixations: If true, do not mark selected fixations for recycling.
When preserve_selected_fixations is true, selected fixations are retained in the population. We do this because simulations of phenotypes (as opposed to relative fitness) require tracking the contribution of fixation to trait values.
- Todo:
Improve treatment of fixations by allowing for variants fixed in alive AND ancient samples to be detected.
- Note
When simulating a trait and never simulating neutral mutations, the most efficient thing is to skip calling this function entirely.
- Warning
The value passed to preserve_selected_fixations needs to be coordinated with the preserve argument of flag_mutations_for_recycling.