dot-integrate_gamma: Double integration of likelihood over the two DNA quantities...

.integrate_gammaR Documentation

Double integration of likelihood over the two DNA quantities obeying the gamma distributions.

Description

Internal function to integrate the likelihood getting ΔCq value (the argument del) over the entire range of the DNA quantities of the two alleles, 0 <= x_S < Inf and 0 <= x_R < Inf. Vectorized for multiple bulk samples. It shares the arguments with .integrate_beta.

Usage

.integrate_gamma(
  del,
  SHR,
  SHS,
  zeroAmount,
  targetScale,
  sdMeasure,
  xsm = 2,
  EPCR,
  cubmethod = "hcubature",
  relTol = 0.1,
  absTol = 1e-08,
  maxEval = 10^6
)

Arguments

del

Numeric vector of the observed ΔCq values.

SHR

The gamma shape parameters for the mutant (R) portion of the bulk samples. Should be the same vector length as del. Each element of SHR is defined as K*(the assumed number of R allele in the bulk sample: 1, 2, 3, ..., n-1).

SHS

The gamma shape parameters for the wild (S) portion of the bulk samples. Should be the same length as del. Each element of SHS is defined as K*(the assumed number of S allele in the bulk sample).

zeroAmount

(In RED-ΔΔCq method) residue rate of restriction enzyme digestion, or (in general ΔΔCq analyses) small portion of the off-target allele on the target locus of the test sample, which will be amplified in the PCR. It needs to be always specified by the user as a number between 0 and 1, usually near 0.

targetScale

(δ_{T}) Scalar. The relative template DNA amount of the target locus to the houskeeping locus. If known, given as a positive numeric.

sdMeasure

(σ_{c}) Scalar. The measurement error (standard deviation) on each Cq value following Normal(0, σ_{c}^2). If known, given as a positive numeric.

xsm

Specify the accumulation of the standard deviation of the Cq measuring errors when the *-Cq values are fed as difference. For ΔCq values, sdMeasure times two. For ΔΔCq, sdMeasure times four. Default is two and used in most cases.

EPCR

(η) Scalar. Amplification efficiency per PCR cycle. If known, given as a positive numeric. When EPCR = 1, template DNA doubles every cycle (EPCR + 1 = 2).

cubmethod

Cubature method passed to the integrator function. See the section "Methods for cubintegrate".

relTol

The maximum tolerance passed to the cubature method. Though the default of cubature::cubintegrate function is 1e-5, the accuracy is reduced here to acceralate the integration.

absTol

The absolute tolerance passed to the cubature method. The default is 1e-8, which is less accurate than the default of cubintegrate function (1e-12) but considered enough for the estimation.

maxEval

Maximum number of function evaluations needed. The default is 10^6, which is same as the cubintegrate default.

Value

A numeric vector of marginal likelihoods having the same length as del.

See Also

Other integrators: .integrate_beta()


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