Learn R Programming

pcrsim (version 1.0.1)

simDegradation: DNA Degradation Simulator

Description

Simulates the degradation of DNA.

Usage

simDegradation(data, kit, deg, quant.target, debug = FALSE)

Arguments

data
data.frame with simulated data. Preferably output from simSample. Required columns are 'Allele', 'DNA', and 'Sim'.
kit
character string for STR DNA amplification kit.
deg
numeric for the estimated degradation probability (chance per base pair)
quant.target
integer defining the quantification target size in base pair.
debug
logical TRUE to indicate debug mode.

Value

data.frame with simulated results in columns 'Deg.Par', 'Deg.Prob', and 'Deg.DNA'.

Details

Simulates the DNA degradation process by calculating the probability that a DNA fragment of the specific size (bp) is complete i.e. not degraded. Then a binomial selection of non-degraded molecules takes place with the previously calculated probability. The number of molecules is taken from the required column 'DNA' which is floored to avoid NAs in the rbinom function.

See Also

simSample

Examples

Run this code
# Simulate profile.
# Get allele frequency database.
require(strvalidator)
db <- strvalidator::getDb(getDb()[2])
# Simulate profile.
res <- simProfile(kit= "ESX17", db=db, sim=10, name="Test")
# Simulate sample.
res <- simSample(data=res, cells=5000)
# Simulate degradation.
res <- simDegradation(data=res, kit="ESX17", deg=0.03, quant.target=80)
print(res)

Run the code above in your browser using DataLab