Learn R Programming

forrel (version 1.1.0)

profileSim: Simulation of complete DNA profiles

Description

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().

Usage

profileSim(
  x,
  N = 1,
  ids = NULL,
  markers = NULL,
  seed = NULL,
  numCores = 1,
  verbose = TRUE,
  ...
)

Arguments

x

A ped object or a list of such.

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

A list of marker objects, or a vector containing names or indices referring to markers attached to x. By default (NULL), all attached markers are used. The simulations will be conditional on the locus attributes (allele frequencies, mutation models a.s.o.) and any existing genotypes in the indicated markers.

seed

NULL, or a numeric seed for the random number generator.

numCores

The number of cores used for parallelisation, by default 1.

verbose

A logical, by default TRUE.

...

Further arguments passed on to markerSim().

Value

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.

Examples

Run this code
# NOT RUN {
# Example with two brothers
x = nuclearPed(children = c("B1", "B2"))

# Attach two markers; one brother is already genotyped
m1 = marker(x, B1 = 1:2, alleles = 1:3)
m2 = marker(x, B1 = 1, alleles = 1:4, afreq = (1:4)/10, chrom = "X")
x = setMarkers(x, list(m1, m2))

# Simulate 3 profiles of B2 conditional on the above
profileSim(x, N = 3, ids = "B2")

# }

Run the code above in your browser using DataLab