simExtraction: DNA Extraction Simulator

Description Usage Arguments Details Value See Also Examples

Description

Simulates the DNA extraction process.

Usage

1
2
simExtraction(data = NULL, vol.ex = 100, sd.vol = 0, prob.ex = 0.3,
  sd.prob = 0, cell.dna = 0.006, debug = FALSE)

Arguments

data

data.frame with simulated data. Preferably output from simSample. Required columns are 'Marker', 'Allele', 'Sim', and 'DNA'.

vol.ex

numeric for the final extraction volume (volume after extraction).

sd.vol

numeric for the standard deviation of vol.ex.

prob.ex

numeric for probability that an allele survives the extraction (extraction efficiency).

sd.prob

numeric for the standard deviation of prob.ex.

cell.dna

numeric to indicate the DNA content of a diploid cell in nanograms (ng).

debug

logical TRUE to indicate debug mode.

Details

Simulates the DNA extraction process by a series of normal distributions. The number of molecules is taken from the required column 'DNA' which is floored to avoid NAs in the rbinom function.

Value

data.frame with simulation results in columns 'Ex.Vol', 'Ex.Prob', Ex.DNA', 'Ex.Conc', and updated 'DNA' and 'Volume' columns (added if needed).

See Also

simSample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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 profile.
res <- simProfile(data=df, sim=3, name="Test")

# Simulate diploid sample.
res <- simSample(data=res, cells=100, sd.cells=20)

# [OPTIONAL] Simulate degradation.
res <- simDegradation(data=res, kit="ESX17", deg=0.003, quant.target=80)

# Simulate extraction.
res <- simExtraction(data=res, vol.ex=200, sd.vol=10, prob.ex=0.3, sd.prob=0.1)

Example output

Loading required package: strvalidator
R session is headless; GTK+ not initialized.
STR-validator 2.0.0 loaded!
PCRsim 1.0.2 loaded!
SIMULATE PROFILE
'Sim' column added.
'Sample.Name' column added.
SIMULATE SAMPLE
'Sample.Haploid' column added.
'Sample.Cells' column added.
'DNA' column added.
SIMULATE DEGRADATION
'Allele' must be character. 'data' converted
Audit trail created for data in function strvalidator::addSize.
Audit trail updated by function strvalidator::addSize.
'Size' column with estimated allele size added.
'Deg.Par' column added
'Deg.Prob' column added
'Deg.DNA' column added.
'DNA' column updated!
SIMULATE EXTRACTION
'Ex.Vol' column added.
'Ex.Prob' column added.
'Ex.DNA' column added.
'Ex.Conc' column added.
'Volume' column added.
'DNA' column updated!

pcrsim documentation built on May 2, 2019, 2:40 a.m.