fitSynNLS: Fitting synthesis curve using NLS algorithm

Description Usage Arguments Details Value Examples

Description

fit protein synthesis curve using NLS algorithm

Usage

1
2
3
4
fitSynNLS(x, t, tcc = Inf, A = NULL, B = NULL, ks = NULL,
  fitIndividual = FALSE, par.init = list(A = 0.9, B = 0.1, ks = 0.04),
  par.lower = c(A = 0, B = 0, ks = 0), par.upper = c(A = 1, B = 1, ks = 10),
  message = TRUE)

Arguments

x

A numeric vector

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

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

ks

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

fitIndividual

A logical value, whether each individual row should also be fitted. Only used when x is an object of class matrix

par.init

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

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 "ks".

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 "ks".

message

A logical value to indicated if any message should be printed

Details

More information about the fitted model could be find in fitNLSModels.

Value

a vector of optimized parameters, including A, B, ks, confidence intervals (2.5 mean square error and r-square values. In addition, if individual rows are fitted, the object also contains an attribute stores parameters fitted on each individual row.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# synthesi curve
tp <- c(0, 1, 2, 4, 8, 16, 32, 64)
ratios <- synCurve(A=0.85, B = 0.1, kd=0.5, tcc=Inf, t = tp) + rnorm(length(tp), sd = 0.05)

r <- fitSynNLS(ratios, t = tp, tcc = Inf)
plotCurve(ratios, tp, tcc = Inf, A = r[["A"]], B = r[["B"]], k = r[["ks"]],
          add = FALSE, curve = "syn", err.x = log(2)/r[c("ci025", "ci975")],
          err.y = synCurve(A = r[["A"]], B = r[["B"]], kd = r[["ks"]], t = log(2)/ r[["ks"]], tcc = Inf))


ratio2 <- rbind(p1 = ratios + rnorm(length(ratios), sd = 0.2),
                p2 = ratios + rnorm(length(ratios), sd = 0.2))
r.mat <- fitSynNLS(ratio2, t = tp, tcc = Inf)
plotCurve(ratio2, rep(tp, 2), tcc = Inf, A = r.mat[["A"]], B = r.mat[["B"]], k = r.mat[["ks"]],
          add = FALSE, curve = "syn", err.x = log(2)/r.mat[c("ci025", "ci975")],
          err.y = degCurve(A = r.mat[["A"]], B = r.mat[["B"]], kd = r.mat[["ks"]],
                           t = log(2)/ r.mat[["ks"]], tcc = Inf))

r.mat.ind <- fitSynNLS(ratio2, t = tp, tcc = Inf, fitIndividual = TRUE)
plotCurve.comb(x = r.mat.ind, t = tp, tcc = Inf, curve = "syn")

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