Description Usage Arguments Details Value Examples
View source: R/HTDoseResponseCurve.R
This function calculates the AUC at a single concentration
across all timepoints. This is very distinct from a typical dose response
curve, which can be used to calculate the AUC at a single timepoint across
multiple concentrations. For that purpose, use fit_DRC
.
1 2 | timecourse_AUC_ratio(D, treatments, sample_types, concentrations,
summary_method)
|
D |
experiment dataset with columns matching the output of
|
treatments |
which treatments to calculate |
sample_types |
samples on which to calculate |
concentrations |
which concentrations to draw |
summary_method |
mean or median |
AUC for a single sample type/treatment condition across the whole timecourse is calculated using raw data normalized by the vehicle control specified by the user when the dataset was created. AUC is calculated by connecting the normalized data points and then using the trapezoids method for AUC implemented in pracma::trapz.
For each treatment, in each concentration,
AUC_v= AUC( raw vehicle matched plate_id )
AUC_sample1 = AUC( raw sample1 after treatment ) / AUC_v
AUC_sample2 = AUC( raw sample2 after treatment ) / AUC_v
AUC ratio = AUC_sample1 / AUC_sample2
Return value is a list. The matrix in the list contains one column for each AUC value followed by one column for each AUC ratios of sample_types[1] / sample_types[2]. The concentrations vector in the list indicates the treatment concentration in each column. The sample_types vector in the list indicates the sample type if the column is a single sample AUC, or the word "ratio" if the value in the column is an AUC ratio.
list( AUC matrix, concentrations, sample_types )
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Create a dataset with two drugs normalized against DMSO, tested at a single
# concentration. Timepoints are 0, 12, 24, 36, 48 hours. drug1 affected
# line1 cells at this concentration, while drug2 affected line2 cells.
ds = create_dataset(
sample_types= rep( c("line1", "line2"), 15),
treatments = c( rep("DMSO", 10), rep("drug1", 10), rep("drug2", 10)),
concentrations = c( rep(0, 10), rep(200, 20) ),
hours = rep( c(0,0,12,12,24,24,36,36,48,48), 3),
values = c(10,10,15,15,30,25,60,50,80,65,
10,10,12,15,22,28,26,48,30,60,
10,10,15,12,30,11,60,13,80,9),
plate_id = "plate_1",
negative_control = "DMSO")
tc=timecourse_AUC_ratio(ds,
treatments=c("drug1", "drug2"),
sample_types=c("line1", "line2"),
concentrations=c(0, 200),
summary_method="mean")
# create a data frame from individual list components
data.frame( sample_type = tc$sample_types,
concentration = tc$concentrations,
t(tc$AUC),
row.names=1:length(tc$sample_types),
stringsAsFactors=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.