fit_DRC: Attempt to fit a dose-response curve from the dataset and...

Description Usage Arguments Details Value Non-linear function for curve fitting Examples

View source: R/HTDoseResponseCurve.R

Description

Given a data frame of measurements generated by combine_data_and_map or matching the format generated by that function, fit a dose-response curve for each unique sample_type/treatment specified by the sample_types and treatments parameters. A curve will be fit for each sample in sample_types, at each treatment in treatments.

Usage

1
2
fit_DRC(D, fct, sample_types = NA, treatments = NA, hour = NA,
  concentration_column = "concentration", treatment_column = "treatment")

Arguments

D

experiment dataset with columns matching the output of combine_data_and_map

fct

Non-linear function to fit, e.g. drc::LL.3(). See summary.

sample_types

Which sample types (e.g. distinct cell lines) of the sample types in D will be fit. If NA, fit all sample types. Default is NA.

treatments

Which treatments (e.g. drugs) of the treatments in D will be fit. If NA, fit all treatments. Default is NA.

hour

The hour in experiment dataset D at which to fit. If NA, combine all timepoints.

concentration_column

The name of the column in D to use for the concentration values in the curve. For non-synergy experiments, use the default "concentration". For synergy experiments, specify either of concentration, concentration_2.

treatment_column

The name of the column in D to use for the treatment values in the curve. For non-synergy experiments, use the default "treatment". For synergy experiments, specify either of treatment, treatment_2.

Details

If the data are from a synergy experiment, you must specify the concentration to use for the curve in the concentration_column parameter as one of concentration, concentration_2.

Value

A HT_fit object

Non-linear function for curve fitting

Curve fitting is performed by the drm() function in the drc library. To fit the curve, you need to select a non-linear function. To estimate the slope, upper asymptote, lower asymptote, and EC50, pass drc::LL.4(). To fix the lower asymptote at 1 and estimate the other parameters, pass drc::LL.3(). To fix the upper asympotote at 1 and the lower asymptote at 0, pass drc::LL.2. For a list of available functions, see drc::getMeanFunctions().

To call this function you must load the drc package in your R session.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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_DRC(ds, sample_types=c("line1", "line2"), treatments=c("drug"), 
        hour = 48, fct=drc::LL.3() )
 
# Fit model using four-parameter log-logistic function
fit_DRC(ds, sample_types=c("line1", "line2"), treatments=c("drug"), 
        hour = 48, fct=drc::LL.4() )

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