knownqpcr: Estimate auxiliary parameters using samples with known allele...

View source: R/03_known_ratio.R

knownqpcrR Documentation

Estimate auxiliary parameters using samples with known allele ratios.

Description

The function to estimate the auxiliary experimental parameters using DNA solutions, provided the dataset contains samples with multiple allele mixing ratios and the exact mixing ratio are known for each sample. This function is used when all replicates in the dataset comprise the complete observations on the 2 \times 2 combinations of the qPCR conditions in a RED-ΔΔCq analysis: (loci for target or housekeeping genes) and (the target gene is undigested or digested with endonuclease). The quartet of the four Cq data, housek0, target0 (these two are undigested samples amplified with housekeeping and target genes, respectively), housek1, and target1 (digested samples) should be prepared as four numeric vectors having the same length.
One more variable, trueY is needed to run the estimation process; it a numeric vector having the same length with the four Cq data. It holds the exact allele-mixing ratio for each quartet (also see the code example). Optionally, you can adjust the relative DNA concentration between the replicates with a parameter vector A.
Since version 0.3.2, the knownqpcr() function can also deal with general ΔΔCq analyses. In such cases, samples with any mixing ratios are generally marked as ‘digested samples’ i.e., either of housek1 or target1, depending on the loci to be amplified. The arguments of the corresponding undigested samples, housek0 and target0, must not be specified by the user. Then, the parameter baseChange (δ_{B}: the change rate of DNA contents before/after the endonuclease digestion) is not included in the estimation result.

Usage

knownqpcr(
  housek0,
  target0,
  housek1,
  target1,
  trueY,
  A = rep(1, length(trueY)),
  XInit = c(meanDNA = -10, targetScale = 0, baseChange = 0, sdMeasure = 1, zeroAmount =
    -5, EPCR = 0),
  method = "BFGS",
  pvalue = 0.05,
  trace = 0,
  report = 10,
  verbose = FALSE
)

Arguments

housek0, target0, housek1, target1

Measured Cq values. Numeric vectors having the same length as trueY. Values must not be duplicated (any single Cq measure must not be recycled); if the dataset has missing Cq values, there are two ways. 1) Fill the missing values explicitly with NA and use knownqpcr(), or 2) use another function knownqpcr_unpaired(), which accepts a ‘long’ format dataset.
In RED-ΔΔCq method, housek0 and target0 corresponds to the intact test samples (not digested with endonuclease) amplified with the housekeeping- and target-loci, respectively. In general ΔΔCq analyses, housek0 and target0 are absent, and only test samples (housek1 and target1) are input by the user. At a first glance, the test samples seem to be unaffected by endonuclease when trueY[i] == 1, but they must also be input as housek1 or target1 because in fact their Cq values are affected by baseChange.

trueY

A numeric vector having the same length as the Cq data. trueY[i] signifies the exact allele frequency in the ith sample. The values must be between 0 and 1, and NA is not allowed. To improve the estimation accuracy, it is better to include the settings y == 0 (pure S solution) and y == 1 (pure R) in your dataset.

A

Optionally, you can specify relative DNA content between the samples, as a numeric vector having the same length as the Cq data. If present, A must not include missing values. It is the counterpart of the N argument in freqpcr(), whereas an element of A is not restricted to integer. Because the concentration as a whole is also adjusted with the parameter meanDNA (see Value section), A is used exclusively to reflect the relative contents between the sample solutions. Otherwise, A should be left unspecified (the default is 1 for all replicates).

XInit

Optionally, the named vector specifies the initial parameter values to be optimized. Defined in the natural log scale; e.g. zeroAmount = -5 corresponds to the residue rate exp(-5) = 0.007. Keeping the default is highly recommended.

method

A string specifying the optimization algorithm used in optim(). The default is BFGS, which is plausible in most situation.

pvalue

The two-sided confidence interval is calculated at the last iteration at given significance level. Default is 0.05, which returns the 95% Wald's CI (2.5 to 97.5 percentile) based on the Hessian matrix.

trace

Non-negative integer. If positive, optim() outputs trace information. The default is 0 (no information).

report

The frequency of reports if trace is positive. Defaults to every 10 iterations.

verbose

Send messages to stdout? Default is FALSE.

Value

A table containing the estimated values for the following parameters:

  1. meanDNA is the template DNA concentration (of housekeeping gene, per unit volume of sample solution) compared to the threshold line of PCR.

  2. targetScale (δ_{T}) is the relative template DNA amount of the target to the houskeeping loci.

  3. baseChange (δ_{B}) is the change rate in the DNA amount after endonuclease digestion in RED-ΔΔCq method. In general ΔΔCq analyses (neither housek0 nor target0 is input), this parameter is not returned. In both cases, baseChange is not required to run freqpcr().

  4. sdMeasure (σ_{c}) is the measurement error (standard deviation) at each Cq value.

  5. zeroAmount (z) is the ratio of non-target allele amplified in qPCR (see the argument list of freqpcr()).

  6. EPCR (η) is the amplification efficiency per PCR cycle.

See Also

Other estimation procedures: freqpcr(), knownqpcr_unpaired(), sim_dummy()

Examples

# A dummy Cq dataset: four mixing ratios with four replicates.
# K:2, scaleDNA:1e-11, targetScale:1.5, baseChange:0.3, zeroAmount:1e-3,
# sdMeasure:0.3, and EPCR:0.95. Assuming a RED-DeltaDeltaCq analyses.
trueY <- c(rep(0.1, 4), rep(0.25, 4), rep(0.5, 4), rep(1, 4))
housek0 <- c( 19.39, 19.78, 19.28, 19.58,  18.95, 19.91, 19.66, 19.96,
              20.05, 19.86, 19.55, 19.61,  19.86, 19.27, 19.59, 20.21 )
target0 <- c( 19.16, 19.08, 19.28, 19.03,  19.17, 19.67, 18.68, 19.52,
              18.92, 18.79, 18.8, 19.28,   19.57, 19.21, 19.05, 19.15 )
housek1 <- c( 21.61, 21.78, 21.25, 21.07,  22.04, 21.45, 20.72, 21.6,
              21.51, 21.27, 21.08, 21.7,   21.44, 21.46, 21.5, 21.8 )
target1 <- c( 24.3, 24.22, 24.13, 24.13,   22.74, 23.14, 23.02, 23.14,
              21.65, 22.62, 22.28, 21.65,  20.83, 20.82, 20.76, 21.3 )
d.cmp <- data.frame(A=rep(1, 16), trueY, housek0, target0, housek1, target1)
print(d.cmp)

# In RED-DeltaDeltaCq analyses, four observations stem from one sample solution.
# Each argument must be specified with its name (name=source).
knownqpcr(  housek0=d.cmp$housek0, target0=d.cmp$target0,
            housek1=d.cmp$housek1, target1=d.cmp$target1,
            trueY=d.cmp$trueY, A=d.cmp$A, verbose=FALSE  )

# In general DeltaDeltaCq analyses, the experimental design will not include
# dedicated control samples. The function then runs without 'housek0' and 'target0'.
knownqpcr(  housek1=d.cmp$housek1, target1=d.cmp$target1,
            trueY=d.cmp$trueY, A=d.cmp$A, verbose=TRUE  )

freqpcr documentation built on March 18, 2022, 7:25 p.m.