Description Usage Arguments Details Value Examples
View source: R/IDAPredict.ControlPlusOne.R
This function creates efficacy predictions for combinations of a control therapy + 1 additional drug using monotherapy efficacy data and the assumptions of independent drug action. When data is available for multiple concentrations of the drug to add, efficacy predictions are made for all possible concentration combinations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | IDAPredict.ControlPlusOne(
Monotherapy_Data,
Cell_Line_Name_Column,
Drug_Name_Column,
Drug_Concentration_Column,
Efficacy_Column,
LowerEfficacyIsBetterDrugEffect,
Efficacy_Metric_Name = "Efficacy",
Control_Treatment_Drugs,
Control_Treatment_Drug_Concentrations,
Drug_to_Add,
Calculate_Uncertainty = FALSE,
Efficacy_SE_Column = NULL,
n_Simulations = 1000,
Calculate_IDAcomboscore_And_Hazard_Ratio = FALSE,
Average_Duplicate_Records = FALSE,
Return_Bootstrap_Values = FALSE
)
|
Monotherapy_Data |
A data frame where each row contains information about the response of a single cell line to a single drug at a single concentration. Must minimally include columns containing the following information: cell line name, drug name, drug concentration, and measured drug efficacy. May optionally include a column recording the standard error (SE) of the measured drug efficacy. |
Cell_Line_Name_Column |
A character vector of length 1 containing the name of the column in the Monotherapy_Data data frame which contains cell line names. |
Drug_Name_Column |
A character vector of length 1 containing the name of the column in the Monotherapy_Data data frame which contains drug names. |
Drug_Concentration_Column |
A character vector of length 1 containing the name of the column in the Monotherapy_Data data frame which contains drug concentrations. |
Efficacy_Column |
A character vector of length 1 containing the name of the column in the Monotherapy_Data data frame which contains measured drug efficacies (i.e. percent Viability, percent Cell Growth, etc.). |
LowerEfficacyIsBetterDrugEffect |
A logic vector of length 1 indicating whether or not lower values in Efficacy_Column indicate a more effective drug effect (i.e. for percent viability). Set TRUE if so. Otherwise, set FALSE if higher values in Efficacy_Column indicate a more effective drug response (i.e. for percent cell death). |
Efficacy_Metric_Name |
A character vector of length 1 indicating the name of the efficacy metric being used (i.e. Percent_Viability, Percent_Growth, etc.). Used to correctly label column names in output. Defaults to "Efficacy". |
Control_Treatment_Drugs |
A character vector of length > 0 containing the names of the drugs in the control drug treatment for which efficacy predictions are to be made. |
Control_Treatment_Drug_Concentrations |
A vector of drug concentrations for Control_Treatment_Drugs with the first concentration in Control_Treatment_Drug_Concentrations corresponding to the first drug in Control_Treatment_Drugs etc. Only one concentration may be specified for each drug in the control treatment, but, if a drug is included in both the control and test treatments, there is no need for the same concentration of that drug to be used in both treatments. |
Drug_to_Add |
A character vector of length 1 containing the name of the drug to add to the control treatment to create a new drug combination for which efficacy predictions are to be made. |
Calculate_Uncertainty |
A logic vector of length one indicating whether or not a Monte Carlo simulation should be performed to estimate uncertainties in the efficacy predictions based on uncertainties in the monotherapy efficacy measurements. Set TRUE if you wish to calculate uncertainties. Defaults to FALSE. |
Efficacy_SE_Column |
A character vector of length 1 containing the name of the column in the Monotherapy_Data data frame which contains the standard errors of measured drug efficacies. Must be specified if Calculate_Uncertainty is set to TRUE. |
n_Simulations |
A positive, integer vector of length 1 with a value >= 40 indicating the number of random samples to be drawn when calculating output efficacy prediction uncertainties. Defaults to 1000. |
Calculate_IDAcomboscore_And_Hazard_Ratio |
A logic vector of length 1 indicating whether or not IDA-Comboscores and Hazard Ratios (HRs) should be calculated between monotherapies and the drug combination. Set TRUE if so. Should only be set to TRUE for efficacy metrics that range between 0 and 1 (i.e. percent viability). Defaults to FALSE. |
Average_Duplicate_Records |
A logic vector of length 1 indicating whether or not duplicated records (where a cell line has multiple records for being tested with a given drug at a given concentration) should be averaged. If TRUE, Efficacy values are averaged, and, if Calculate_Uncertainty is also TRUE, Efficacy_SE values are added in quadrature and divided by the number of duplicate records for that cell line/drug/concentration set. |
Return_Bootstrap_Values |
A logic vector of length 1 indicating whether or not the function should return the Drug1 Efficacies and Drug2 Efficacies simulated in the semi-parametric bootstrap used to estimate the uncertainties of those values. If equal to TRUE, Calculate_Uncertainty must also equal TRUE. |
Uncertainty estimates for values calculated by this function are generated using a semi-parametric bootstrap approach. This is performed in several steps.
Control treatment efficacies for each drug/concentration are simulated by random sampling from normal distributions with means equal to the provided calculated efficacies and standard deviations equal to the provided efficacy standard errors.
Drug_to_Add efficacies are simulated in the same fashion as for control treatment efficacies, except in cases when Drug_to_Add is in Control_Treatment_Drugs. In such cases, it is assumed that the efficacy values for Drug_to_Add and its match in Control_Treatment_Drugs are derived from the same dose-response curve, so each simulated efficacy for Drug_to_Add is matched to the corresponding simulated efficacy for that drug in Control_Treatment_Drugs using a standard normal deviate.
Efficacy predictions are made for the combination of Control_Treatment_Drugs + Drug_to_Add for each cell line and set of simulated efficacies using the assumptions of independent drug action.
Cell lines are randomly sampled with replacement for each simulation as many times as there are original cell lines. The simulated Control_Treatment_Drugs monotherapy efficacies and combination efficacies are then sampled according to the sampled cell lines for each simulation.
Mean efficacies are calculated for the control and new combination treatments for each simulation. If specified to do so, these values are then used to calculate simulated HRs and IDAcomboscores.
The simulated distributions of each efficacy metric are used to estimate uncertainties for those metrics.
If Return_Bootstrap_Values = FALSE, this function returns a list with 4 elements: 1) Either a data frame with the calculated efficacy predictions, or, if an error occurred, a character vector of length one with the error message. 2) A character value with the name of the control therapy 3) A character value with the name of Drug_to_Add 4) A character vector containing the names of the cell lines used to make the efficacy predictions.
If Return_Bootstrap_Values = TRUE & Calculate_Uncertainty = TRUE, this function returns a list with 6 elements: the first 4 elements are the same as when Return_Bootstrap_Values = FALSE and the fifth and sixth elements are numeric vectors of, respectively, the control therapy and Drug_to_Add viabilities simulated during the semi-parametric bootstrap used to estimate uncertainties.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | #Loading Package
library(IDACombo)
#Making fake monotherapy dataset
CellLineNames <- rep(c("CL1", "CL2", "CL3", "CL4", "CL5", "CL6"), 6)
DrugNames <- c(rep("D1", 12), rep("D2", 12), rep("D3", 12))
Concentrations <- c(rep(1, 6), rep(2, 6), rep("1.5", 6), rep("3", 6), rep("1.5", 6), rep("3", 6))
Viability <- c(sample(seq(0.4,1,length.out = 10), 6, replace = TRUE),
sample(seq(0.2,0.8,length.out = 10), 6, replace = TRUE),
sample(seq(0.4,1,length.out = 10), 6, replace = TRUE),
sample(seq(0.2,0.6,length.out = 10), 6, replace = TRUE),
sample(seq(0.38,1,length.out = 10), 6, replace = TRUE),
sample(seq(0.18,0.6,length.out = 10), 6, replace = TRUE))
Viability_SE <- Viability * sample(seq(0,0.1,length.out = 100), 36, replace = TRUE)
Fake_Data <- data.frame(CellLineNames, DrugNames, Concentrations, Viability, Viability_SE)
#Creating efficacy predictions for D1+D2 + D3 without uncertainty calculations
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Viability",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = FALSE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_IDAcomboscore_And_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#Creating efficacy predictions for D1+D2 + D3 with uncertainty calculations
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Viability",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = TRUE,
Efficacy_SE_Column = "Viability_SE",
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_IDAcomboscore_And_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#Converting Viabilty to reduction in viability and redoing calculations
#Note the change in the LowerEfficacyIsBetterDrugEffect flag from TRUE to FALSE
Reduction_in_Viability <- 1-Viability
Reduction_in_Viability_SE <- Viability_SE
Fake_Data <- data.frame(CellLineNames,
DrugNames,
Concentrations,
Reduction_in_Viability,
Reduction_in_Viability_SE)
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Reduction_in_Viability",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = TRUE,
LowerEfficacyIsBetterDrugEffect = FALSE,
Efficacy_SE_Column = "Reduction_in_Viability_SE",
Efficacy_Metric_Name = "Reduction_In_Viability",
Calculate_IDAcomboscore_And_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#Changing efficacy metric to percent growth (range -1 to 1)
#Note that calculating Hazard Ratios and IDA-Comboscores is no longer valid, so
#Calculate_IDAcomboscore_And_Hazard_Ratio is set to FALSE.
Percent_Growth <- c(sample(seq(0.4,1,length.out = 10), 6, replace = TRUE),
sample(seq(-0.4,0.2,length.out = 10), 6, replace = TRUE),
sample(seq(-0.2,0.3,length.out = 10), 6, replace = TRUE),
sample(seq(-1,0.2,length.out = 10), 6, replace = TRUE),
sample(seq(-0.22,0.28,length.out = 10), 6, replace = TRUE),
sample(seq(-1,0.1,length.out = 10), 6, replace = TRUE))
Percent_Growth_SE <- abs(Percent_Growth * sample(seq(0,0.1,length.out = 100), 36, replace = TRUE))
Fake_Data <- data.frame(CellLineNames,
DrugNames,
Concentrations,
Percent_Growth,
Percent_Growth_SE)
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Percent_Growth",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = TRUE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_SE_Column = "Percent_Growth_SE",
Calculate_IDAcomboscore_And_Hazard_Ratio = FALSE,
Efficacy_Metric_Name = "Percent_Growth",
Average_Duplicate_Records = FALSE)
#Adding duplicate records for each cell line, and showing behavior with
#Average_Duplicate_Records = FALSE. Should produce warning messages that
#duplicates were found and removed.
Percent_Growth <- c(sample(seq(0.4,1,length.out = 10), 6, replace = TRUE),
sample(seq(-0.4,0.2,length.out = 10), 6, replace = TRUE),
sample(seq(-0.2,0.3,length.out = 10), 6, replace = TRUE),
sample(seq(-1,0.2,length.out = 10), 6, replace = TRUE),
sample(seq(-0.22,0.28,length.out = 10), 6, replace = TRUE),
sample(seq(-1,0.1,length.out = 10), 6, replace = TRUE))
Percent_Growth_SE <- abs(Percent_Growth * sample(seq(0,0.1,length.out = 100), 36, replace = TRUE))
Fake_Data_to_add <- data.frame(CellLineNames,
DrugNames,
Concentrations,
Percent_Growth,
Percent_Growth_SE)
Fake_Data <- rbind(Fake_Data, Fake_Data_to_add)
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Percent_Growth",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = TRUE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_SE_Column = "Percent_Growth_SE",
Calculate_IDAcomboscore_And_Hazard_Ratio = FALSE,
Efficacy_Metric_Name = "Percent_Growth",
Average_Duplicate_Records = FALSE)
#Now setting to average duplicate values.
Fake_Data <- rbind(Fake_Data, Fake_Data_to_add)
IDAPredict.ControlPlusOne(Monotherapy_Data = Fake_Data,
Cell_Line_Name_Column = "CellLineNames",
Drug_Name_Column = "DrugNames",
Drug_Concentration_Column = "Concentrations",
Efficacy_Column = "Percent_Growth",
Control_Treatment_Drugs = c("D1", "D2"),
Control_Treatment_Drug_Concentrations = c(1, 3),
Drug_to_Add = "D3",
Calculate_Uncertainty = TRUE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_SE_Column = "Percent_Growth_SE",
Calculate_IDAcomboscore_And_Hazard_Ratio = FALSE,
Efficacy_Metric_Name = "Percent_Growth",
Average_Duplicate_Records = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.