Parallel PopGen Package
GO_Fish::allele_trajectories Struct Reference

control and output data structure for GO_Fish simulation More...

#include <go_fish_data_struct.h>

Classes

struct  sim_constants
 specification of simulation constants More...
 

Public Member Functions

 allele_trajectories ()
 default constructor More...
 
 allele_trajectories (const allele_trajectories &in)
 copy constructor More...
 
allele_trajectoriesoperator= (allele_trajectories in)
 copy assignment More...
 
sim_constants last_run_constants ()
 returns sim_constants of the simulation currently held by allele_trajectories More...
 
int num_sites ()
 returns the number of sites in the simulation More...
 
int num_populations ()
 returns the number of populations in the simulation More...
 
int num_time_samples ()
 returns number of time samples taken during simulation run More...
 
int maximal_num_mutations ()
 returns number of reported mutations in the final time sample (maximal number of stored mutations in the allele_trajectories) More...
 
int num_mutations_time_sample (int sample_index)
 number of reported mutations in the time sample sample_index More...
 
int final_generation ()
 returns final generation of simulation More...
 
int sampled_generation (int sample_index)
 return generation of simulation in the time sample sample_index More...
 
bool extinct (int sample_index, int population_index)
 returns whether or not population population_index is extinct in time sample sample_index More...
 
int effective_number_of_chromosomes (int sample_index, int population_index)
 returns the effective number of chromosomes of population population_index in time sample sample_index More...
 
float frequency (int sample_index, int population_index, int mutation_index)
 returns the frequency of the mutation at time sample sample_index, population population_index, mutation mutation_index More...
 
mutID mutation_ID (int mutation_index)
 returns the mutation ID at mutation_index More...
 
void delete_time_sample (int sample_index)
 deletes a single time sample, sample_index More...
 
void reset ()
 deletes all memory held by allele_trajectories, resets constants to default More...
 
 ~allele_trajectories ()
 destructor More...
 

Public Attributes

sim_constants sim_input_constants
 constants for initializing the next simulation More...
 

Detailed Description

control and output data structure for GO_Fish simulation

Stores the constants, mutation IDs (mutID), and time samples of a simulation run. Each time sample holds the frequencies of each mutation at the time the sample was taken, the size of each population in chromosomes and which population were extinct for a time sample, the number of mutations in the sample, and of which simulation generation is the sample. Data is accessed through the member functions.

Examples:
Example1-Speed, Example2-DaDi, and Example3-Compilation.

Definition at line 54 of file go_fish_data_struct.h.

Constructor & Destructor Documentation

§ allele_trajectories() [1/2]

GO_Fish::allele_trajectories::allele_trajectories ( )
inline

default constructor

Definition at line 42 of file inline_go_fish_data_struct.hpp.

§ allele_trajectories() [2/2]

GO_Fish::allele_trajectories::allele_trajectories ( const allele_trajectories in)
inline

copy constructor

Definition at line 44 of file inline_go_fish_data_struct.hpp.

§ ~allele_trajectories()

GO_Fish::allele_trajectories::~allele_trajectories ( )
inline

destructor

calls reset()

Definition at line 185 of file inline_go_fish_data_struct.hpp.

Member Function Documentation

§ operator=()

allele_trajectories & GO_Fish::allele_trajectories::operator= ( allele_trajectories  in)
inline

copy assignment

Definition at line 78 of file inline_go_fish_data_struct.hpp.

§ last_run_constants()

allele_trajectories::sim_constants GO_Fish::allele_trajectories::last_run_constants ( )
inline

returns sim_constants of the simulation currently held by allele_trajectories

Examples:
Example2-DaDi.

Definition at line 83 of file inline_go_fish_data_struct.hpp.

§ num_sites()

int GO_Fish::allele_trajectories::num_sites ( )
inline

returns the number of sites in the simulation

Examples:
Example2-DaDi.

Definition at line 85 of file inline_go_fish_data_struct.hpp.

§ num_populations()

int GO_Fish::allele_trajectories::num_populations ( )
inline

returns the number of populations in the simulation

maximum population_index

Definition at line 87 of file inline_go_fish_data_struct.hpp.

§ num_time_samples()

int GO_Fish::allele_trajectories::num_time_samples ( )
inline

returns number of time samples taken during simulation run

maximum sample_index

Examples:
Example3-Compilation.

Definition at line 89 of file inline_go_fish_data_struct.hpp.

§ maximal_num_mutations()

int GO_Fish::allele_trajectories::maximal_num_mutations ( )
inline

returns number of reported mutations in the final time sample (maximal number of stored mutations in the allele_trajectories)

maximum mutation_index

Examples:
Example1-Speed, and Example2-DaDi.

Definition at line 91 of file inline_go_fish_data_struct.hpp.

§ num_mutations_time_sample()

int GO_Fish::allele_trajectories::num_mutations_time_sample ( int  sample_index)
inline

number of reported mutations in the time sample sample_index

Definition at line 93 of file inline_go_fish_data_struct.hpp.

§ final_generation()

int GO_Fish::allele_trajectories::final_generation ( )
inline

returns final generation of simulation

Definition at line 99 of file inline_go_fish_data_struct.hpp.

§ sampled_generation()

int GO_Fish::allele_trajectories::sampled_generation ( int  sample_index)
inline

return generation of simulation in the time sample sample_index

Definition at line 101 of file inline_go_fish_data_struct.hpp.

§ extinct()

bool GO_Fish::allele_trajectories::extinct ( int  sample_index,
int  population_index 
)
inline

returns whether or not population population_index is extinct in time sample sample_index

Definition at line 107 of file inline_go_fish_data_struct.hpp.

§ effective_number_of_chromosomes()

int GO_Fish::allele_trajectories::effective_number_of_chromosomes ( int  sample_index,
int  population_index 
)
inline

returns the effective number of chromosomes of population population_index in time sample sample_index

Definition at line 114 of file inline_go_fish_data_struct.hpp.

§ frequency()

float GO_Fish::allele_trajectories::frequency ( int  sample_index,
int  population_index,
int  mutation_index 
)
inline

returns the frequency of the mutation at time sample sample_index, population population_index, mutation mutation_index

if the mutation_index is of a mutation that is in the simulation, but which had not arisen as of /p sample_index, the reported frequency will be 0

Definition at line 122 of file inline_go_fish_data_struct.hpp.

§ mutation_ID()

mutID GO_Fish::allele_trajectories::mutation_ID ( int  mutation_index)
inline

returns the mutation ID at mutation_index

Definition at line 138 of file inline_go_fish_data_struct.hpp.

§ delete_time_sample()

void GO_Fish::allele_trajectories::delete_time_sample ( int  sample_index)
inline

deletes a single time sample, sample_index

Useful for when the allele_trajectories object is still in scope, but memory needs to be free and the data held in a particular time sample of the object is no longer needed. If the final time sample is deleted, but there are still previous time samples remaining, then function does not delete any of the memory held by mutations_ID, but does move the apparent length of the array, maximal_num_mutations(), to the number of mutations in the next last time sample. If deleting the last time sample left in allele trajectories, will call reset().

Definition at line 152 of file inline_go_fish_data_struct.hpp.

§ reset()

void GO_Fish::allele_trajectories::reset ( )
inline

deletes all memory held by allele_trajectories, resets constants to default

Useful for when the allele_trajectories object is still in scope, but memory needs to be free and the data held by the object is no longer needed.

Examples:
Example3-Compilation.

Definition at line 174 of file inline_go_fish_data_struct.hpp.

Member Data Documentation

§ sim_input_constants

sim_constants GO_Fish::allele_trajectories::sim_input_constants

constants for initializing the next simulation

Examples:
Example1-Speed, Example2-DaDi, and Example3-Compilation.

Definition at line 72 of file go_fish_data_struct.h.


The documentation for this struct was generated from the following files: