simDegradation: DNA Degradation Simulator

Description Usage Arguments Details Value See Also Examples

View source: R/simDegradation.r

Description

Simulates the degradation of DNA.

Usage

1
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.

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.

Value

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

See Also

simSample

Examples

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

pcrsim documentation built on May 29, 2017, 3:53 p.m.