timecourse_relative_grid: Calculate fold-change in Dose Response Curve AUC and EC50 at...

Description Usage Arguments Value Examples

View source: R/HTDoseResponseCurve.R

Description

This is a convenience function that reproduces analysis that can also be performed using the fit_statistics function. The rationale for using this method is it contains some logic for screening out results where:

  1. the P value for ANOVA testing whether observations are significantly different from each other is below a given threshold

  2. at least one sample type was observed with a normalized value below a given threshold (e.g. achieved a SF50)

  3. the log10(difference in AUC) exceeds a threshold

Usage

1
2
timecourse_relative_grid(D, sample_types, fct, max_Pval = 1, min_obs = Inf,
  min_log10_EC50_diff = 0)

Arguments

D

experiment dataset with columns matching the output of combine_data_and_map

sample_types

vector of two sample types to compare

fct

Non-linear function to fit, defaults to four variable LL.4 model that estimates slope, upper asymptote, lower asymptote, and EC50. To fix lower asymptote at 1, pass drc::LL.3(). To fix lower asympotote ant 1 and upper asymptote at 0, pass drc::LL.2(). For a list of available functions, see drc::getMeanFunctions(). To pass a function you must load the drc package in your R session.

max_Pval

mark comparisons where fit P_value exceeds this as NA

min_obs

mark comparisons where neither sample type has an observation below this value to be NA

min_log10_EC50_diff

mark comparisons where the log10( difference in AUC ) at that timepoint is less than this value to be NA

Value

list of matrixes for fold-change in AUC, fold-change in EC50, P value for ANOVA, sample AUC, and sample EC50. Matrix X-axis is hours and Y-axis is treatments.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# set up two timepoints; this function is more useful when there are many 
# drugs and multiple timepoints
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,77,76,79,92,93,91,66,65,67,77,76,74,
         36,35,35,57,56,55,22,25,24,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 = c( rep(24, length(values)/2), rep(48, length(values)/2))
treatments = rep(treatments, 2)
concentrations = rep(concentrations, 2)
sample_types = rep(sample_types, 2)
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")
# calculate grid
timecourse_relative_grid(ds, c("line1", "line2"), drc::LL.3() )

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