alignME: Align time-course data based on an Mixed-Effects alignment...

Description Usage Arguments Details Value See Also Examples

View source: R/blotIt2.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
alignME(
  data,
  model = "ys/sj",
  errmodel = "value*sigmaR",
  fixed = ys ~ Condition,
  latent = sj ~ Experiment,
  error = sigmaR ~ 1,
  log = TRUE,
  normalize = TRUE,
  reduce = FALSE,
  verbose = FALSE,
  normalize_input = T
)

Arguments

data

data frame with obligatory columns "name", "time" and "value". Additionally, data should have further columns, e.g. characterizing experimental conditions (the fixed effects) and sources of variance between data of the same experimental condition (the latent variables). Alternatively, object of class aligned.

model

character defining the model by which the values in data can be described, e.g. "ys/sj"

errmodel

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 data, e.g. "value" or "time".

fixed

two-sided formula of the form par1+par2+... ~ name1+name2+... where "par1, par2, ..." are parameters contained in model, e.g. "ys", and "name1, ..." refers to variables in data, e.g. "Condition". The parameters "par1, ..." are determined specific to the levels of "name1, ...".

latent

two-sided formula of the form par1+par2+... ~ name1+name2+... where "par1, par2, ..." are parameters contained in model, e.g. "sj", and "name1, ..." refers to variables in data, e.g. "Experiment".

error

two-sided formula of the form par1+par2+... ~ name1+name2+... where "par1, par2, ..." are parameter containd in error, e.g. "sigma0" and "sigmaR", and "name1, ..." refers to variables in data. If the same values of "par1, ..." should be assumed for all data, "name1" can be "1".

log

logical indicating whether all parameters are fitted on log-scale.

normalize

logical indicating whether the fixed effect parameter should be normalized to unit mean.

verbose

logical, print out information about each fit

normalize_input

logical, if TRUE the input will be normalized before scaling. see splitData.

Details

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.

Value

Object of class aligned, i.e. a data frame of the alignment result containing an attribute "outputs": a list of data frames

prediction

original data with value and sigma replaced by the predicted values and sigmas

scaled

original data with the values transformed according to the inverse model, i.e. model solved for the first parameter in fixed, e.g. "ys". Sigma values are computed by error propagation from the inverse model equation.

aligned

the reduced data with the fixed effects and their uncertainty, only. The result of the alignment algorithm.

original

the original data

parameter

original data augmented by parameter columns. Parameters in each row correspond to the levels of fixed, latent or error as passed to alignME(). Used for initialization or parameter values when refitting with modified model.

The estimated parameters are returned by the attribute "parameters".

See Also

read.wide to read data in a wide column format and get it in the right format for alignME(). plot1, plot2, plot3, plot4 to plot the result of alignME.

Examples

 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## Not run: 

data(MAPK)

## Run alignME with standard arguments
out <- alignME(data = MAPK,
               model = "ys/sj",
               errmodel = "sigmaR*value",
               fixed = ys~Condition,
               latent = sj~Experiment,
               error = sigmaR~1,
               log = TRUE)
plot1(out)
plot2(out)
plot3(out)

## Assume equal variance on all gels
out <- alignME(data = MAPK,
               model = "ys/sj",
               errmodel = "sigma0",
               fixed = ys~Condition,
               latent = sj~Experiment,
               error = sigma0~1,
               log = TRUE)
plot2(out)

## Estimate with offset
out <- alignME(data = MAPK,
               model = "ys/sj+bj",
               errmodel = "sigmaR*value",
               fixed = ys~Condition,
               latent = sj+bj~Experiment,
               error = sigmaR~1,
               log = TRUE)
plot2(out)

## Align data on log-scale
logMAPK <- MAPK
logMAPK$value <- log(MAPK$value)
out <- alignME(data = logMAPK,
               model = "log(ys/sj)",
               errmodel = "sigmaR",
               fixed = ys~Condition,
               latent = sj~Experiment,
               error = sigmaR~1,
               log = TRUE)
plot1(out)

## Align data on log-scale with mixed error model
logMAPK <- MAPK
logMAPK$value <- log(MAPK$value)
out <- alignME(data = logMAPK,
               model = "log(ys/sj)",
               errmodel = "sigmaR + sigma0*exp(-value)",
               fixed = ys~Condition,
               latent = sj~Experiment,
               error = sigmaR+sigma0~1,
               log = TRUE)
plot1(out)


## End(Not run)

dkaschek/blotIt2 documentation built on July 10, 2021, 5:37 a.m.