fitNLSModels: Fitting protein degradation/synthesis curves using nonlinear...

Description Usage Arguments Details Value Examples

Description

Main function to be called by users to fit protein degradation or synthesis curves using nonlinear least square methods (NLS).

Usage

1
2
3
fitNLSModels(x, f, t, tcc = Inf, type = c("deg", "syn"), A = NULL,
  B = NULL, par.init = list(A = 0.9, B = 0.1, k = 0.04), par.lower = c(A =
  0, B = 0, k = 0), par.upper = c(A = 1, B = 1, k = 10), ncore = 1)

Arguments

x

A numeric matrix where rows are variables (e.g. peptides or proteins) and columns are different time points.

f

A factor or vector, its length should be the same as the number of rows in x. It is possible to fit a single model using multiple lines, this is useful, for example, when multiple lines are from the peptide or protein. This is implemented by multiple rows in x corresponds to the same with in f.

t

The time point (hours)

tcc

The doubling time of cells. By default this value is Inf, which means the cells are in steady state.

type

which curve should be fitted, should be either "deg" (degradation curve) or "syn" (synthesis curve)

A

optinal argument for fixed A, if this argument is given, "A" won't be optimized

B

optional argument for fixed B, if this argument is given, "B" won't be optimized

par.init

The initial values of parameters to be optimized, it should be list of three elements names as "A", "B" and "k".

par.lower

The lower boundary of parameters to be optimized, it should be a numeric values with length 3 and named as "A", "B" and "k".

par.upper

The upper boundary of parameters to be optimized, it should be a numeric values with length 3 and named as "A", "B" and "k".

ncore

the number of cores to be used, passed to mclapply

Details

The function fit the following models: for degradation for synthesis Using nls algorithm.

Value

A list of three elmenets

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
tp <- c(0, 1, 2, 4, 8, 16, 32, 64)
A <- runif(5, min = 0.75, max = 0.95)
B <- runif(5, min = 0.1, max = 0.15)
kd <- runif(5, min = 0.05, max = 0.1)
ds <- mapply(function(A, B, kd) {
  degCurve(A=A, B=B, kd=kd, tcc=Inf, t = tp) + rnorm(length(tp), sd = 0.03)
}, A, B, kd)
ds <- t(ds)
ds <- rbind(ds, runif(8, 0, 1))

rf <- c("p1", "p2", "p2", "p3", "p3", "p3")

ss <- fitNLSModels(x = ds, f = rf, t = tp, tcc = Inf, type = "deg",
                   par.init = list(A=0.8, B=0.2, kd=0.04),
                   par.lower=c(A=0, B=0, kd=0),
                   par.upper=c(A=1, B=1, kd=10))

plotCurve.comb(x = ss$list$p1, t = tp, tcc = Inf, curve = "deg")
plotCurve.comb(x = ss$list$p2, t = tp, tcc = Inf, curve = "deg")
plotCurve.comb(x = ss$list$p3, t = tp, tcc = Inf, curve = "deg")


ds2 <- mapply(function(A, B, kd) {
  synCurve(A=A, B=B, kd=kd, tcc=Inf, t = tp) + rnorm(length(tp), sd = 0.03)
}, A, B, kd)
ds2 <- t(ds2)
ds2 <- rbind(ds2, runif(8, 0, 1))


ss2 <- fitNLSModels(x = ds2, f = rf, t = tp, tcc = Inf, type = "syn",
                    par.init = list(A=0.8, B=0.2, ks=0.04),
                    par.lower=c(A=0, B=0, ks=0),
                    par.upper=c(A=1, B=1, ks=10))

plotCurve.comb(x = ss2$list$p1, t = tp, tcc = Inf, curve = "syn")
plotCurve.comb(x = ss2$list$p2, t = tp, tcc = Inf, curve = "syn")
plotCurve.comb(x = ss2$list$p3, t = tp, tcc = Inf, curve = "syn")

mengchen18/proturn documentation built on May 30, 2019, 4:37 p.m.