plotResponseSurface {BIGL} | R Documentation |
Plot the 3-dimensional response surface predicted by one of the null
models. This plot allows for a visual comparison between the null
model prediction and observed points. This function is mainly used
as the workhorse of plot.ResponseSurface
method.
plotResponseSurface(
data,
fitResult = NULL,
transforms = fitResult$transforms,
predSurface = NULL,
null_model = c("loewe", "hsa", "bliss", "loewe2"),
colorPalette = c("blue", "grey70", "red"),
colorBy = "none",
colorPoints = c("black", "sandybrown", "brown", "white"),
breaks = c(-Inf, 0, Inf),
radius = NULL,
logScale = TRUE,
colorfun = median,
zTransform = function(x) x,
add = FALSE,
main = "",
legend = TRUE,
xat = "actual",
yat = "actual",
plotfun = NULL,
...
)
data |
Dose-response dataframe. |
fitResult |
Monotherapy (on-axis) model fit, e.g. produced by
|
transforms |
Transformation functions. If non-null, |
predSurface |
Vector of all predicted responses based on
|
null_model |
If |
colorPalette |
Vector of color names for surface |
colorBy |
This parameter determines values on which coloring is based
for the 3-dimensional surface. If matrix or a data frame with |
colorPoints |
Colors for off-axis and on-axis points. Character vector of length four with colors for 1) off-axis points; 2) on-axis points of the first drug (i.e. second drug is dosed at zero); 3) on-axis points of the second drug; 4) on-axis points where both drugs are dosed at zero. |
breaks |
Numeric vector with numerical breaks. To be used in conjunction
with |
radius |
Radius of spheres. If missing, an educated guess based on number of digits in average effect will be made. |
logScale |
Draw doses on log-scale (setting zeroes to be finite constant) |
colorfun |
If replicates in |
zTransform |
Optional transformation function for z-axis. By default, identity function is used. |
add |
Add the predicted response surface to an existing plot. Will not
draw any points, just the surface. Must be called after another call to
|
main |
Fixed non-moving title for the 3D plot |
legend |
Whether legend should be added |
xat |
x-axis ticks: "pretty", "actual" or a numeric vector |
yat |
y-axis ticks: "pretty", "actual" or a numeric vector |
plotfun |
If replicates for dose combinations in |
... |
Further arguments to format axis labels |
Title for the plot and legend are drawn as bitmaps and do not rotate with the rest of the plot. Since they are bitmaps, they do not scale properly, hence resizing window will result in unappealing visuals. For them to look properly, it suffices to set the appropriate RGL window size and rerun the plotting command.
Plot is shown on a rgl device.
## Not run:
data <- subset(directAntivirals, experiment == 1)
## Data must contain d1, d2 and effect columns
fitResult <- fitMarginals(data)
data_mean <- aggregate(effect ~ d1 + d2, data = data[, c("d1", "d2", "effect")],
FUN = mean)
## Construct the surface from marginal fit estimates based on HSA
## model and color it by mean effect level
plotResponseSurface(data, fitResult, null_model = "hsa",
colorBy = data_mean, breaks = 10^(c(0, 3, 4, 6)),
colorPalette = c("grey", "blue", "green"))
## Response surface based on Loewe additivity model and colored with
## rainbow colors. Legend will not be displayed in any case.
plotResponseSurface(data, fitResult, null_model = "loewe",
colorBy = "colors", colorPalette = rainbow(6))
## End(Not run)