17 #ifndef GO_FISH_DATA_H_ 18 #define GO_FISH_DATA_H_ 28 namespace Spectrum_details{
class transfer_allele_trajectories; }
45 inline mutID(
int origin_generation,
int origin_population,
int origin_threadID,
int reserved);
48 inline std::string toString();
50 inline std::string toString()
const;
88 inline int num_sites();
91 inline int num_populations();
94 inline int num_time_samples();
97 inline int maximal_num_mutations();
100 inline int num_mutations_time_sample(
int sample_index);
103 inline int final_generation();
106 inline int sampled_generation(
int sample_index);
109 inline bool extinct(
int sample_index,
int population_index);
112 inline int effective_number_of_chromosomes(
int sample_index,
int population_index);
115 inline float frequency(
int sample_index,
int population_index,
int mutation_index);
118 inline mutID mutation_ID(
int mutation_index);
121 inline void delete_time_sample(
int sample_index);
134 template <
typename Functor_mutation,
typename Functor_demography,
typename Functor_migration,
typename Functor_selection,
typename Functor_inbreeding,
typename Functor_dominance,
typename Functor_preserve,
typename Functor_timesample>
135 friend void run_sim(
allele_trajectories & all_results,
const Functor_mutation mu_rate,
const Functor_demography demography,
const Functor_migration mig_prop,
const Functor_selection sel_coeff,
const Functor_inbreeding FI,
const Functor_dominance dominance,
const Functor_preserve preserve_mutations,
const Functor_timesample take_sample,
const allele_trajectories & prev_sim);
137 friend class Spectrum_details::transfer_allele_trajectories;
142 float * mutations_freq;
146 int sampled_generation;
152 inline void initialize_run_constants();
154 inline void initialize_sim_result_vector(
int new_length);
157 time_sample ** time_samples;
159 mutID * mutations_ID;
164 inline std::ostream &
operator<<(std::ostream & stream,
const mutID &
id);
177 #include "../3P/_internal/inline_go_fish_data_struct.hpp" int prev_sim_sample
time sample of previous simulation to use for initializing current simulation
int origin_generation
generation in which mutation appeared in simulation
int seed2
random number seed 2 of 2
control and output data structure for GO_Fish simulation
int compact_interval
how often to compact the simulation and remove fixed or lost mutations
specification of simulation constants
int num_populations
number of populations in simulation
std::ostream & operator<<(std::ostream &stream, allele_trajectories &A)
insertion operator: sends allele_trajectories A into the ostream stream
int origin_threadID
threadID that generated mutation
int seed1
random number seed 1 of 2
structure specifying the ID for a mutation in a GO_Fish simulation
void swap(allele_trajectories &a, allele_trajectories &b)
swaps data held by allele_trajectories a and b
int origin_population
population in which mutation first arose
__host__ void run_sim(allele_trajectories &all_results, const Functor_mutation mu_rate, const Functor_demography demography, const Functor_migration mig_prop, const Functor_selection sel_coeff, const Functor_inbreeding FI, const Functor_dominance dominance, const Functor_preserve preserve_mutations, const Functor_timesample take_sample)
runs a single-locus Wright-Fisher simulation specified by the given simulation functions and sim_cons...
float num_sites
number of sites in simulation
bool init_mse
true: initialize simulation in mutation_selection_equilibrium; false: initialize blank simulation or ...
int device
GPU identity to run simulation on, if -1 next available GPU will be assigned.
Namespace for single-locus, forward, Monte-Carlo Wright-Fisher simulation and output data structures...
sim_constants sim_input_constants
constants for initializing the next simulation
int reserved
reserved for later use, currently 0
int num_generations
number of generations in simulation