sim.cross.exp {twopartqtl} | R Documentation |
Simulates data for a QTL backcross experiment using a model in which QTLs act additively.
sim.cross.exp(map, model = NULL, n.ind = 100, type = c("bc"), error.prob = 0, missing.prob = 0, keep.qtlgeno = TRUE, keep.errorind = TRUE, m = 0, p = 0, map.function = c("haldane", "kosambi", "c-f", "morgan"), dist, params, logNorm = FALSE)
map |
A list whose components are vectors containing the marker locations on each of the chromosomes. |
model |
A matrix where each row corresponds to a different QTL, and gives the chromosome number, cM position and effects of the QTL. |
n.ind |
Number of individuals to simulate. |
type |
Indicates type of experimental cross to simulate. Only backcross supported. |
error.prob |
The genotyping error rate. |
missing.prob |
The rate of missing genotypes. |
keep.qtlgeno |
If TRUE, genotypes for the simulated QTLs will be included in the output. |
keep.errorind |
If TRUE, and if error.prob > 0 , the
identity of genotyping errors will be included in the output. |
m |
Interference parameter; a non-negative integer. 0 corresponds to no interference. |
p |
Probability that a chiasma comes from the no-interference mechanism |
map.function |
Indicates whether to use the Haldane, Kosambi, Carter-Falconer, or Morgan map function when converting genetic distances into recombination fractions. |
dist |
Parametric distribution from which to generate phenotypes |
params |
Vector of parameters for parametric distributions |
logNorm |
If TRUE, continuous observations in point-mass mixture generated from log normal distribution. If FALSE, continuous observations are from truncated normal. |
This function extends sim.cross
to simulate phenotypes from several
additional parametric distributions including point-mass mixtures. The
available distributions and their specification in dist
are
normal ("norm"
), log normal ("lognorm"
), gamma ("gamma"
),
truncated normal ("truncNorm"
), t ("t"
), Cauchy ("cauchy"
),
logistic ("logistic"
), exponential ("expon"
), Uniform ("uniform"
,
Poisson ("pois"
), and point-mass mixture ("pointmass"
).
Parameters for the distribution are specified as a vector in the param
argument as follows: normal (mean, sd
), log normal (mean, sd
),
gamma (shape, scale
), truncated normal (mean, sd, floor
) where
mean
and sd
are the parameters of the normal distribution prior
to truncation and floor
is the lower value at which the distribution
is truncated, t (df
), Cauchy (location, scale
), logistic (location, scale
),
exponential (rate
), uniform (min, max
), Poisson (lambda
),
point-mass mixture (proportion, mean, sd
) where proportion is the proportion
of observations in the point-mass and mean and sd are parameters for generating
the continuous observations from a truncated normal or log normal distribution.
Point-mass values are always simulated at 0.
An object of class cross
. See read.cross
for
details.
If keep.qtlgeno
is TRUE, the cross object will contain a
component qtlgeno
which is a matrix containing the QTL
genotypes (with complete data and no errors), coded as in the genotype
data.
If keep.errorind
is TRUE and errors were simulated, each
component of geno
will each contain a matrix errors
,
with 1's indicating simulated genotyping errors.
Sandra L. Taylor, sltaylor@ucdavis.edu
# Simulate a genetic mapp Map <- sim.map(c(100,100), n.mar=c(22), include.x=FALSE, eq.spacing=TRUE) num.ind <- 200 # simulate 200 backcross individuals with one qtl affecting a point-mass mixture trait # define a qtl at 30 cm on chromosome 1 with an additive effect of 0.6 # on the mean of the continuous component and -0.1 on the proportion of # observations in the point-mass at 0 QTL.info <- rbind(c(1,30,0.6,-0.01)) sim <- sim.cross.exp(map=Map, model=QTL.info, n.ind=num.ind, type="bc", keep.qtlgeno=TRUE, map.function="haldane", dist="pointmass", params=c(0.5,1,0.6))