Learn R Programming

isqg (version 1.2)

mating: Breed Simulated Individuals According to Basic Mating Schemes

Description

Performs the simple mating schemes bi-parental cross, self-cross and haploid duplication, respectively through the functions cross, selfcross and dh and return the respective size n progeny involving the parental individuals belonging to the same specie.

Usage

cross(n = 1, p1, p2)

selfcross(n = 1, gid)

dh(n = 1, gid)

Arguments

n

a length-one integer vector with the size of the progeny.

p1, p2, gid

are instances of the class specimen which will be used as the parents.

Value

a size n list with instances of the class Specimen that represent new individuals belonging to the progeny of the respective mating scheme.

Details

Basically this family of functions take simulated individuals belonging to the same simulated specie, performs the meiosis that generates individual's gametes. According to the scheme applied the gametes are merged into new simulated individuals. These are wrap functions to the C++ class that mimic the meiosis recombination process.

Examples

Run this code
# NOT RUN {
data(ToyMap)
spc <- set_specie(ToyMap)
AA <- founder(spc, "AA")
aa <- founder(spc, "aa")

## Mather Design
F1  <- cross(n = 1, AA, aa)
BC1 <- cross(n = 5, F1, AA)
BC2 <- F1$cross(n = 5, aa)   # using R6 methods
F2  <- selfcross(n = 10, F1) 
RIL <- dh(n = 10, F1) 
## chainable R6 methods
F3  <- F1$selfcross(n = 1, replace = TRUE)$selfcross(n = 1, replace = TRUE)

# }

Run the code above in your browser using DataLab