Description Usage Arguments Details Value Warning See Also Examples
View source: R/struc_preparation2.R
struc_preparation
creates the data input and output structures (data.frames and table) for the simulation run, 'dfgenotype', 'xprobab' and 'mf'.
1 | struc_preparation2(Rmx = NA, af = NA, epis = NA, dom = NA)
|
Rmx |
maximum resistance value, if all gene loci under consideration are homozygous resistant. \code{numeric}, ≥ 1. |
af |
initial frequency of resistance alleles in the population. |
epis |
epistasis value, describing the interaction between resistance alleles. |
dom |
dominance of resistance alleles. |
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.
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.
The run of struc_preparation
is time consuming. Duration strongly increases with the number of genes under consideration, n_loci
.
1 2 3 4 5 6 7 | #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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.