markerSimParametric  R Documentation 
This function simulates genotypes for two individuals given their IBD distribution, for N identical markers.
markerSimParametric( kappa = NULL, delta = NULL, states = NULL, N = 1, alleles = NULL, afreq = NULL, seed = NULL, returnValue = c("singletons", "alleles", "genotypes", "internal") )
kappa 
A probability vector of length 3, giving a set of realised kappa coefficients (between two noninbred individuals). 
delta 
A probability vector of length 9, giving a set of condensed identity coefficients (Jacquard coefficients). 
states 
An integer vector of length 
N 
A positive integer: the number of independent markers to be simulated. 
alleles 
A vector with allele labels. If NULL, the following are tried in order:

afreq 
A numeric vector with allele frequencies, possibly named with allele labels. 
seed 
An integer seed for the random number generator (optional). 
returnValue 
Either "singleton" (default) or "alleles". (see Value). 
Exactly one of kappa
, delta
and states
must be given; the other two
should remain NULL.
If states
is given, it explicitly determines the condensed identity state
at each marker. The states are described by integers 19, using the tradition
order introduced by Jacquard.
If kappa
is given, the states are generated by the command states = sample(9:7, size = N, replace = TRUE, prob = kappa)
. (Note that identity
states 9, 8, 7 correspond to IBD status 0, 1, 2, respectively.)
If delta
is given, the states are generated by the command states = sample(1:9, size = N, replace = TRUE, prob = delta)
.
The output depends on the value of the returnValue
parameter:
"singletons": a list of two singletons with the simulated marker data attached.
"alleles": a list of four vectors of length N
, named a
, b
, c
and
d
. These contain the simulated alleles, where a/b and c/d are the
genotypes of the to individuals.
"genotypes": a list of two vectors of length N
, containing the
simulated genotypes. Identical to paste(a, b, sep = "/")
and paste(c, d, sep = "/")
, where a
, b
, c
, d
are the vectors returned when
returnValue == "alleles"
.
"internal": similar to "alleles", but using the index integer of each allele. (This option is mostly for internal use.)
# MZ twins markerSimParametric(kappa = c(0,0,1), N = 5, alleles = 1:10) # Equal distribution of states 1 and 2 markerSimParametric(delta = c(.5,.5,0,0,0,0,0,0,0), N = 5, alleles = 1:10) # Force a specific sequence of states markerSimParametric(states = c(1,2,7,8,9), N = 5, alleles = 1:10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.