Meiosispatmat [1


Another special type of vector is called "list". Regular vectors must have all their components of the same type (numerical, logical, character, bites, or complex). A list, on the other hand, may have any type of object as its component.

> model <- list(mu=5,alpha=1,delta=-1,sigma=0.5,allele="A")

> pheno1 <- rnorm(n,model$mu,model$sigma)

> pheno2 <- rnorm(n,model$mu + 2*model$alpha,model$sigma)

The list "model" contains the parametrs of the genetic model. Names are assigned to the components of the vector. One alternative for referring to a component of a vector is by its name: "$". (Or, one may use the format: "[""]".) The vectors "pheno1" and "pheno2" store the generated phenotypes of the two inbred lines. Finally, we store the genotype and phenotype information of the two inbred lines as lists, titled "IB1" and "IB2", respectively.

The function "cross" applies the function "meiosis" in order to simulate a cross between two mice. The first two input arguments are lists, "fa" and "mo", which contain the genetic information of the two parents. The third argument is a list with the details of the genetic model. (The format "argument=argument.value" may be used in order to assign a default value to the argument. The default value is used unless another value is specifically assigned.) The output of the function is a list with the genetic and pheno-typic information of the offspring. Note that the offspring's "pat" genotype is an allele from the father's genotype and the offspring's "mat" genotype is an allele from the mother's genotype. The object x is a vector of integers (0, 1, or 2), m is the vector of the offspring's mean phenotype, and y is the vector of expressed phenotypes.

+ m <- model$mu + x*model$alpha + (x==1)*model$delta

Note that the function "cross" may use the object "meiosis" even though this object is not implicitly passed as one of the arguments. In general, any existing object may be used inside a function. This is a useful property, but may cause unexpected side effects if applied carelessly.

We apply the function "cross" in order to create the Fi, intercross, and the two types of backcross:

Was this article helpful?

0 0

Post a comment