Learn R Programming

qpcR (version 1.3-2)

modlist: 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, remove = FALSE, opt = FALSE, 
        norm = FALSE, backsub = NULL, opt.method =  "all", 
        nls.method = "all", sig.level = 0.05, crit = "ftest", 
        verbose = TRUE, ...)

Arguments

x
a dataframe containing the qPCR data or a single qPCR run of class 'pcrfit'.
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.
remove
logical. If TRUE, runs that failed to be fitted are not included in the output. See 'Details'.
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.
verbose
logical. If TRUE, fitting and tagging results will be displayed in the console.
...
other parameters to be passed to pcrfit or mselect.

Value

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

Details

In case of unsuccessful model fitting and if remove = FALSE (default), the original data is included in the output, albeit with no fitting information. This is useful since using plot.pcrfit on the 'modlist' shows the non-fitted runs. If remove = TRUE, the non-fitted runs are automatically removed and will thus not be displayed. See plot.pcrfit for examples.

See Also

pcrbatch for batch analysis using different methods.

Examples

Run this code
## 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)

## convert a single run to a 'modlist'
m <- pcrfit(reps, 1, 2, l5)
ml <- modlist(m)

Run the code above in your browser using DataLab