modlist {qpcR}R Documentation

Create nonlinear models from a dataframe and coerce them into a list

Description

Essential function to create a list of nonlinear models from the columns of a qPCR dataframe. Very handy if following functions should be applied to different qPCR models, i.e. by sapply.

Usage

modlist(x, cyc = 1, fluo = NULL, model = l4, opt = FALSE, norm = FALSE, 
        backsub = NULL, opt.method =  "LM", nls.method = "port",
        sig.level = 0.05, crit = "ftest", ...)

Arguments

x a dataframe containing the qPCR data.
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.
model the model to be used.
opt logical. Should model selection be applied?
norm logical. Should the raw data be normalized within [0; 1] before model fitting?
backsub background subtraction. If NULL, not applied. Otherwise, a numeric sequence such as 1:10. See 'Details' in pcrbatch.
opt.method see pcrfit.
nls.method see pcrfit.
sig.level see mselect.
crit see mselect.
... other parameters to be passed to pcrfit or mselect.

Details

In case of unsuccessful model fitting, the run is skipped and the next run is analyzed.

Value

A list with each item containing the model from each column. A 'names' item containing the column name is attached to each model.

Author(s)

Andrej-Nikolai Spiess

See Also

pcrbatch for batch analysis using different methods.

Examples

## calculate efficiencies for each run in
## the 'reps' data
## subtract background using the first 8 cycles
ml <- modlist(reps, model = l5, backsub = 1:8)
sapply(ml, function(x) efficiency(x, plot = FALSE)$eff)

## 'crossing points' for the first 3 runs (normalized)
##  and using best model from Akaike weights
ml <- modlist(reps, 1, 2:4, model = l5, opt = TRUE, norm = TRUE, crit = "weights" )
sapply(ml, function(x) efficiency(x, plot = FALSE)$cpD2)

[Package qpcR version 1.2-4 Index]