Description Usage Arguments Details Value References See Also Examples
Aggregate the kinetic data using curve-parameter
estimation, i.e. infer parameters from the kinetic data
stored in an OPM
object using either the
grofit package or the built-in method. Optionally
include the aggregated values in a novel
OPMA
object together with previously
collected information.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## S4 method for signature 'MOPMX'
do_aggr(object, ...)
## S4 method for signature 'OPM'
do_aggr(object, boot = 0L, verbose = FALSE,
cores = 1L, options = if (identical(method, "splines"))
set_spline_options()
else
list(), method = "splines", plain = FALSE, logt0 = FALSE)
## S4 method for signature 'OPMS'
do_aggr(object, ...)
## S4 method for signature 'matrix'
do_aggr(object, what = c("AUC", "A"),
boot = 100L, ci = 0.95, as.pe = "median", ci.type = "norm",
time.pos = 1L, transposed = FALSE, raw = FALSE, ...)
|
object |
|
boot |
Integer scalar. Number of bootstrap
replicates used to estimate 95-percent confidence
intervals (CIs) for the parameters. Set this to
zero to omit bootstrapping, resulting in |
verbose |
Logical scalar. Print progress messages? |
cores |
Integer scalar. Number of cores to use.
Setting this to a value larger than |
options |
List. For its use in grofit mode,
see |
method |
Character scalar. The aggregation method to use. Currently only the following methods are supported:
|
plain |
Logical scalar. If |
logt0 |
Logical scalar passed to
|
what |
Character scalar. Which parameter to estimate. Currently only two are supported. |
ci |
Confidence interval to use in the output.
Ignored if |
as.pe |
Character scalar determining what to output
as the point estimate. Either median, mean or
pe; the first two calculate the point estimate from
the bootstrapping replicates, the third one use the point
estimate from the raw data. If |
ci.type |
Character scalar determining the way the
confidence intervals are calculated. Either norm,
basic or perc; see |
time.pos |
Character or integer scalar indicating the position of the column (or row, see next argument) with the time points. |
transposed |
Character or integer scalar indicating whether the matrix is transposed compared to the default. |
raw |
Logical scalar. Return the raw bootstrapping result without CI estimation and construction of the usually resulting matrix? |
... |
Optional arguments passed between the methods
or to |
Behaviour is special if the plate_type
is
one of those that have to be explicitly set using
gen_iii
and there is just one point
measurement. Because this behaviour is usual for plates
measured either in Generation-III (identification) mode
or on a
MicroStation(TM),
the point estimate is simply regarded as ‘A’
parameter (maximum height) and all other parameters are
set to NA
.
The OPMS
method just applies the
OPM
method to each contained plate in turn;
there are no inter-dependencies. The same holds for the
MOPMX
method.
Note that some spline-fitting methods would crash with
constant input data (horizontal lines instead of curves).
As it is not entirely clear that those input data always
represent artefacts, spline-fitting is skipped in such
cases and replaced by reading the maximum height and the
area under the curve directly from the data but setting
the slope and the lag phase to NA
, with a warning.
Examples with plain = TRUE
are not given, as only
the return value is different: Let x
be the normal
result of do_aggr()
. The matrix returned if
plain
is TRUE
could then be received using
aggregated(x)
, whereas the ‘method’ and the
‘settings’ attributes could be obtained as
components of the list returned by
aggr_settings(x)
.
The matrix method quickly estimates the curve parameters
AUC (area under the curve) or A (maximum
height). This is not normally directly called by an
opm user but via the other do_aggr
methods.
The aggregated values can be queried for using
has_aggr
and received using
aggregated
.
If plain
is FALSE
, an OPMA
object. Otherwise a numeric matrix of the same structure
than the one returned by aggregated
but
with an additional ‘settings’ attribute containing
the (potentially modified) list proved via the
settings
argument, and a ‘method’ attribute
corresponding to the method
argument.
The matrix method returns a numeric matrix with three
rows (point estimate, lower and upper CI) and
as many columns as data columns (or rows) in
object
. If raw
is TRUE
, it returns
an object of the class ‘boot’.
Brisbin, I. L., Collins, C. T., White, G. C., McCallum, D. A. 1986 A new paradigm for the analysis and interpretation of growth data: the shape of things to come. The Auk 104, 552–553.
Efron, B. 1979 Bootstrap methods: another look at the jackknife. Annals of Statistics 7, 1–26.
Kahm, M., Hasenbrink, G., Lichtenberg-Frate, H., Ludwig, J., Kschischo, M. grofit: Fitting biological growth curves with R. Journal of Statistical Software 33, 1–21.
Vaas, L. A. I., Sikorski, J., Michael, V., Goeker, M., Klenk H.-P. 2012 Visualization and curve parameter estimation strategies for efficient exploration of Phenotype Microarray kinetics. PLoS ONE 7, e34846.
grofit::grofit parallel::detectCores
Other aggregation-functions:
set_spline_options
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | # OPM method
# Run a fast estimate of A and AUC without bootstrapping
copy <- do_aggr(vaas_1, method = "opm-fast", boot = 0,
options = list(as.pe = "pe"))
aggr_settings(vaas_1)
aggr_settings(copy)
stopifnot(has_aggr(vaas_1), has_aggr(copy))
# Compare the results to the ones precomputed with grofit
# (1) A
a.grofit <- aggregated(vaas_1, "A", ci = FALSE)
a.fast <- aggregated(copy, "A", ci = FALSE)
plot(a.grofit, a.fast)
stopifnot(cor.test(a.fast, a.grofit)$estimate > 0.999)
# (2) AUC
auc.grofit <- aggregated(vaas_1, "AUC", ci = FALSE)
auc.fast <- aggregated(copy, "AUC", ci = FALSE)
plot(auc.grofit, auc.fast)
stopifnot(cor.test(auc.fast, auc.grofit)$estimate > 0.999)
## Not run: # Without confidence interval (CI) estimation
x <- do_aggr(vaas_1, boot = 0, verbose = TRUE)
aggr_settings(x)
aggregated(x)
# Calculate CIs with 100 bootstrap (BS) replicates, using 4 cores
# (do not try to use > 1 core on Windows)
x <- do_aggr(vaas_1, boot = 100, verbose = TRUE, cores = 4)
aggr_settings(x)
aggregated(x)
## End(Not run)
# matrix method
(x <- do_aggr(measurements(vaas_1)))[, 1:3]
stopifnot(identical(dim(x), c(3L, 96L)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.