simExtraction: DNA Extraction Simulator

Description Usage Arguments Details Value See Also Examples

View source: R/simExtraction.r

Description

Simulates the DNA extraction process.

Usage

1
2
3
4
5
6
7
8
9
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)

OskarHansson/pcrsim documentation built on Jan. 22, 2022, 11:55 a.m.