Description Usage Arguments Details Value Author(s) References See Also Examples
A function that simulates results of an array digital PCR.
1 |
m |
the total number of template molecules added to the plate. Must be a positive integer. |
n |
the number of chambers per plate. Must be a positive integer. |
times |
number of repetitions (see Details). |
n_panels |
the number of panels that are simulated by the function.
Cannot have higher value than the |
dube |
if |
pos_sums |
if |
The array digital PCR is performed on plates containing many microfluidic chambers with a randomly distributed DNA template, fluorescence labels and standard PCR reagents. After the amplification reaction, performed independently in each chamber, the chambers with the fluorescence level below certain threshold are treated as negative. From differences between amplification curves of positive chambers it is possible to calculate both total number of template molecules and their approximate number in a single chamber.
The function contains two implementations of the array digital PCR
simulation. First one was described in Dube at. al (2008). This method is
based on random distributing m * times molecules
between n * times chambers. After this step, the
required number of plates is created by the random sampling of chambers
without replacement. The above method is used, when the dube
argument
has value TRUE
.
The second method treats the total number of template molecules as random
variable with a normal distribution N(n,
0.05*n). The exact sum of total molecules per plate is calculated and
randomly adjusted to the value of m * times. The above
method is used, when the dube
argument has value FALSE
. This
implementation is much faster than previous one, especially for big
simulations. The higher the value of the argument times
, the
simulation result is closer to theoretical calculations.
If the pos_sums
argument has value FALSE
, the function
returns a matrix with n rows and n_panels columns. Each column
represents one plate. The type of such simulation would be "nm"
. If the
pos_sums
argument has value TRUE
, the function returns a
matrix with one row and n_panels columns. Each column contains the
total number of positive chambers in each plate and type of simulation would
be set as "tnp"
.
In each case the value is an object of the adpcr
class.
Michal Burdukiewicz.
Dube S, Qin J, Ramakrishnan R, Mathematical Analysis of Copy Number Variation in a DNA Sample Using Digital PCR on a Nanofluidic Device. PLoS ONE 3(8), 2008.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # Simulation of a digital PCR experiment with a chamber based technology.
# The parameter pos_sums was altered to change how the total number of positive
# chamber per panel are returned. An alteration of the parameter has an impact
# in the system performance.
adpcr_big <- sim_adpcr(m = 10, n = 40, times = 1000, pos_sums = FALSE, n_panels = 1000)
adpcr_small <- sim_adpcr(m = 10, n = 40, times = 1000, pos_sums = TRUE, n_panels = 1000)
# with pos_sums = TRUE, output allocates less memory
object.size(adpcr_big)
object.size(adpcr_small)
# Mini version of Dube et al. 2008 experiment, full requires replic <- 70000
# The number of replicates was reduced by a factor of 100 to lower the computation time.
replic <- 700
dube <- sim_adpcr(400, 765, times = replic, dube = TRUE,
pos_sums = TRUE, n_panels = replic)
mean(dube) # 311.5616
sd(dube) # 13.64159
# Create a barplot from the simulated data similar to Dube et al. 2008
bp <- barplot(table(factor(dube, levels = min(dube):max(dube))),
space = 0)
lines(bp, dnorm(min(dube):max(dube), mean = 311.5, sd = 13.59)*replic,
col = "green", lwd = 3)
# Exact Dube's method is a bit slower than other one, but more accurate
system.time(dub <- sim_adpcr(m = 400, n = 765, times = 500, n_panels = 500,
pos_sums = TRUE))
system.time(mul <- sim_adpcr(m = 400, n = 765, times = 500, n_panels = 500,
pos_sums = FALSE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.