struc_preparation2 {PROSPER} | R Documentation |
Generating data input and output structures
Description
struc_preparation
creates the data input and output structures (data.frames and table) for the simulation run, 'dfgenotype', 'xprobab' and 'mf'.
Usage
struc_preparation2(Rmx = NA, af = NA, epis = NA, dom = NA)
Arguments
Rmx |
maximum resistance value, if all gene loci under consideration are homozygous resistant. |
af |
initial frequency of resistance alleles in the population. |
epis |
epistasis value, describing the interaction between resistance alleles. |
dom |
dominance of resistance alleles. |
Details
Prior to the simulation, a data.frame is generated to save results (dfgenotype
). Additionally, a table with recombination probabilities (xprobab
) is calculated. During the simulation run, probability values are not computed again but looked up in the table. PROSPER assumes diploid plants and maximum four resistance genes. To calculate the phenotypic resistance value for each genotype sel_resist
is called. If n_loci < 0
the structure is set up for no genetics at all in the simulation.
Value
Returns a list
of two data.frame
and a table
:
mf: all possible combinations of parental genotypes (see 'dfgenotype$genotype') are saved in one column 'mf' (male, female). The column 'mf' is a character vector. Each string of the vector has twice the length of the number of resistance loci under consideration.
dfgenotype: the structure to save the results of one simulation cycle (year). After each cycle the data is reset to the new start values. The first column 'genotype' is a character vector. Each string of the vector has the length of the number of resistance loci under consideration. Each locus can have 0, 1 or 2 resistance alleles. The second column 'resist' saves resistance values that are calculated according to the equation in the section 'details'.
xprobab: the probabilities of occurrence for all possible genotypes in the offspring (F-generation) with all possible parent genotypes (P-generation). Free recombination is assumed. Column names are the combinations of parental genes, row names are genotypes of the offspring.
Warning
The run of struc_preparation
is time consuming. Duration strongly increases with the number of genes under consideration, n_loci
.
See Also
Examples
#generate the genotype and probability tables for a simulation with two resistance
#loci with one dominant and one partial dominant resistant allele, no epistasis, and a
#maximumx resistance value of 10.
ls()
struc_preparation2(Rmx=10, af=c(0.01,0.5), epis=0, dom=c(1,0.3))
ls()
rm(dfgenotype, mf, xprobab)