plotCurve: Curve plotting function

View source: R/rendering.R

plotCurveR Documentation

Curve plotting function

Description

This function takes in a set of data points, curve parameters, and an equation and plots the data

Usage

plotCurve(curveData, params, fitFunction, paramNames = c("ec50", "min", "max",
  "slope"), drawIntercept = "ec50", outFile = NA, ymin = NA,
  logDose = FALSE, logResponse = FALSE, ymax = NA, xmin = NA,
  xmax = NA, height = 300, width = 300, showGrid = FALSE,
  showLegend = FALSE, showAxes = TRUE, drawCurve = TRUE,
  drawFlagged = FALSE, connectPoints = FALSE, plotMeans = FALSE,
  drawStdDevs = FALSE, addShapes = FALSE, labelAxes = FALSE,
  curveXrn = c(NA, NA), mostRecentCurveColor = NA, axes = c("x", "y"),
  ...)

Arguments

curveData

a data frame with the points with column names curveId, dose, response, flag

params

the set of parameters used to enumerate the curve

outFile

file to plot image to, if not specified then the function plots to graphic device

ymin

specify the ymin axes location

logDose

specify if x axis is in log space

logResponse

specify if y axis is in log space

ymax

specify the ymax axes location

xmin

specify the xmin axes location

xmax

specify the xmax axes location

height

height of the plot in pixels

width

width of the plot in pixels

showGrid

adds a grid to the plot

showLegend

shows a legend with curve ids on the right hand side of the plot

showAxes

turns axes on or off

drawCurve

turn the curve drawing on and off

connectPoints

will draw a line between the means of each mean X - Y

plotMeans

will plot the mean Y given a given X

drawStdDevs

will plot the Standard Deviations for each dose response combination

drawCurve

turn the curve drawing on and off

Value

If outFile is specified, then the function prints an image to the out file, if outFile is not specified, then then an image is plotted to a graphics device

Examples

LL4 <- 'min + (max - min)/((1 + exp(-hill * (log(x/ec50))))^1)'
data(curveData)
params <- curveData$parameters
curveData <- curveData$points
plotCurve(curveData, params, paramNames = c("ec50", "min", "max", "hill"), LL4, outFile = NA, ymin = NA, logDose = TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE)
plotCurve(curveData, params, paramNames = c("ec50", "min", "max", "hill"), LL4, outFile = NA, ymin = NA, logDose = TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = TRUE)
plotCurve(curveData, params, paramNames = c("ec50", "min", "max", "hill"), LL4, outFile = NA, ymin = NA, logDose = TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = TRUE, connectPoints = TRUE, drawCurve = FALSE)
plotCurve(curveData, params, paramNames = c("ec50", "min", "max", "hill"), LL4, outFile = NA, ymin = NA, logDose = TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = TRUE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = TRUE)

#Ki Data (using raw data)
data(kiData)
params <- kiData$parameters
points <- kiData$points
paramNames <- c("Top", "Bottom", "HotNM", "HotKDNM", "Log10Ki")
KiFCT <- 'Bottom + (Top-Bottom)/(1+10^(x-log10((10^Log10Ki)*(1+HotNM/HotKDNM))))'
plotCurve(points, params, KiFCT, paramNames, drawIntercept= "Log10Ki", outFile = NA, ymin = NA, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE)

#PK Curves
#PO
data(poPKCurveData)
params <- poPKCurveData$parameters
curveData <- poPKCurveData$points
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = FALSE)
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = FALSE, addShapes = TRUE)

#IV
data(ivPKCurveData)
params <- ivPKCurveData$parameters
curveData <- ivPKCurveData$points
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = FALSE)
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = FALSE, addShapes = TRUE)

#IV Overlay
data(overlayIVPKCurveData)
params <- overlayIVPKCurveData$parameters
curveData <- overlayIVPKCurveData$points
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, drawStdDevs = FALSE)

#PO IV
data(poIVPKCurveData)
params <- poIVPKCurveData$parameters
curveData <- poIVPKCurveData$points
plotCurve(curveData, params, paramNames = NA, outFile = NA, ymin = NA, logDose = FALSE, logResponse=TRUE, ymax = NA, xmin = NA, xmax = NA, height = 300, width = 300, showGrid = FALSE, showLegend = FALSE, showAxes = TRUE, plotMeans = FALSE, connectPoints = TRUE, drawCurve = FALSE, addShapes = TRUE, drawStdDevs = TRUE)

mcneilco/racas documentation built on June 15, 2025, 5:20 a.m.