plot.HT_fit: Plot a dose response curve from a HTfit object

Description Usage Arguments Value See Also Examples

View source: R/plot.R

Description

If the curve cannot be fit (meaning that the optimization method used by the drm() method from the drc package failes to converge) then the summarized points will be plotted without a curve connecting them.

Usage

1
2
3
4
## S3 method for class 'HT_fit'
plot(x, ..., bar_multiple = 2, summary_method = "mean",
  show_EC50 = FALSE, show_legend = FALSE, show_x_log_tics = TRUE,
  show_x_exponent = TRUE, log_axis_x = TRUE)

Arguments

x

HTfit object

...

standard parameters for plot function

bar_multiple

multiplier for standard error bars, default 2

summary_method

summary method for points to plot in timecourse, one of ("mean", "median"), defaults "mean"

show_EC50

show dotted vertical lines at EC50 values if they are fit, default FALSE

show_legend

show a legend, default FALSE

show_x_log_tics

if axes==TRUE and this parameter is TRUE, draw tics between each power of 10 scaled appropriately. If axes==TRUE and this parameter is FALSE, omit ticks between powers of 10. Default TRUE.

show_x_exponent

If axes==TRUE and this parameter is TRUE, show labels on X axis as 10^2, 10^3, ... . If axes==TRUE and this parameter is FALSE, show labels on X axis as an exponent (2, 3, ... ). Default TRUE.

log_axis_x

logical. If TRUE, X axis is to be logarithmic; if FALSE, X axis is original scale. Default is TRUE.

Value

none

See Also

fit_DRC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
sample_types = rep( c(rep("line1",3), rep("line2",3)), 5)
treatments = c(rep("DMSO",6), rep("drug",24))
concentrations = c( rep(0,6),rep(200,6), rep(500,6),rep(1000,6),rep(5000,6))
values=c(100,99,100,90,91,92,99,97,99,89,87,88,86,89,88,56,59,58,66,65,67,
         25,23,24,42,43,46,4,5,9)
hours = rep(48, length(values))
plate_id = "plate_1"
ds = create_dataset( sample_types=sample_types, treatments=treatments, 
                     concentrations=concentrations, hours=hours, 
                     values=values, plate_id=plate_id, 
                     negative_control = "DMSO")
library(drc)
# Fit model using three-parameter log-logistic function
fit_1=fit_DRC(ds, sample_types=c("line1", "line2"), treatments=c("drug"), 
        hour = 48, fct=drc::LL.3() )
plot(fit_1)
plot(fit_1, show_EC50=FALSE, show_legend=FALSE, lwd=3,col=c("black", "gold"),
     xlim=c(0, 1e4), xlab="concentration nM", 
     ylab="surviving fraction")
legend(1.5, 0.3, c("Line 1", "Line 2"), col=c("black", "gold"), pch=15)

DavidQuigley/HTDoseResponseCurve documentation built on Jan. 23, 2021, 5:10 a.m.