plotCurve.comb: plot curve from combined fitting

Description Usage Arguments Value Examples

Description

plot curve from combined fitting

Usage

1
2
3
plotCurve.comb(x, t, leg.vec = NULL, curve = NULL, tcc = Inf,
  add = FALSE, pch = 20, lty = 1, legend = TRUE, err = TRUE,
  main = "", leg.cex = 1)

Arguments

x

- an element of list returned by fitDegNLS or fitSynNLS

t

time points (hours)

leg.vec

a character vector for legend, the name of the vector should be the same as in x

curve

which curve want to draw. If it's not NULL, should be either "degradation" or "synthesis"

tcc

doubling time of cell lines

add

if the plot should be added on top of another plot

pch

passed to plot

lty

passed to line

legend

logical value, whether legend should be generated

err

a logical value, whether error bar should be plotted

main

the main title of plot

leg.cex

the cex of points in legend

Value

no value to be returned

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
# see \code{fitSynNLS}, \code{fitDegNLS}, \code{fitNLSModels}
# 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.