Description Usage Arguments Details Value Examples
View source: R/BlissPredict.TestvsControl.R
This function creates efficacy predictions for a pair of control and test treatments, each treatment consisting of a combination of one or more drugs, using monotherapy efficacy data and the assumptions of Bliss independence. Concentrations must be specified for each drug in each treatment. IMPORTANT NOTE: This function is only applicable to drug efficacies measured on a scale from 0 to 1.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | BlissPredict.TestvsControl(
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,
Test_Treatment_Drugs,
Test_Treatment_Drug_Concentrations,
Calculate_Uncertainty = FALSE,
Efficacy_SE_Column = NULL,
n_Simulations = 1000,
Calculate_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. Note, for Bliss Independence, efficacy must be expressed as a probability between 0 and 1. |
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 viability). Set TRUE if so. Otherwise, set FALSE if higher values in Efficacy_Column indicate a more effective drug response (i.e. for reduced viability). |
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. |
Test_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. |
Test_Treatment_Drug_Concentrations |
A vector of drug concentrations for Test_Treatment_Drugs with the first concentration in Test_Treatment_Drug_Concentrations corresponding to the first drug in Test_Treatment_Drugs etc. Only one concentration may be specified for each drug in the test 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. |
Calculate_Uncertainty |
A logic vector of length one indicating whether or not a semi-parametric bootstrap 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_Hazard_Ratio |
A logic vector of length 1 indicating whether or not a Hazard Ratios (HR) should be calculated between the control and test treatments. 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 Control Efficacies, Test Efficacies, and, if Calculate_Hazard_Ratio = TRUE, Hazard Ratios (HRs) 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 efficacies for each compound/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.
Test efficacies are simulated in the same fashion as the control efficacies, except in cases when a test drug also exists in the control therapy. In such cases, it is assumed that the efficacy values for this drug are derived from the same dose-response curve for the both the control and test therapies, so each simulated efficacy for that test drug is matched to the corresponding simulated efficacy from that drug in the control therapy using a standard normal deviate.
Efficacy predictions are made for the control and test therapies for each cell line and set of simulated efficacies using the assumptions of Bliss independence.
Cell lines are randomly sampled with replacement for each simulation as many times as there are original cell lines. The simulated control and test therapy efficacies are then sampled according to the sampled cell lines for each simulation.
Mean efficacies are calculated for the control and test therapies for each simulation. These values are then used to calculate simulated HRs.
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 data frame listing the control treatment drug names and concentrations. 3) A data frame listing the test treatment drug names and concentrations. 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 & Calculate_Hazard_Ratio = FALSE, 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 being numeric vectors of, respectively, the control and test viabilities simulated during the semi-parametric bootstrap used to estimate uncertainties.
If Return_Bootstrap_Values = TRUE & Calculate_Uncertainty = TRUE & Calculate_Hazard_Ratio = TRUE, this function returns a list with 7 elements: the first 4 elements are the same as when Return_Bootstrap_Values = FALSE and the fifth, sixth, and seventh elements being numeric vectors of, respectively, the control viabilities, test viabilities, and HRs 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 | #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("A", 6), rep("B", 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.9,1,length.out = 10), 6, replace = TRUE),
sample(seq(0.2,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 control and test treatments and comparing without
#uncertainty calculations
#For case where drugs in test treatment are at reduced concentrations from
#those used in the control treatment due to the addition of a third drug.
#Note that this may mean that the test treatment is less effective than
#the control treatment, such that the Hazard Ratio is > 1.
BlissPredict.TestvsControl(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(2, 3),
Test_Treatment_Drugs = c("D1", "D2", "D3"),
Test_Treatment_Drug_Concentrations = c(1, 1.5, "B"),
Calculate_Uncertainty = FALSE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#For case where drugs in test treatment are at same concentrations as
#those used in the control treatment.
BlissPredict.TestvsControl(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(2, 3),
Test_Treatment_Drugs = c("D1", "D2", "D3"),
Test_Treatment_Drug_Concentrations = c(2, 3, "B"),
Calculate_Uncertainty = FALSE,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#Creating efficacy predictions for control and test treatments and comparing with
#uncertainty calculations but without returning simulated values that are generated
#using a semi-parametric bootstrap to estimate uncertainties.
BlissPredict.TestvsControl(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(2, 3),
Test_Treatment_Drugs = c("D1", "D2", "D3"),
Test_Treatment_Drug_Concentrations = c(2, 3, "B"),
Calculate_Uncertainty = TRUE,
Efficacy_SE_Column = "Viability_SE",
n_Simulations = 1000,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
#Creating efficacy predictions for control and test treatments and comparing with
#uncertainty calculations and with returning simulated values that are generated
#using a semi-parametric bootstrap to estimate standard errors.
BlissPredict.TestvsControl(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(2, 3),
Test_Treatment_Drugs = c("D1", "D2", "D3"),
Test_Treatment_Drug_Concentrations = c(2, 3, "B"),
Calculate_Uncertainty = TRUE,
Efficacy_SE_Column = "Viability_SE",
n_Simulations = 1000,
LowerEfficacyIsBetterDrugEffect = TRUE,
Efficacy_Metric_Name = "Viability",
Calculate_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE,
Return_Bootstrap_Values = TRUE)
#Converting Viabilty to reduction in viability and redoing calculations
#without returning simulated values from semi-parametric boostrap. 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)
BlissPredict.TestvsControl(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(2, 3),
Test_Treatment_Drugs = c("D1", "D2", "D3"),
Test_Treatment_Drug_Concentrations = c(2, 3, "B"),
Calculate_Uncertainty = TRUE,
Efficacy_SE_Column = "Reduction_in_Viability_SE",
n_Simulations = 1000,
LowerEfficacyIsBetterDrugEffect = FALSE,
Efficacy_Metric_Name = "Reduction_in_Viability",
Calculate_Hazard_Ratio = TRUE,
Average_Duplicate_Records = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.