qpcR (version 1.4-1)

replist: Amalgamation of single data models into a model containing replicates

Description

Starting from a 'modlist' containing qPCR models from single data, replist amalgamates the models according to the grouping structure as defined in group. The result is a 'replist' with models obtained from fitting the replicates by pcrfit. A kinetic outlier detection and removal option is included.

Usage

replist(object, group = NULL, check = "none",
        checkPAR = parKOD(), remove = c("none", "KOD"), 
        names = c("group", "first"), doFit = TRUE, opt = FALSE, 
        optPAR = list(sig.level = 0.05, crit = "ftest"), 
        verbose = TRUE, ...)

Arguments

object

an object of class 'modlist'.

group

a vector defining the replicates for each group.

check

which method to use for kinetic outlier detection. Either none or any of the methods in KOD.

checkPAR

parameters to be supplied to the check method, see KOD.

remove

which runs to remove. Either none or those that failed from the method defined in check.

names

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

doFit

logical. If set to FALSE, the replicate data is only aggregated without doing a refitting. See 'Details'.

opt

logical. Should model selection be applied to the final model?

optPAR

parameters to be supplied to mselect.

verbose

if TRUE, the analysis is printed to the console.

...

other parameters to be supplied to mselect.

Value

An object of class 'replist' containing the replicate models of class 'nls'/'pcrfit'.

Details

As being defined by group, the 'modlist' is split into groups of runs and these amalgamated into a nonlinear model. Runs which have failed to be fitted by modlist are automatically removed and group is updated (that is, the correpsonding entries also removed) prior to fitting the replicate model by pcrfit. Model selection can be applied to the final replicate model by setting opt = TRUE and changing the parameters in optPAR. If check is set to any of the methods in "KOD", kinetic outliers are identified and optionally removed, if remove is set to "KOD". If doFit = FALSE, the replicate data is only aggregated and no refitting is done. This is useful when plotting replicate data by some grouping vector. See 'Examples'.

See Also

modlist, pcrfit.

Examples

Run this code
# NOT RUN {
## Convert 'modlist' into 'replist'.
ml1 <- modlist(reps, model = l4)
rl1 <- replist(ml1, group = gl(7, 4))
plot(rl1)
summary(rl1[[1]])

## Optimize model based on Akaike weights.
rl2 <- replist(ml1, group = gl(7, 4), opt = TRUE, 
               optPARS = list(crit = "weights"))
plot(rl2)

# }
# NOT RUN {
## Remove kinetic outliers,
## use first replicate name for output.
ml3 <- modlist(reps, model = l4)
rl3 <- replist(ml3, group = gl(7, 4), check = "uni1", 
               remove = "KOD", names = "first")
plot(rl3, which = "single")

## Just aggregation and no refitting.
ml4 <- modlist(reps, model = l4)
rl4 <- replist(ml4, group = gl(7, 4), doFit = FALSE)
plot(rl4, which = "single")

## Scenario 1:
## automatic removal of runs that failed to
## fit during 'modlist' by using 'testdat' set.
ml5 <- modlist(testdat, model = l5)
rl5 <- replist(ml5, gl(6, 4))
plot(rl5, which = "single")

## Scenario 2:
## automatic removal of runs that failed to
## fit during 'replist':
## samples F3.1-F3.4 is set to 1.
dat1 <- reps
ml6 <- modlist(dat1)
ml6[[9]]$DATA[, 2] <- 1
ml6[[10]]$DATA[, 2] <- 1
ml6[[11]]$DATA[, 2] <- 1
ml6[[12]]$DATA[, 2] <- 1
rl6 <- replist(ml6, gl(7, 4))
plot(rl6, which = "single")
# }

Run the code above in your browser using DataLab