View source: R/03_alignReplicates.R
alignReplicates | R Documentation |
The function deals primarily with time-course data of different targets which have been measured under different experimental conditions and whose measured values might be on a different scale, e.g. because of different amplification. The algorithm determines the different scaling and estimates the time-course on a common scale.
alignReplicates(
data,
model = NULL,
errorModel = NULL,
biological = NULL,
scaling = NULL,
error = NULL,
fitLogscale = TRUE,
normalize = TRUE,
averageTechRep = FALSE,
verbose = FALSE,
namesFactored = TRUE,
normalizeInput = TRUE,
outputScale = "linear",
iterlim = 100
)
data |
data.frame containing the the data to be scaled. Usualy the
output of readWide is used. Obligatory are the columns |
model |
character defining the model by which the values in
|
errorModel |
character defining a model for the standard
deviation of a value, e.g. "sigma0 + value * sigmaR". This model
can contain parameters, e.g. "sigma0" and "sigmaR", or numeric
variables from |
biological |
two-sided formula of the form
|
scaling |
two-sided formula of the form
|
error |
two-sided formula of the form
|
fitLogscale |
logical, defining if the parameters are fitted on a log scale. Computational reasons. |
normalize |
logical indicating whether the biological effect parameter should be normalized to unit mean. |
averageTechRep |
logical, indicates if the technical replicates should be averaged |
verbose |
logical, print out information about each fit |
namesFactored |
logical, indicates if the |
normalizeInput |
logical, if TRUE the input will be normalized before scaling, helpful if convergence fails because the data varies for to many orders of magnitude. |
iterlim |
numerical argument passed to trust. |
ciProfiles |
Logical, if |
Alignment of time-course data is achieved by an alignment model which explains the observed data by a function mixing fixed effects, usually parameters reflecting the "underlying" time-course, and latent variables, e.g. scaling parameters taking account for effects like different amplification or loading, etc. Depending on the measurement technique, the data has constant relative error, or constant absolute error or even a combination of those. This error is described by an error function. The error parameters are usually global, i.e. the same parameter values are assumed for all data points.
Object of class aligned
, i.e. a data frame of the
alignment result containing an attribute "outputs":
a list of data frames
data.frame with the original column names plus the column
sigma
. Each set of unique biological effects i.e. biological
different condition (e.g. time point, target and treatment) has one set
of value
and sigma
. The values are the estimated true
values i.e. the determined biological parameters. The errors in the
sigma
column are estimated by employing the fisher information
to quantify the uncertainty of the respective fit. Both, the value and
its error are on the common scale.
The original measurements scaled to common scale by applying inverse model. The errors are the result of the evaluation of the error model and then also scaled to common scale by use of Gaussian error propagation.
Original data with value
replaced by the prediction
(evaluation of the model with the fitted parameters), and sigma
from the evaluation of the error model. Both are on the original scale.
The original data as passed as data
.
The original data but with added columns containing the estimated parameters
Parameter table with the columns: name
: the name of
the current target, level
: the pasted unique set of effects
(biological, scaling or error), parameter
: the parameter
identifier as defined in the (error) model, value
and sigma
containing the determined values and corresponding errors, nll
:
twice the negative log-likelihood of the fit, noPars
and
noData
containing the number of parameters and data points for
the respected fit. This list entry also has two attributes: value
containing the final value (residual sum of squares) passed to
trust::trust by the objective function and df
the degrees
of freedom of the fitting process.
Names of the columns containing the biological effects
Names of the columns containing the scaling effects
Names of the columns containing the error effects
The estimated parameters are returned by the attribute "parameters".
readWide to read data in a wide column format and
get it in the right format for alignReplicates
.
## Get example dataset
exampleWB <- system.file(
"extdata", "INFdata_WB_wide.csv",
package = "blotIt"
)
## read in example data by use of 'readWide()'
exampleData <- readWide(exampleWB, description = seq_len(3))
## execute alignReplicates
out <- alignReplicates(
data = exampleData,
model = "yi / sj",
errorModel = "value * sigmaR",
biological = yi ~ name + time + condition,
scaling = sj ~ name + experiment,
error = sigmaR ~ name,
normalize = TRUE,
averageTechRep = FALSE,
verbose = FALSE,
normalizeInput = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.