Learn R Programming

pcrsim (version 1.0.2)

simProfile: DNA Profile Simulator

Description

Simulates DNA profiles.

Usage

simProfile(data = NULL, kit = NULL, sim = 1, name = NULL, db = NULL,
  debug = FALSE)

Arguments

data
data.frame with columns 'Marker' and 'Allele' (creates fixed profiles).
kit
character string to specify the typing kit (if kit=NULL all markers in db will be used).
sim
integer to specify the number of replicates or random profiles.
name
character string giving the sample base name ('Sim' is appended).
db
data.frame with the allele frequency database (used if data=NULL to create random profiles).
debug
logical TRUE to indicate debug mode.

Value

data.frame with columns 'Sample.Name', 'Marker', 'Allele', 'Sim'.

Details

There are three ways to create DNA profiles: 1) Simulate DNA profiles of the selected kit using allele frequencies from the provided db. 2) Simulate DNA profiles using all available markers and allele frequencies from the provided db. 3) Provide a data.frame with a fixed DNA profile. sim random profiles or sim replicates are created. The resulting data.frame can be used as input to simSample. NB! Homozygous alleles must be specified two times e.g. 16, 16.

See Also

simSample

Examples

Run this code
# Create a data frame with a DNA profile.
markers = rep(c("D3S1358","TH01","FGA"), each=2)
alleles = c(15,18,6,10,25,25)
df <- data.frame(Marker=markers, Allele=alleles)

# Simulate sample
res <- simProfile(data=df, sim=10, name="Test")
print(res)

Run the code above in your browser using DataLab