genomicSimulationC 0.2.6
Functions

For simulation of meiosis. More...

+ Collaboration diagram for Meiosis Simulation Functions:

Functions

void gsc_generate_gamete (gsc_SimData *d, const char *parent_genome, char *output, const unsigned int mapindex)
 Fills a char* with the simulated result of meiosis (reduction and recombination) from the marker alleles of a given parent. More...
 
void gsc_generate_doubled_haploid (gsc_SimData *d, const char *parent_genome, char *output, const unsigned int mapindex)
 Get the alleles of the outcome of producing a doubled haploid from a gamete from a given parent. More...
 
void gsc_generate_clone (gsc_SimData *d, const char *parent_genome, char *output)
 Get an identical copy of a given genotype. More...
 

Detailed Description

For simulation of meiosis.

Function Documentation

◆ gsc_generate_clone()

void gsc_generate_clone ( gsc_SimData d,
const char *  parent_genome,
char *  output 
)

Get an identical copy of a given genotype.

Has short name: generate_clone

Parameters
dpointer to the gsc_SimData object that includes genetic map data needed to simulate meiosis and the value of n_markers
parent_genomea 2x(n_markers) array of characters containing the alleles of the first parent
outputa 2x(n_marker) array of chars which will be overwritten with the offspring genome.

Definition at line 7661 of file sim-operations.c.

+ Here is the caller graph for this function:

◆ gsc_generate_doubled_haploid()

void gsc_generate_doubled_haploid ( gsc_SimData d,
const char *  parent_genome,
char *  output,
const unsigned int  map_index 
)

Get the alleles of the outcome of producing a doubled haploid from a gamete from a given parent.

One gamete is generated, then doubled. The output will be perfectly homozygous.

See also
gsc_generate_gamete(), on which this is based.

Has short name: generate_doubled_haploid

Parameters
dpointer to the gsc_SimData object that includes genetic map data needed to simulate meiosis and the value of n_markers
parent_genomea 2x(n_markers) array of characters containing the alleles of the first parent
outputa 2x(n_marker) array of chars which will be overwritten with the offspring genome.
map_indexindex of the recombination map in d that should be used to choose positions and probabilities of recombination.
See also
gsc_get_index_of_map

Definition at line 7563 of file sim-operations.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gsc_generate_gamete()

void gsc_generate_gamete ( gsc_SimData d,
const char *  parent_genome,
char *  output,
const unsigned int  map_index 
)

Fills a char* with the simulated result of meiosis (reduction and recombination) from the marker alleles of a given parent.

It generates the number of crossover events in each chromosome by drawing from a Poisson distribution with a certain expected number of crossovers, where the expected number of crossovers is saved in the chosen recombination map.

It generates the positions of those crossover events from a uniform distribution.

It picks a random one of the gametes generated by picking randomly which column of the parent's alleles to start with. When crossover events occur it starts reading the other column.

Has short name: generate_gamete

Parameters
dpointer to the gsc_SimData object containing map positions for the markers that make up the rows of parent_table. sort_markers() and locate_chromosomes() should have been called previously.
parent_genomethe char* containing the parent's genome as a character string made up of sequential pairs of alleles for each marker in d->markers.
outputthe char* to which to save the gamete. It saves the alleles every second character, starting at 0, so that calling gsc_generate_gamete(..., offspring_genome) & gsc_generate_gamete(..., offspring_genome + 1) can be used to generate both halves of its genome.
map_indexindex of the recombination map in d that should be used to choose positions and probabilities of recombination.
See also
gsc_get_index_of_map

Definition at line 7464 of file sim-operations.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: