fitDegNLS: Fitting protein degradation curve using NLS algorithm

Description Usage Arguments Value Methods (by class) Examples

Description

Fitting protein degradation curve using NLS algorithm

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fitDegNLS(x, ...)

## S4 method for signature 'vector'
fitDegNLS(x, t, tcc = Inf, A = NULL, B = NULL,
  kd = NULL, par.init = list(A = 0.9, B = 0.1, kd = 0.04), par.lower = c(A
  = 0, B = 0, kd = 0), par.upper = c(A = 1, B = 1, kd = 10), message = TRUE,
  kd2ks = FALSE)

## S4 method for signature 'matrix'
fitDegNLS(x, t, tcc = Inf, A = NULL, B = NULL,
  kd = NULL, fitIndividual = FALSE, par.init = list(A = 0.9, B = 0.1, kd =
  0.04), par.lower = c(A = 0, B = 0, kd = 0), par.upper = c(A = 1, B = 1, kd
  = 10), message = TRUE, kd2ks = FALSE)

Arguments

x

a numeric matrix or vector. If x is a matrix, the rows are variables (e.g. peptides, proteins) and columns are different time points.

...

other arguments

t

The time points given in HOURS.

tcc

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

A

optinal argument for pre-spicified A, if this argument is given, "A" won't be optimized.

B

optional argument for pre-spicified B, if this argument is given, "B" won't be optimized.

kd

optional argument for pre-spicified kd, if this argument is given, "kd" 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 "kd".

par.lower

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

par.upper

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

message

A logical value to indicate if any messages should be printed

kd2ks

Should not be changed by user. A logical value, whether the input should be converted to fit synthesis curve.

fitIndividual

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

Value

a vector of optimized parameters, including A, B, kd, confidence intervals (2.5 In addition, if individual rows are fitted, the object also contains an attribute stores parameters fitted on each individual row.

Methods (by class)

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
# simulating data
tp <- c(0, 1, 2, 4, 8, 16, 32, 64)
ratios <- degCurve(A=0.85, B = 0.1, kd=0.5, tcc=Inf, t = tp) + rnorm(length(tp), sd = 0.05)

#' vector input
r <- fitDegNLS(ratios, t = tp, tcc = Inf)
plotCurve(ratios, tp, tcc = Inf, A = r[["A"]], B = r[["B"]], k = r[["kd"]],
          add = FALSE, curve = "deg", err.x = log(2)/r[c("ci025", "ci975")],
          err.y = degCurve(A = r[["A"]], B = r[["B"]], kd = r[["kd"]], t = log(2)/ r[["kd"]], tcc = Inf))

#' matrix input, fit a single model
ratio2 <- rbind(p1 = ratios + rnorm(length(ratios), sd = 0.4),
                p2 = ratios + rnorm(length(ratios), sd = 0.4))
r.mat <- fitDegNLS(ratio2, t = tp, tcc = Inf)
plotCurve(x = ratio2, t = rep(tp, nrow(ratio2)),
          tcc = Inf, A = r.mat[["A"]], B = r.mat[["B"]], k = r.mat[["kd"]],
          add = FALSE, curve = "deg", err.x = log(2)/r.mat[c("ci025", "ci975")],
          err.y = degCurve(A = r.mat[["A"]], B = r.mat[["B"]], kd = r.mat[["kd"]],
                           t = log(2)/ r.mat[["kd"]], tcc = Inf))

#' matrix input, fit a single model, in addition, each individual row should also be fitted
r.mat.ind <- fitDegNLS(ratio2, t = tp, tcc = Inf, fitIndividual = TRUE)
plotCurve.comb(x = r.mat.ind, t = tp, tcc = Inf,
               leg.vec = c(p1="peptide 1", p2 = "peptide 2"), curve = "deg")

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