pcrbatch: Batch calculation of qPCR efficiency and other qPCR...

Description Usage Arguments Details Value Note Author(s) See Also Examples

Description

This function batch calculates the results obtained from efficiency, sliwin, expfit, LRE or the coefficients from any of the makX/cm3 models on a dataframe containing many qPCR runs. The input can also be a list obtained from modlist, which simplifies things in many cases. The output is a dataframe with the estimated parameters and model descriptions. Very easy to use on datasheets containing many qPCR runs, i.e. as can be imported from Excel. The result is automatically copied to the clipboard.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pcrbatch(x, cyc = 1, fluo = NULL, 
         methods = c("sigfit", "sliwin", "expfit", "LRE"),
         model = l4, check = "uni2", checkPAR = parKOD(), 
         remove = c("none", "fit", "KOD"), exclude = NULL, 
         type = "cpD2", labels = NULL, norm = FALSE, 
         baseline = c("none", "mean", "median", "lin", "quad", "parm"),
         basecyc = 1:8, basefac = 1, smooth = NULL, smoothPAR = NULL, 
         factor = 1, opt = FALSE, optPAR = list(sig.level = 0.05, crit = "ftest"), 
         group = NULL, names = c("group", "first"), plot = TRUE, 
         verbose = TRUE, ...)

Arguments

x

a dataframe containing the qPCR raw data from the different runs or a list obtained from modlist.

cyc

the column containing the cycle data. Defaults to first column.

fluo

the column(s) (runs) to be analyzed. If NULL, all runs will be considered.

methods

a character vector defining the methods to use. See 'Details'.

model

the model to be used for all runs.

check

the method for outlier detection in KOD. Default is check for sigmoidal structure.

checkPAR

parameters to be supplied to the check method.

remove

which runs to remove. Either none, those which failed to fit or from the outlier methods.

exclude

either "" for samples with missing column names or a regular expression defining columns (samples) to be excluded from pcrbatch. See 'Details' and 'Examples' in modlist.

type

the point on the amplification curve from which the efficiency is estimated. See efficiency.

labels

a vector containing labels, i.e. for defining replicate groups prior to ratiobatch.

norm

logical. Should the raw data be normalized within [0, 1] before model fitting?

baseline

type of baseline subtraction. See 'Details' in modlist.

basecyc

cycle range to be used for baseline subtraction, i.e. 1:5.

basefac

a factor when using averaged baseline cycles, such as 0.95.

smooth

which curve smoothing method to use. See modlist.

smoothPAR

parameters to be supplied to the smoothing functions, supplied as a list. See modlist.

factor

a multiplication factor for the fluorescence response values (barely useful, but who knows...).

opt

logical. Should model selection be applied to each model?

optPAR

parameters to be supplied to mselect.

group

a vector containing the grouping for possible replicates.

names

how to name the grouped fit. Either 'group_1, ...' or the first name of the replicates.

plot

logical. If TRUE, the single runs are plotted from the internal 'modlist' for diagnostics.

verbose

logical. If TRUE, fitting and tagging results will be displayed in the console.

...

other parameters to be passed to downstream methods.

Details

The methods vector is used for defining the different methods from which pcrbatch will concatenate the results. The mechanistic models (mak2, mak2i, mak3, mak3i, cm3) are omitted by default, because fitting is time-expensive. If they should be included, just add "mak3" to methods. See 'Examples'. The qPCR raw data should be arranged with the cycle numbers in the first column with the name "Cycles". All subsequent columns must be plain raw data with sensible column descriptions. If replicates are defined by group, the output will contain a numbering of groups (i.e. "group_1" for the first replicate group). The model selection process is optional, but we advocate using this for obtaining better parameter estimates. Normalization has been described to improve certain qPCR analyses, but this has still to be independently evaluated. Background subtraction is done as in modlist and efficiency. In case of unsuccessful model fitting or lack of sigmoidal structure, the names are tagged by *NAME* or **NAME**, respectively (if remove = "none"). However, if remove = "fit" or remove = "KOD", the failed runs are excluded from the output. Similar to modlist, if a labels vector lab is supplied, the labels from the failed fits are removed and a new label vector lab_mod is written to the global environment.

Value

A dataframe with the results in columns containing the calculated values, fit parameters and (tagged) model name together with the different methods used as the name prefix. A plot shows a plot matrix of all amplification curves/sigmoidal fits and failed amplifications marked with asterisks.

Note

IMPORTANT: When subsequent use of ratiocalc is desired, use pcrbatch on the single run level with group = NULL and remove = "none", so that ratiocalc can automatically delete the failed runs from its group definition. Otherwise error propagation will fail.

Author(s)

Andrej-Nikolai Spiess

See Also

The function modlist for creating a list of models, which is used internally by pcrbatch.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## First 4 runs and return parameters of fit
## do background subtraction using mean the first 5 cycles.
pcrbatch(reps, fluo = 2:5, baseline = "mean", basecyc = 1:5)

## Not run: 
##  First 8 runs, with 4 replicates each, l5 model.
pcrbatch(reps, fluo = 2:9, model = l5, group = c(1,1,1,1,2,2,2,2))

## Using model selection (Akaike weights) 
## on the first 4 runs, runs 1 and 2 are replicates.
pcrbatch(reps, fluo = 2:5, group = c(1,1,2,3), 
         opt = TRUE, optPAR = list(crit = "weights"))

## Fitting a sigmoidal and 'mak3' mechanistic model.
pcrbatch(reps, methods = c("sigfit", "mak3"))

## Converting a 'modlist' to 'pcrbatch'.
ml5 <- modlist(reps, 1, 2:5, b5)
res5 <- pcrbatch(ml5)

## Using Whittaker smoothing.
pcrbatch(reps, smooth = "whit")

## End(Not run)    

qpcR documentation built on May 2, 2019, 5:17 a.m.

Related to pcrbatch in qpcR...