profileSim | R Documentation |
Simulation of DNA profiles for specified pedigree members. Some pedigree
members may already be genotyped; in that case the simulation is conditional
on these. The main work of this function is done by markerSim()
.
profileSim(
x,
N = 1,
ids = NULL,
markers = NULL,
seed = NULL,
numCores = 1,
simplify1 = TRUE,
verbose = TRUE,
...
)
x |
A |
N |
The number of complete simulations to be performed. |
ids |
A character (or coercible to character) with ID labels indicating whose genotypes should be simulated. |
markers |
Either a vector indicating a subset of markers attached to
|
seed |
An integer seed for the random number generator (optional). |
numCores |
The number of cores to be used. The default is 1, i.e., no parallelisation. |
simplify1 |
A logical, by default TRUE, removing the outer list layer
when |
verbose |
A logical, by default TRUE. |
... |
Further arguments passed on to |
A list of N
objects similar to x
, but with simulated genotypes.
Any previously attached markers are replaced by the simulated profiles. If
the indicated markers contained genotypes for some pedigree members, these
are still present in the simulated profiles.
If N = 1
and simplify1 = TRUE
, the outer list layer is removed, i.e.,
profileSim(..., N = 1, simplify1 = T)
is equivalent to profileSim(..., N = 1, simplify1 = F)[[1]]
. This is usually the desired object in
interactive use, and works well with piping.
When using profileSim()
in other functions, it is recommended to add
simplify1 = FALSE
to safeguard against issues with N = 1
.
# Example pedigree with two brothers
x = nuclearPed(children = c("B1", "B2"))
### Simulate profiles using built-in freq database
profileSim(x, markers = NorwegianFrequencies[1:3])
### Conditioning on known genotypes for one brother
# Attach two SNP markers with genotypes for B1
y = x |>
addMarker(B1 = "1/2", alleles = 1:2) |>
addMarker(B1 = "1", alleles = 1:2, chrom = "X")
# Simulate 2 profiles of B2 conditional on the above
profileSim(y, N = 2, ids = "B2", seed = 123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.