struc_preparation2: Generating data input and output structures

Description Usage Arguments Details Value Warning See Also Examples

View source: R/struc_preparation2.R

Description

struc_preparation creates the data input and output structures (data.frames and table) for the simulation run, 'dfgenotype', 'xprobab' and 'mf'.

Usage

1
struc_preparation2(Rmx = NA, af = NA, epis = NA, dom = NA)

Arguments

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. numeric vector with length of ng (number of genes) and elements in [0,1].

epis

epistasis value, describing the interaction between resistance alleles. numeric. epis = 0: no interaction i.e. additive effects of resistance alleles, epis < 0: effect of resistance alleles is smaller than additive, epis > 0: effect of resistance alleles is higher than additive.

dom

dominance of resistance alleles. numeric vector with length of n_loci (number of genes) and elements in [0,1].

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:

  1. 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.

  2. 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'.

  3. 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

sel_resist gen_freq

Examples

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)

PROSPER documentation built on July 2, 2020, 3:25 a.m.