simNormalize: Normalization Simulator

Description Usage Arguments Details Value See Also Examples

View source: R/simNormalize.r

Description

Simulates the normalization process of a DNA extract.

Usage

1
2
3
4
5
6
7
8
9
simNormalize(
  data = NULL,
  volume = NULL,
  accuracy = 1,
  target = 0.5/17.5,
  tolerance = 0.1,
  multiple = FALSE,
  debug = FALSE
)

Arguments

data

data.frame with simulated data. Preferably output from simExtraction. Required columns are 'Marker', 'Allele', 'Sim', 'Volume', 'Ex.Conc', and 'DNA'.

volume

numeric for the final volume after dilution.If NULL it will be taken from column 'Volume'.

accuracy

numeric for the pipetting accuracy e.g. minimum pipetting volume.

target

numeric for the target concentration.

tolerance

numeric for the tolerance around the target concentration e.g. 0.1 is +-10%.

multiple

logic if TRUE the function will call itself until target is reached. Only the last round of results will be stored in the simulated dataset.

debug

logical flagging for debug mode.

Details

Simulates the normalization process by binomial selection of molecules. The average concentration per sample is used to calculate the dilution factor.

Value

data.frame with simulation results in columns 'Norm.Avg.Conc', 'Norm.Vol', 'Norm.Aliq', 'Norm.Aliq.Prob', 'Norm.DNA', 'Norm.Conc', and 'DNA'.

See Also

simExtraction

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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=10000, sd.cells=200)

# [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)

# Simulate normalization.
res <- simNormalize(data=res, volume=100)

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