Title: | Analysis of Large-Scale Pharmacogenomic Data |
---|---|
Description: | Contains a set of functions to perform large-scale analysis of pharmaco-genomic data. These include the PharmacoSet object for storing the results of pharmacogenomic experiments, as well as a number of functions for computing common summaries of drug-dose response and correlating them with the molecular features in a cancer cell-line. |
Authors: | Petr Smirnov [aut], Christopher Eeles [aut], Jermiah Joseph [aut], Zhaleh Safikhani [aut], Mark Freeman [aut], Feifei Li [aut], Benjamin Haibe-Kains [aut, cre] |
Maintainer: | Benjamin Haibe-Kains <[email protected]> |
License: | GPL (>= 3) |
Version: | 3.11.0 |
Built: | 2024-11-14 05:49:16 UTC |
Source: | https://github.com/bioc/PharmacoGx |
[
[
## S4 method for signature 'PharmacoSet,ANY,ANY,ANY' x[i, j, ..., drop = FALSE]
## S4 method for signature 'PharmacoSet,ANY,ANY,ANY' x[i, j, ..., drop = FALSE]
x |
object |
i |
Cell lines to keep in object |
j |
Drugs to keep in object |
... |
further arguments |
drop |
A boolean flag of whether to drop single dimensions or not |
Returns the subsetted object
data(CCLEsmall) CCLEsmall["WM1799", "Sorafenib"]
data(CCLEsmall) CCLEsmall["WM1799", "Sorafenib"]
This function calculates an Adaptive Matthews Correlation Coefficient (AMCC) for two vectors of values of the same length. It assumes the entries in the two vectors are paired. The Adaptive Matthews Correlation Coefficient for two vectors of values is defined as the Maximum Matthews Coefficient over all possible binary splits of the ranks of the two vectors. In this way, it calculates the best possible agreement of a binary classifier on the two vectors of data. If the AMCC is low, then it is impossible to find any binary classification of the two vectors with a high degree of concordance.
amcc(x, y, step.prct = 0, min.cat = 3, nperm = 1000, nthread = 1)
amcc(x, y, step.prct = 0, min.cat = 3, nperm = 1000, nthread = 1)
x , y
|
Two paired vectors of values. Could be replicates of observations for the same experiments for example. |
step.prct |
Instead of testing all possible splits of the data, it is possible to test steps of a percentage size of the total number of ranks in x/y. If this variable is 0, function defaults to testing all possible splits. |
min.cat |
The minimum number of members per category. Classifications with less members fitting into both categories will not be considered. |
nperm |
The number of perumatation to use for estimating significance. If 0, then no p-value is calculated. |
nthread |
Number of threads to parallize over. Both the AMCC calculation and the permutation testing is done in parallel. |
Returns a list with two elements. $amcc contains the highest 'mcc' value over all the splits, the p value, as well as the rank at which the split was done.
amcc(0.6^(1:5), 0.5^(1:5))
amcc(0.6^(1:5), 0.5^(1:5))
The function fetches a table of all PharmacoSets available for download. The table includes the dataset names, version information for the data in the PSet, the date of last update, the name of the PSet, and references for the data contained within, a DOI for the data, and a direct download link. Download can also be done using the downloadPSet function.
availablePSets(canonical = TRUE)
availablePSets(canonical = TRUE)
canonical |
|
Much more information on the processing of the data and data provenance can be found at: www.orcestra.ca
A data.frame
with details about the available PharmacoSet objects
if (interactive()){ availablePSets() }
if (interactive()){ availablePSets() }
Sensitivity calls were made using one of IC50, ActArea or Amax
callingWaterfall( x, type = c("IC50", "AUC", "AMAX"), intermediate.fold = c(4, 1.2, 1.2), cor.min.linear = 0.95, name = "Drug", plot = FALSE )
callingWaterfall( x, type = c("IC50", "AUC", "AMAX"), intermediate.fold = c(4, 1.2, 1.2), cor.min.linear = 0.95, name = "Drug", plot = FALSE )
x |
What type of object does this take in? |
type |
ic50: IC50 values in micro molar (positive values) actarea: Activity Area, that is area under the drug activity curve (positive values) amax: Activity at max concentration (positive values) |
intermediate.fold |
vector of fold changes used to define the intermediate sensitivities for ic50, actarea and amax respectively |
cor.min.linear |
|
name |
|
plot |
|
Sort log IC50s (or ActArea or Amax) of the samples to generate a “waterfall distribution”
Identify cutoff:
3.1 If the waterfall distribution is non-linear (pearson cc to the linear fit <=0.95), estimate the major inflection point of the log IC50 curve as the point on the curve with the maximal distance to a line drawn between the start and end points of the distribution.
3.2 If the waterfall distribution appears linear (pearson cc to the linear fit > 0.95), then use the median IC50 instead.
Samples within a 4-fold IC50 (or within a 1.2-fold ActArea or 20% Amax difference) difference centered around this inflection point are classified as being “intermediate”, samples with lower IC50s (or ActArea/Amax values) than this range are defined as sensitive, and those with IC50s (or ActArea/Amax) higher than this range are called “insensitive”.
Require at least x sensitive and x insensitive samples after applying these criteria (x=5 in our case).
factor
Containing the drug sensitivity status of each
sample.
# Dummy example 1 + 1
# Dummy example 1 + 1
A small example version of the CCLE PharmacoSet, used in the documentation examples. All credit for the data goes to the CCLE group at the Broad Institute. This is not a full version of the dataset, most of of the dataset was removed to make runnable example code. For the full dataset, please download using the downloadPSet function.
data(CCLEsmall)
data(CCLEsmall)
PharmacoSet object
Barretina et al. The Cancer Cell Line Encyclopedia enables predictive modelling of anticancer drug sensitivity. Nature, 2012
This function checks the structure of a PharamcoSet, ensuring that the correct annotations are in place and all the required slots are filled so that matching of cells and drugs can be properly done across different types of data and with other studies.
checkPsetStructure(object, plotDist = FALSE, result.dir = ".")
checkPsetStructure(object, plotDist = FALSE, result.dir = ".")
object |
A |
plotDist |
Should the function also plot the distribution of molecular data? |
result.dir |
The path to the directory for saving the plots as a string |
Prints out messages whenever describing the errors found in the structure of the object object passed in.
data(CCLEsmall) checkPsetStructure(CCLEsmall)
data(CCLEsmall) checkPsetStructure(CCLEsmall)
A small example version of the Connectivity Map PharmacoSet, used in the documentation examples. All credit for the data goes to the Connectivity Map group at the Broad Institute. This is not a full version of the dataset, most of of the dataset was removed to make runnable example code. For the full dataset, please download using the downloadPSet function.
data(CMAPsmall)
data(CMAPsmall)
PharmacoSet object
Lamb et al. The Connectivity Map: using gene-expression signatures to connect small molecules, genes, and disease. Science, 2006.
Fits dose-response curves to data given by the user and returns the ABC of the fitted curves.
computeABC( conc1, conc2, viability1, viability2, Hill_fit1, Hill_fit2, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, verbose = TRUE )
computeABC( conc1, conc2, viability1, viability2, Hill_fit1, Hill_fit2, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, verbose = TRUE )
conc1 |
|
conc2 |
|
viability1 |
|
viability2 |
|
Hill_fit1 |
|
Hill_fit2 |
|
conc_as_log |
|
viability_as_pct |
|
trunc |
|
verbose |
|
The numeric area of the absolute difference between the two hill slopes
Mark Freeman
dose1 <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability1 <- c(108.67,111,102.16,100.27,90,87,74,57) dose2 <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability2 <- c(100.94,112.5,86,104.16,75,68,48,29) computeABC(dose1, dose2, viability1, viability2)
dose1 <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability1 <- c(108.67,111,102.16,100.27,90,87,74,57) dose2 <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability2 <- c(100.94,112.5,86,104.16,75,68,48,29) computeABC(dose1, dose2, viability1, viability2)
Fits dose-response curves to data given by the user and returns the Amax of the fitted curve. Amax: 100 - viability at maximum concentarion (in fitted curve)
computeAmax(concentration, viability, trunc = TRUE, verbose = FALSE)
computeAmax(concentration, viability, trunc = TRUE, verbose = FALSE)
concentration |
|
viability |
|
trunc |
|
verbose |
|
The numerical Amax
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAmax(dose, viability)
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAmax(dose, viability)
Returns the AUC (Area Under the drug response Curve) given concentration and viability as input, normalized by the concentration range of the experiment. The area returned is the response (1-Viablility) area, i.e. area under the curve when the response curve is plotted on a log10 concentration scale, with high AUC implying high sensitivity to the drug. The function can calculate both the area under a fitted Hill Curve to the data, and a trapz numeric integral of the actual data provided. Alternatively, the parameters of a Hill Slope returned by logLogisticRegression can be passed in if they already known.
computeAUC( concentration, viability, Hill_fit, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, area.type = c("Fitted", "Actual"), verbose = TRUE )
computeAUC( concentration, viability, Hill_fit, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, area.type = c("Fitted", "Actual"), verbose = TRUE )
concentration |
|
viability |
|
Hill_fit |
|
conc_as_log |
|
viability_as_pct |
|
trunc |
|
area.type |
Should the area be computed using the actual data ("Actual"), or a fitted curve ("Fitted") |
verbose |
|
Numeric AUC value
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAUC(dose, viability)
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAUC(dose, viability)
Given two numeric
containing viability of two monotherapy respectively,
Compute Bliss null reference values for the expected response
of the two treatments combined.
computeBliss(viability_1, viability_2)
computeBliss(viability_1, viability_2)
viability_1 |
|
viability_2 |
|
numeric
expected response of the two treatments combined
under Bliss null assumption.
(bliss <- computeBliss(0.75, 0.65))
(bliss <- computeBliss(0.75, 0.65))
Given two numeric
containing viability of two monotherapy respectively,
Compute highest single-agent (HSA) values as the expected response
of the two treatments combined.
computeHSA(viability_1, viability_2)
computeHSA(viability_1, viability_2)
viability_1 |
|
viability_2 |
|
numeric
expected response of the two treatments combined
using the highest response of the two (lower viability).
(hsa <- computeHSA(0.75, 0.65))
(hsa <- computeHSA(0.75, 0.65))
Returns the ICn for any given nth percentile when given concentration and viability as input, normalized by the concentration range of the experiment. A Hill Slope is first fit to the data, and the ICn is inferred from the fitted curve. Alternatively, the parameters of a Hill Slope returned by logLogisticRegression can be passed in if they already known.
computeIC50( concentration, viability, Hill_fit, conc_as_log = FALSE, viability_as_pct = TRUE, verbose = TRUE, trunc = TRUE ) computeICn( concentration, viability, Hill_fit, n, conc_as_log = FALSE, viability_as_pct = TRUE, verbose = TRUE, trunc = TRUE )
computeIC50( concentration, viability, Hill_fit, conc_as_log = FALSE, viability_as_pct = TRUE, verbose = TRUE, trunc = TRUE ) computeICn( concentration, viability, Hill_fit, n, conc_as_log = FALSE, viability_as_pct = TRUE, verbose = TRUE, trunc = TRUE )
concentration |
|
viability |
|
Hill_fit |
|
conc_as_log |
|
viability_as_pct |
|
verbose |
|
trunc |
|
n |
|
numeric(1)
The ICn of the Hill curve over the specified dose
range.
a numeric value for the concentration of the nth precentile viability reduction
computeIC50()
: Returns the IC50 of a Drug Dose response curve
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeIC50(dose, viability) computeICn(dose, viability, n=10)
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeIC50(dose, viability) computeICn(dose, viability, n=10)
Predict the response of a treatment combination under the Loewe additive null assumption.
computeLoewe( treatment1dose, HS_1, E_inf_1, EC50_1, treatment2dose, HS_2, E_inf_2, EC50_2, tol = 0.1, lower_bound = 0, upper_bound = 1, verbose = FALSE )
computeLoewe( treatment1dose, HS_1, E_inf_1, EC50_1, treatment2dose, HS_2, E_inf_2, EC50_2, tol = 0.1, lower_bound = 0, upper_bound = 1, verbose = FALSE )
treatment1dose |
|
HS_1 |
|
E_inf_1 |
|
EC50_1 |
|
treatment2dose |
|
HS_2 |
|
E_inf_2 |
|
EC50_2 |
|
tol |
|
lower_bound |
|
upper_bound |
|
verbose |
|
numeric
expected viability under Loewe additive null assumption.
## Not run: tre |> endoaggregate( assay="combo_viability", Loewe = computeLoewe( treatment1dose=treatment1dose, treatment2dose=treatment2dose, HS_1=HS_1, HS_2=HS_2, E_inf_1=E_inf_1, E_inf_2=E_inf_2, EC50_1=EC50_1, EC50_2=EC50_2 ), by = assayKeys(tre, "combo_viability") ) -> tre ## End(Not run)
## Not run: tre |> endoaggregate( assay="combo_viability", Loewe = computeLoewe( treatment1dose=treatment1dose, treatment2dose=treatment2dose, HS_1=HS_1, HS_2=HS_2, E_inf_1=E_inf_1, E_inf_2=E_inf_2, EC50_1=EC50_1, EC50_2=EC50_2 ), by = assayKeys(tre, "combo_viability") ) -> tre ## End(Not run)
Return Slope (normalized slope of the drug response curve) for an experiment of a pSet by taking its concentration and viability as input.
computeSlope(concentration, viability, trunc = TRUE, verbose = TRUE)
computeSlope(concentration, viability, trunc = TRUE, verbose = TRUE)
concentration |
|
viability |
|
trunc |
|
verbose |
|
Returns the normalized linear slope of the drug response curve
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeSlope(dose, viability)
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeSlope(dose, viability)
Predict the additive response of a treatment combination under the ZIP null assumption.
computeZIP( treatment1dose, HS_1, EC50_1, E_inf_1, treatment2dose, HS_2, EC50_2, E_inf_2 )
computeZIP( treatment1dose, HS_1, EC50_1, E_inf_1, treatment2dose, HS_2, EC50_2, E_inf_2 )
treatment1dose |
|
HS_1 |
|
EC50_1 |
|
E_inf_1 |
|
treatment2dose |
|
HS_2 |
|
EC50_2 |
|
E_inf_2 |
|
numeric
expected viability under ZIP null assumption.
(zip <- computeZIP( treatment1dose = c(0.1, 0.01, 0.001), treatment2dose = c(1, 0.1, 0.01), HS_1 = rep(1, 3), HS_2 = rep(1.2, 3), EC50_1 = rep(0.01, 3), EC50_2 = rep(0.1, 3), E_inf_1 = rep(0, 3), E_inf_2 = rep(0.1, 3) ))
(zip <- computeZIP( treatment1dose = c(0.1, 0.01, 0.001), treatment2dose = c(1, 0.1, 0.01), HS_1 = rep(1, 3), HS_2 = rep(1.2, 3), EC50_1 = rep(0.01, 3), EC50_2 = rep(0.1, 3), E_inf_1 = rep(0, 3), E_inf_2 = rep(0.1, 3) ))
Generic to compute ZIP delta scores from an S4 object
computeZIPdelta(object, ...)
computeZIPdelta(object, ...)
object |
|
... |
Allow new arguments to this generic. |
Depends on the implemented method.
print("Generics shouldn't need examples?")
print("Generics shouldn't need examples?")
Following the calculation of ZIP delta score as in Appendix A3. See reference for details.
Compute ZIP delta score as described in the original paper.
## S4 method for signature 'TreatmentResponseExperiment' computeZIPdelta(object, residual = "logcosh", nthread = 1L, show_Rsqr = FALSE)
## S4 method for signature 'TreatmentResponseExperiment' computeZIPdelta(object, residual = "logcosh", nthread = 1L, show_Rsqr = FALSE)
object |
TreatmentResponseExperiment
The |
residual |
|
nthread |
|
show_Rsqr |
|
TreatmentResponseExperiment with assay combo_scores
containing delta_scores
Yadav, B., Wennerberg, K., Aittokallio, T., & Tang, J. (2015). Searching for Drug Synergy in Complex Dose–Response Landscapes Using an Interaction Potency Model. Computational and Structural Biotechnology Journal, 13, 504–513. https://doi.org/10.1016/j.csbj.2015.09.001
## Not run: tre <- computeZIPdelta(tre, residual = "Cauchy", nthread = 2L) ## End(Not run)
## Not run: tre <- computeZIPdelta(tre, residual = "Cauchy", nthread = 2L) ## End(Not run)
A function for finding the connectivity between two signatures, using either the GSEA method based on the KS statistic, or the gwc method based on a weighted spearman statistic. The GSEA analysis is implemented in the piano package.
connectivityScore( x, y, method = c("gsea", "fgsea", "gwc"), nperm = 10000, nthread = 1, gwc.method = c("spearman", "pearson"), ... )
connectivityScore( x, y, method = c("gsea", "fgsea", "gwc"), nperm = 10000, nthread = 1, gwc.method = c("spearman", "pearson"), ... )
x |
A |
y |
A |
method |
|
nperm |
|
nthread |
|
gwc.method |
|
... |
Additional arguments passed down to gsea and gwc functions |
numeric
a numeric vector with the score and the p-value associated
with it
F. Pozzi, T. Di Matteo, T. Aste, 'Exponential smoothing weighted correlations', The European Physical Journal B, Vol. 85, No 6, 2012. DOI: 10.1140/epjb/e2012-20697-x
Varemo, L., Nielsen, J. and Nookaew, I. (2013) Enriching the gene set analysis of genome-wide data by incorporating directionality of gene expression and combining statistical hypotheses and methods. Nucleic Acids Research. 41 (8), 4378-4391. doi: 10.1093/nar/gkt111
xValue <- c(1,5,23,4,8,9,2,19,11,12,13) xSig <- c(0.01, 0.001, .97, 0.01,0.01,0.28,0.7,0.01,0.01,0.01,0.01) yValue <- c(1,5,10,4,8,19,22,19,11,12,13) ySig <- c(0.01, 0.001, .97,0.01, 0.01,0.78,0.9,0.01,0.01,0.01,0.01) xx <- cbind(xValue, xSig) yy <- cbind(yValue, ySig) rownames(xx) <- rownames(yy) <- c('1','2','3','4','5','6','7','8','9','10','11') data.cor <- connectivityScore(xx,yy,method='gwc', gwc.method='spearman', nperm=300)
xValue <- c(1,5,23,4,8,9,2,19,11,12,13) xSig <- c(0.01, 0.001, .97, 0.01,0.01,0.28,0.7,0.01,0.01,0.01,0.01) yValue <- c(1,5,10,4,8,19,22,19,11,12,13) ySig <- c(0.01, 0.001, .97,0.01, 0.01,0.78,0.9,0.01,0.01,0.01,0.01) xx <- cbind(xValue, xSig) yy <- cbind(yValue, ySig) rownames(xx) <- rownames(yy) <- c('1','2','3','4','5','6','7','8','9','10','11') data.cor <- connectivityScore(xx,yy,method='gwc', gwc.method='spearman', nperm=300)
Computes the cosine similarity and significance using permutation test. This
function uses random numbers, to ensure reproducibility please call
set.seed()
before running the function.
cosinePerm( x, y, nperm = 1000, alternative = c("two.sided", "less", "greater"), include.perm = FALSE, nthread = 1 )
cosinePerm( x, y, nperm = 1000, alternative = c("two.sided", "less", "greater"), include.perm = FALSE, nthread = 1 )
x |
|
y |
|
nperm |
|
alternative |
|
include.perm |
|
nthread |
|
A list
estimate of the cosine similarity, p-value and
estimates after random permutations (null distribution) in include.perm is
set to 'TRUE'
x <- factor(c(1,2,1,2,1)) y <- factor(c(2,2,1,1,1)) cosinePerm(x, y)
x <- factor(c(1,2,1,2,1)) y <- factor(c(2,2,1,1,1)) cosinePerm(x, y)
Get the dimensions of a PharmacoSet
## S4 method for signature 'PharmacoSet' dim(x)
## S4 method for signature 'PharmacoSet' dim(x)
x |
PharmacoSet |
A named vector with the number of Cells and Drugs in the PharmacoSet
This function allows you to download an array of drug perturbation
signatures, as would be computed by the drugPerturbationSig
function,
for the available perturbation PharmacoSets
. This function allows the
user to skip these very lengthy calculation steps for the datasets available,
and start their analysis from the already computed signatures
downloadPertSig( name, saveDir = file.path(".", "PSets", "Sigs"), fileName, verbose = TRUE, ..., myfn )
downloadPertSig( name, saveDir = file.path(".", "PSets", "Sigs"), fileName, verbose = TRUE, ..., myfn )
name |
A |
saveDir |
A |
fileName |
|
verbose |
|
... |
|
myfn |
|
An array type object contaning the signatures
## Not run: if (interactive()) downloadPertSig("CMAP_2016") ## End(Not run)
## Not run: if (interactive()) downloadPertSig("CMAP_2016") ## End(Not run)
This function allows you to download a PharmacoSet
object for use with this
package. The PharmacoSets
have been extensively curated and organised within
a PharacoSet class, enabling use with all the analysis tools provided in
PharmacoGx
. User availablePSets
to discover which PSets are available.
downloadPSet( name, saveDir = tempdir(), pSetFileName = NULL, verbose = TRUE, timeout = 600 )
downloadPSet( name, saveDir = tempdir(), pSetFileName = NULL, verbose = TRUE, timeout = 600 )
name |
|
saveDir |
|
pSetFileName |
|
verbose |
|
timeout |
|
A PSet object with the dataset
BREAKING CHANGES - this function now defaults to tempdir()
as the download
path! You must specify a saveDir or manually save the PSet if you want
your download to persist past your current R session.'
## Not run: if (interactive()) downloadPSet("CTRPv2_2015") ## End(Not run)
## Not run: if (interactive()) downloadPSet("CTRPv2_2015") ## End(Not run)
Given a list of PharmacoSets, the function will plot the drug_response curve, for a given drug/cell pair. The y axis of the plot is the viability percentage and x axis is the log transformed concentrations. If more than one pSet is provided, a light gray area would show the common concentration range between pSets. User can ask for type of sensitivity measurment to be shown in the plot legend. The user can also provide a list of their own concentrations and viability values, as in the examples below, and it will be treated as experiments equivalent to values coming from a pset. The names of the concentration list determine the legend labels.
drugDoseResponseCurve( drug, cellline, pSets = list(), concentrations = list(), viabilities = list(), conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, legends.label = c("ic50_published", "gi50_published", "auc_published", "auc_recomputed", "ic50_recomputed"), ylim = c(0, 100), xlim, mycol, title, plot.type = c("Fitted", "Actual", "Both"), summarize.replicates = TRUE, lwd = 0.5, cex = 0.7, cex.main = 0.9, legend.loc = "topright", verbose = TRUE, sample_col = "sampleid", treatment_col = "treatmentid" )
drugDoseResponseCurve( drug, cellline, pSets = list(), concentrations = list(), viabilities = list(), conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, legends.label = c("ic50_published", "gi50_published", "auc_published", "auc_recomputed", "ic50_recomputed"), ylim = c(0, 100), xlim, mycol, title, plot.type = c("Fitted", "Actual", "Both"), summarize.replicates = TRUE, lwd = 0.5, cex = 0.7, cex.main = 0.9, legend.loc = "topright", verbose = TRUE, sample_col = "sampleid", treatment_col = "treatmentid" )
drug |
|
cellline |
|
pSets |
|
concentrations , viabilities
|
|
conc_as_log |
|
viability_as_pct |
|
trunc |
|
legends.label |
|
ylim |
|
xlim |
|
mycol |
|
title |
|
plot.type |
|
summarize.replicates |
|
lwd |
|
cex |
|
cex.main |
|
legend.loc |
And argument passable to xy.coords for the position to place the legend. |
verbose |
|
sample_col |
|
treatment_col |
|
Plots to the active graphics device and returns an invisible NULL.
if (interactive()) { # Manually enter the plot parameters drugDoseResponseCurve(concentrations=list("Experiment 1"=c(.008, .04, .2, 1)), viabilities=list(c(100,50,30,1)), plot.type="Both") # Generate a plot from one or more PSets data(GDSCsmall) drugDoseResponseCurve(drug="Doxorubicin", cellline="22RV1", pSets=GDSCsmall) }
if (interactive()) { # Manually enter the plot parameters drugDoseResponseCurve(concentrations=list("Experiment 1"=c(.008, .04, .2, 1)), viabilities=list(c(100,50,30,1)), plot.type="Both") # Generate a plot from one or more PSets data(GDSCsmall) drugDoseResponseCurve(drug="Doxorubicin", cellline="22RV1", pSets=GDSCsmall) }
Given a Pharmacoset of the perturbation experiment type, and a list of drugs, the function will compute a signature for the effect of drug concentration on the molecular profile of a cell. The algorithm uses a regression model which corrects for experimental batch effects, cell specific differences, and duration of experiment to isolate the effect of the concentration of the drug applied. The function returns the estimated coefficient for concentration, the t-stat, the p-value and the false discovery rate associated with that coefficient, in a 3 dimensional array, with genes in the first direction, drugs in the second, and the selected return values in the third.
drugPerturbationSig( pSet, mDataType, drugs, cells, features, nthread = 1, returnValues = c("estimate", "tstat", "pvalue", "fdr"), verbose = FALSE )
drugPerturbationSig( pSet, mDataType, drugs, cells, features, nthread = 1, returnValues = c("estimate", "tstat", "pvalue", "fdr"), verbose = FALSE )
pSet |
PharmacoSet a PharmacoSet of the perturbation experiment type |
mDataType |
|
drugs |
|
cells |
|
features |
|
nthread |
|
returnValues |
|
verbose |
|
list
a 3D array with genes in the first dimension, drugs in the
second, and return values in the third.
data(CMAPsmall) drug.perturbation <- drugPerturbationSig(CMAPsmall, mDataType="rna", nthread=1) print(drug.perturbation)
data(CMAPsmall) drug.perturbation <- drugPerturbationSig(CMAPsmall, mDataType="rna", nthread=1) print(drug.perturbation)
Given a Pharmacoset of the sensitivity experiment type, and a list of drugs, the function will compute a signature for the effect gene expression on the molecular profile of a cell. The function returns the estimated coefficient, the t-stat, the p-value and the false discovery rate associated with that coefficient, in a 3 dimensional array, with genes in the first direction, drugs in the second, and the selected return values in the third.
## S4 method for signature 'PharmacoSet' drugSensitivitySig( object, mDataType, drugs, features, cells, tissues, sensitivity.measure = "auc_recomputed", molecular.summary.stat = c("mean", "median", "first", "last", "or", "and"), sensitivity.summary.stat = c("mean", "median", "first", "last"), returnValues = c("estimate", "pvalue", "fdr"), sensitivity.cutoff, standardize = c("SD", "rescale", "none"), molecular.cutoff = NA, molecular.cutoff.direction = c("less", "greater"), nthread = 1, parallel.on = c("drug", "gene"), modeling.method = c("anova", "pearson"), inference.method = c("analytic", "resampling"), verbose = TRUE, ... )
## S4 method for signature 'PharmacoSet' drugSensitivitySig( object, mDataType, drugs, features, cells, tissues, sensitivity.measure = "auc_recomputed", molecular.summary.stat = c("mean", "median", "first", "last", "or", "and"), sensitivity.summary.stat = c("mean", "median", "first", "last"), returnValues = c("estimate", "pvalue", "fdr"), sensitivity.cutoff, standardize = c("SD", "rescale", "none"), molecular.cutoff = NA, molecular.cutoff.direction = c("less", "greater"), nthread = 1, parallel.on = c("drug", "gene"), modeling.method = c("anova", "pearson"), inference.method = c("analytic", "resampling"), verbose = TRUE, ... )
object |
|
mDataType |
|
drugs |
|
features |
|
cells |
|
tissues |
|
sensitivity.measure |
|
molecular.summary.stat |
|
sensitivity.summary.stat |
|
returnValues |
|
sensitivity.cutoff |
|
standardize |
|
molecular.cutoff |
Allows the user to binarize the sensitivity data using this threshold. |
molecular.cutoff.direction |
|
nthread |
|
parallel.on |
One of "gene" or "drug", chooses which level to parallelize computation (by gene, or by drug). |
modeling.method |
One of "anova" or "pearson". If "anova", nested linear models (including and excluding the molecular feature) adjusted for are fit after the data is standardized, and ANOVA is used to estimate significance. If "pearson", partial correlation adjusted for tissue of origin are fit to the data, and a Pearson t-test (or permutation) test are used. Note that the difference is in whether standardization is done across the whole dataset (anova) or within each tissue (pearson), as well as the test applied. |
inference.method |
Should "analytic" or "resampling" (permutation testing + bootstrap) inference be used to estimate significance. For permutation testing, QUICK-STOP is used to adaptively stop permutations. Resampling is currently only implemented for "pearson" modelling method. |
verbose |
|
... |
additional arguments not currently fully supported by the function |
array
a 3D array with genes in the first dimension, drugs in the
second, and return values in the third.
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType = "rna", nthread = 1, features = fNames(GDSCsmall, "rna")[1] ) print(drug.sensitivity)
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType = "rna", nthread = 1, features = fNames(GDSCsmall, "rna")[1] ) print(drug.sensitivity)
For the dose-response Hill equation of a drug defined by
,
that computes the response in viability from a dose in micromole for a drug,
this function is the inverse function of the Hill curve that
computes the dose required to produce a given response:
effectToDose(viability, EC50, HS, E_inf, is_pct = FALSE)
effectToDose(viability, EC50, HS, E_inf, is_pct = FALSE)
viability |
|
EC50 |
|
HS |
|
E_inf |
|
is_pct |
|
numeric
concentrations in micromoles required to produce
viability
in the corresponding entries.
dose <- effectToDose(viability = 80, EC50 = 42, HS = 1, E_inf = 10, is_pct = TRUE)
dose <- effectToDose(viability = 80, EC50 = 42, HS = 1, E_inf = 10, is_pct = TRUE)
Estimate the projected shape parameter HS, efficacy E_inf
and potency EC50
in the new dose-response curve of a drug after adding another drug to it
by fitting a 2-parameter dose-response curve.
estimateProjParams( dose_to, combo_viability, dose_add, EC50_add, HS_add, E_inf_add = 0, residual = c("logcosh", "normal", "Cauchy"), show_Rsqr = TRUE, conc_as_log = FALSE, optim_only = FALSE, loss_args = list() )
estimateProjParams( dose_to, combo_viability, dose_add, EC50_add, HS_add, E_inf_add = 0, residual = c("logcosh", "normal", "Cauchy"), show_Rsqr = TRUE, conc_as_log = FALSE, optim_only = FALSE, loss_args = list() )
dose_to |
|
combo_viability |
|
dose_add |
|
EC50_add |
|
HS_add |
|
E_inf_add |
|
residual |
|
show_Rsqr |
|
conc_as_log |
|
optim_only |
|
loss_args |
|
list
* HS_proj
: Projected Hill coefficient after adding a drug
* E_inf_proj
: Projected efficacy after adding a drug
* EC50_proj
: Projected potency after adding a drug
* E_ninf_proj
: Projected baseline viability by the added drug
* Rsqr
: if show_Rsqr
is TRUE
, it will include the R squared value indicating the quality of the fit in the result.
Motulsky, H., & Christopoulos, A. (2004). Fitting dose-response curves. In Fitting models to biological data using linear and nonlinear regression: A practical guide to curve fitting. Oxford University Press.
Viability measurements in dose-reponse curves must remain stable or decrease monotonically reflecting response to the drug being tested. filterNoisyCurves flags dose-response curves that strongly violate these assumptions.
filterNoisyCurves( pSet, epsilon = 25, positive.cutoff.percent = 0.8, mean.viablity = 200, nthread = 1 )
filterNoisyCurves( pSet, epsilon = 25, positive.cutoff.percent = 0.8, mean.viablity = 200, nthread = 1 )
pSet |
PharmacoSet a PharmacoSet object |
epsilon |
|
positive.cutoff.percent |
|
mean.viablity |
|
nthread |
|
a list with two elements 'noisy' containing the rownames of the noisy curves, and 'ok' containing the rownames of the non-noisy curves
data(GDSCsmall) filterNoisyCurves(GDSCsmall)
data(GDSCsmall) filterNoisyCurves(GDSCsmall)
Fit projected dose-response curves with E_min
as the viability
of the treatment being added to the other treament at a fixed dose.
fitTwowayZIP( combo_profiles, residual = "logcosh", show_Rsqr = TRUE, nthread = 1L, optim_only = TRUE, loss_args = list() )
fitTwowayZIP( combo_profiles, residual = "logcosh", show_Rsqr = TRUE, nthread = 1L, optim_only = TRUE, loss_args = list() )
combo_profiles |
data.table contains three parameters of dose-response curves for each single agent in a drug comnbination, and the observed viability of two treatments combined. |
residual |
|
show_Rsqr |
|
nthread |
|
optim_only |
|
loss_args |
|
data.table contains parameters of projected dose-response curves for adding one treatment to the other.
Yadav, B., Wennerberg, K., Aittokallio, T., & Tang, J. (2015). Searching for Drug Synergy in Complex Dose–Response Landscapes Using an Interaction Potency Model. Computational and Structural Biotechnology Journal, 13, 504–513. https://doi.org/10.1016/j.csbj.2015.09.001
## Not run: combo_profiles <- CoreGx::buildComboProfiles(tre, c("HS", "EC50", "E_inf", "viability")) combo_twowayFit <- fitTwowayZIP(combo_profiles) ## End(Not run)
## Not run: combo_profiles <- CoreGx::buildComboProfiles(tre, c("HS", "EC50", "E_inf", "viability")) combo_twowayFit <- fitTwowayZIP(combo_profiles) ## End(Not run)
A small example version of the Genomics of Drug Sensitivity in Cancer Project PharmacoSet, used in the documentation examples. All credit for the data goes to the Genomics of Drug Sensitivity in Cancer Project group at the Sanger.This is not a full version of the dataset, most of of the dataset was removed to make runnable example code. For the full dataset, please download using the downloadPSet function.
data(GDSCsmall)
data(GDSCsmall)
PharmacoSet object
Garnett et al. Systematic identification of genomic markers of drug sensitivity in cancer cells. Nature, 2012.
TODO:: Write a description!
geneDrugSensitivity( x, type, batch, drugpheno, interaction.typexgene = FALSE, model = FALSE, standardize = c("SD", "rescale", "none"), verbose = FALSE )
geneDrugSensitivity( x, type, batch, drugpheno, interaction.typexgene = FALSE, model = FALSE, standardize = c("SD", "rescale", "none"), verbose = FALSE )
x |
A |
type |
A |
batch |
A |
drugpheno |
A |
interaction.typexgene |
|
model |
|
standardize |
|
verbose |
|
A vector
reporting the effect size (estimate of the coefficient
of drug concentration), standard error (se), sample size (n), t statistic,
and F statistics and its corresponding p-value.
print("TODO::")
print("TODO::")
This version of the function uses a partial correlation instead of standardized linear models, for discrete predictive features Requires at least 3 observations per group.
geneDrugSensitivityPBCorr( x, type, batch, drugpheno, test = c("resampling", "analytic"), req_alpha = 0.05, nBoot = 1000, conf.level = 0.95, max_perm = getOption("PharmacoGx_Max_Perm", ceiling(1/req_alpha * 100)), verbose = FALSE )
geneDrugSensitivityPBCorr( x, type, batch, drugpheno, test = c("resampling", "analytic"), req_alpha = 0.05, nBoot = 1000, conf.level = 0.95, max_perm = getOption("PharmacoGx_Max_Perm", ceiling(1/req_alpha * 100)), verbose = FALSE )
x |
A |
type |
A |
batch |
A |
drugpheno |
A |
test |
A |
req_alpha |
|
nBoot |
|
conf.level |
|
max_perm |
|
verbose |
|
A vector
reporting the effect size (estimateof the coefficient
of drug concentration), standard error (se), sample size (n), t statistic,
and F statistics and its corresponding p-value.
print("TODO::")
print("TODO::")
This version of the function uses a partial correlation instead of standardized linear models.
geneDrugSensitivityPCorr( x, type, batch, drugpheno, test = c("resampling", "analytic"), req_alpha = 0.05, nBoot = 1000, conf.level = 0.95, max_perm = getOption("PharmacoGx_Max_Perm", ceiling(1/req_alpha * 100)), verbose = FALSE )
geneDrugSensitivityPCorr( x, type, batch, drugpheno, test = c("resampling", "analytic"), req_alpha = 0.05, nBoot = 1000, conf.level = 0.95, max_perm = getOption("PharmacoGx_Max_Perm", ceiling(1/req_alpha * 100)), verbose = FALSE )
x |
A |
type |
A |
batch |
A |
drugpheno |
A |
test |
A |
req_alpha |
|
nBoot |
|
conf.level |
|
max_perm |
|
verbose |
|
A vector
reporting the effect size (estimateof the coefficient
of drug concentration), standard error (se), sample size (n), t statistic,
and F statistics and its corresponding p-value.
print("TODO::")
print("TODO::")
Calculate the gwc score between two vectors, using either a weighted spearman or pearson correlation
gwc( x1, p1, x2, p2, method.cor = c("pearson", "spearman"), nperm = 10000, truncate.p = 1e-16, ... )
gwc( x1, p1, x2, p2, method.cor = c("pearson", "spearman"), nperm = 10000, truncate.p = 1e-16, ... )
x1 |
|
p1 |
|
x2 |
|
p2 |
|
method.cor |
|
nperm |
|
truncate.p |
|
... |
Other passed down to internal functions |
numeric
a vector of two values, the correlation and associated p-value.
data(CCLEsmall) x <- molecularProfiles(CCLEsmall,"rna")[,1] y <- molecularProfiles(CCLEsmall,"rna")[,2] x_p <- rep(0.05, times=length(x)) y_p <- rep(0.05, times=length(y)) names(x_p) <- names(x) names(y_p) <- names(y) gwc(x,x_p,y,y_p, nperm=100)
data(CCLEsmall) x <- molecularProfiles(CCLEsmall,"rna")[,1] y <- molecularProfiles(CCLEsmall,"rna")[,2] x_p <- rep(0.05, times=length(x)) y_p <- rep(0.05, times=length(y)) names(x_p) <- names(x) names(y_p) <- names(y) gwc(x,x_p,y,y_p, nperm=100)
A gene signature for HDAC inhibitors, as detailed by Glaser et al. The
signature is mapped from the probe to gene level using
probeGeneMapping
data(HDAC_genes)
data(HDAC_genes)
a 13x2 data.frame with gene identifiers in the first column and direction change in the second
Glaser et al. Gene expression profiling of multiple histone deacetylase (HDAC) inhibitors: defining a common gene set produced by HDAC inhibition in T24 and MDA carcinoma cell lines. Molecular cancer therapeutics, 2003.
Sigmoidal function which fits well to many stimuli-response associations observed in biology and pharmacology. In the context of PharmacoGx we are using it to model treatment-response assocations in cancer cell lines.
hillCurve(dose, HS, EC50, E_inf, E_ninf)
hillCurve(dose, HS, EC50, E_inf, E_ninf)
dose |
|
HS |
|
EC50 |
|
E_inf |
|
E_ninf |
|
numeric()
Vector of predicted viabilities for the Hill curve defined
by EC50
, E_inf
, E_ninf
and HS
for each supplied value of dose
.
Feifei Li Petr Smirnov Christopher Eeles
Gesztelyi, R., Zsuga, J., Kemeny-Beke, A., Varga, B., Juhasz, B., & Tosaki, A. (2012). The Hill equation and the origin of quantitative pharmacology. Archive for History of Exact Sciences, 66(4), 427–438. https://doi.org/10.1007/s00407-012-0098-5
Motulsky, H., & Christopoulos, A. (2004). Fitting models to biological data using linear and nonlinear regression: A practical guide to curve fitting. Oxford University Press. See Chapter 41.
(viability <- hillCurve( dose=c(0.1, 0.01, 0.001), HS=1.1, EC50=0.01, E_ninf=1, E_inf=0 ))
(viability <- hillCurve( dose=c(0.1, 0.01, 0.001), HS=1.1, EC50=0.01, E_ninf=1, E_inf=0 ))
Given a list of PharmacoSets, the function will find the common drugs, and/or cell lines, and return PharmacoSets that contain data only pertaining to the common drugs, and/or cell lines. The mapping between dataset drug and cell names is done using annotations found in the PharmacoSet object's internal curation slot
intersectPSet( pSets, intersectOn = c("drugs", "cell.lines", "concentrations"), cells, drugs, strictIntersect = FALSE, verbose = TRUE, nthread = 1 )
intersectPSet( pSets, intersectOn = c("drugs", "cell.lines", "concentrations"), cells, drugs, strictIntersect = FALSE, verbose = TRUE, nthread = 1 )
pSets |
|
intersectOn |
|
cells |
a |
drugs |
a |
strictIntersect |
|
verbose |
|
nthread |
|
A list
of pSets, contatining only the intersection
data(GDSCsmall) data(CCLEsmall) common <- intersectPSet(list('GDSC'=GDSCsmall,'CCLE'=CCLEsmall), intersectOn = c("drugs", "cell.lines")) common$CGP common$CCLE
data(GDSCsmall) data(CCLEsmall) common <- intersectPSet(list('GDSC'=GDSCsmall,'CCLE'=CCLEsmall), intersectOn = c("drugs", "cell.lines")) common$CGP common$CCLE
Computes the Loewe additive combination index (CI) from its definition
loeweCI( viability, treatment1dose, HS_1, E_inf_1, EC50_1, treatment2dose, HS_2, E_inf_2, EC50_2, is_pct = FALSE )
loeweCI( viability, treatment1dose, HS_1, E_inf_1, EC50_1, treatment2dose, HS_2, E_inf_2, EC50_2, is_pct = FALSE )
viability |
|
treatment1dose |
|
HS_1 |
|
E_inf_1 |
|
EC50_1 |
|
treatment2dose |
|
HS_2 |
|
E_inf_2 |
|
EC50_2 |
|
is_pct |
|
CI under Loewe additive definition
## Not run: tre |> endoaggregate( assay="combo_viability", Loewe = PharmacoGx::computeLoewe( treatment1dose = treatment1dose, treatment2dose = treatment2dose, HS_1 = HS_1, HS_2 = HS_2, E_inf_1 = E_inf_1, E_inf_2 = E_inf_2, EC50_1 = EC50_1, EC50_2 = EC50_2 ), by = assayKeys(tre, "combo_viability") ) -> tre ## End(Not run)
## Not run: tre |> endoaggregate( assay="combo_viability", Loewe = PharmacoGx::computeLoewe( treatment1dose = treatment1dose, treatment2dose = treatment2dose, HS_1 = HS_1, HS_2 = HS_2, E_inf_1 = E_inf_1, E_inf_2 = E_inf_2, EC50_1 = EC50_1, EC50_2 = EC50_2 ), by = assayKeys(tre, "combo_viability") ) -> tre ## End(Not run)
By default, logLogisticRegression uses an L-BFGS algorithm to generate the fit. However, if this fails to converge to solution, logLogisticRegression samples lattice points throughout the parameter space. It then uses the lattice point with minimal least-squares residual as an initial guess for the optimal parameters, passes this guess to drm, and re-attempts the optimization. If this still fails, logLogisticRegression uses the PatternSearch algorithm to fit a log-logistic curve to the data.
logLogisticRegression( conc, viability, density = c(2, 10, 5), step = 0.5/density, precision = 1e-04, lower_bounds = c(0, 0, -6), upper_bounds = c(4, 1, 6), scale = 0.07, family = c("normal", "Cauchy"), median_n = 1, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, verbose = TRUE )
logLogisticRegression( conc, viability, density = c(2, 10, 5), step = 0.5/density, precision = 1e-04, lower_bounds = c(0, 0, -6), upper_bounds = c(4, 1, 6), scale = 0.07, family = c("normal", "Cauchy"), median_n = 1, conc_as_log = FALSE, viability_as_pct = TRUE, trunc = TRUE, verbose = TRUE )
conc |
|
viability |
|
density |
|
step |
|
precision |
is a positive real number such that when the ratio of current step size to initial step size falls below it, the PatternSearch algorithm terminates. A smaller value will cause LogisticPatternSearch to take longer to complete optimization, but will produce a more accurate estimate for the fitted parameters. |
lower_bounds |
|
upper_bounds |
|
scale |
is a positive real number specifying the shape parameter of the Cauchy distribution. |
family |
|
median_n |
If the viability points being fit were medians of measurements, they are expected to follow a median of |
conc_as_log |
|
viability_as_pct |
|
trunc |
|
verbose |
|
A list containing estimates for HS, E_inf, and EC50. It is annotated with the attribute Rsquared, which is the R^2 of the fit. Note that this is calculated using the values actually used for the fit, after truncation and any transform applied. With truncation, this will be different from the R^2 compared to the variance of the raw data. This also means that if all points were truncated down or up, there is no variance in the data, and the R^2 may be NaN.
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAUC(dose, viability)
dose <- c(0.0025,0.008,0.025,0.08,0.25,0.8,2.53,8) viability <- c(108.67,111,102.16,100.27,90,87,74,57) computeAUC(dose, viability)
The function computes a Matthews correlation coefficient for two factors provided to the function. It assumes each factor is a factor of class labels, and the enteries are paired in order of the vectors.
mcc(x, y, nperm = 1000, nthread = 1)
mcc(x, y, nperm = 1000, nthread = 1)
x , y
|
|
nperm |
|
nthread |
|
Please note: we recommend you call set.seed() before using this function to ensure the reproducibility of your results. Write down the seed number or save it in a script if you intend to use the results in a publication.
A list with the MCC as the $estimate, and p value as $p.value
x <- factor(c(1,2,1,2,3,1)) y <- factor(c(2,1,1,1,2,2)) mcc(x,y)
x <- factor(c(1,2,1,2,3,1)) y <- factor(c(2,1,1,1,2,2)) mcc(x,y)
This function will test whether the observed partial correlation is significant at a level of req_alpha, doing up to MaxIter permutations. Currently, it supports only grouping by discrete categories when calculating a partial correlation. Currenlty, only does two sided tests.
partialCorQUICKSTOP( pin_x, pin_y, pobsCor, pGroupFactor, pGroupSize, pnumGroup, pMaxIter, pn, preq_alpha, ptolerance_par, plog_decision_boundary, pseed )
partialCorQUICKSTOP( pin_x, pin_y, pobsCor, pGroupFactor, pGroupSize, pnumGroup, pMaxIter, pn, preq_alpha, ptolerance_par, plog_decision_boundary, pseed )
pin_x |
one of the two vectors to correlate. |
pin_y |
the other vector to calculate |
pobsCor |
the observed (partial) correlation between these varaiables |
pGroupFactor |
an integer vector labeling group membership, to correct for in the partial correlation. NEEDS TO BE ZERO BASED! |
pGroupSize |
an integer vector of size length(unique(pGroupFactor)), counting the number of members of each group (basically table(pGroupFactor)) as integer vector |
pnumGroup |
how many groups are there (len(pGroupSize)) |
pMaxIter |
maximum number of iterations to do, as a REAL NUMBER |
pn |
length of x and y, as a REAL NUMBER |
preq_alpha |
the required alpha for significance |
ptolerance_par |
the tolerance region for quickstop. Suggested to be 1/100th of req_alpha' |
plog_decision_boundary |
log (base e) of 1/probability of incorrectly calling significance, as per quickstop paper (used to determine the log-odds) |
pseed |
A numeric vector of length 2, used to seed the internal xoroshiro128+ 1.0 random number generator. Note that currently, these values get modified per call, so pass in a copy if you wish to keep a seed for running same simulation twice |
a double vector of length 4, entry 1 is either 0, 1 (for TRUE/FALSE) or NA_REAL_ for significance determination NA_REAL_ is returned when the MaxIter were reached before a decision is made. Usually, this occurs when the real p value is close to, or falls within the tolerance region of (req_alpha, req_alpha+tolerance_par). Entry 2 is the current p value estimate. entry 3 is the total number of iterations performed. Entry 4 is the number of time a permuted value was larger in absolute value than the observed cor.
A constructor that simplifies the process of creating PharmacoSets, as well as creates empty objects for data not provided to the constructor. Only objects returned by this constructor are expected to work with the PharmacoSet methods. For a much more detailed instruction on creating PharmacoSets, please see the "CreatingPharmacoSet" vignette.
PharmacoSet( name, molecularProfiles = list(), sample = data.frame(), treatment = data.frame(), sensitivityInfo = data.frame(), sensitivityRaw = array(dim = c(0, 0, 0)), sensitivityProfiles = matrix(), sensitivityN = matrix(nrow = 0, ncol = 0), perturbationN = array(NA, dim = c(0, 0, 0)), curationTreatment = data.frame(), curationSample = data.frame(), curationTissue = data.frame(), datasetType = c("sensitivity", "perturbation", "both"), verify = TRUE, ... )
PharmacoSet( name, molecularProfiles = list(), sample = data.frame(), treatment = data.frame(), sensitivityInfo = data.frame(), sensitivityRaw = array(dim = c(0, 0, 0)), sensitivityProfiles = matrix(), sensitivityN = matrix(nrow = 0, ncol = 0), perturbationN = array(NA, dim = c(0, 0, 0)), curationTreatment = data.frame(), curationSample = data.frame(), curationTissue = data.frame(), datasetType = c("sensitivity", "perturbation", "both"), verify = TRUE, ... )
name |
A |
molecularProfiles |
A |
sample |
A |
treatment |
A |
sensitivityInfo |
A |
sensitivityRaw |
A 3 Dimensional |
sensitivityProfiles |
|
sensitivityN , perturbationN
|
A |
curationSample , curationTissue , curationTreatment
|
A |
datasetType |
A |
verify |
|
... |
Catch and parse any renamed constructor arguments. |
An object of class PharmacoSet
## For help creating a PharmacoSet object, please see the following vignette: browseVignettes("PharmacoGx")
## For help creating a PharmacoSet object, please see the following vignette: browseVignettes("PharmacoGx")
PharmacoSet
Documentation for the various setters and getters which allow manipulation
of data in the slots of a PharmacoSet
object.
drugInfo(...) drugInfo(...) <- value drugNames(...) drugNames(...) <- value ## S4 method for signature 'PharmacoSet' annotation(object) ## S4 replacement method for signature 'PharmacoSet,list' annotation(object) <- value ## S4 method for signature 'PharmacoSet' dateCreated(object) ## S4 replacement method for signature 'PharmacoSet,character' dateCreated(object) <- value ## S4 method for signature 'PharmacoSet' name(object) ## S4 replacement method for signature 'PharmacoSet' name(object) <- value ## S4 method for signature 'PharmacoSet' sampleInfo(object) ## S4 replacement method for signature 'PharmacoSet,data.frame' sampleInfo(object) <- value ## S4 method for signature 'PharmacoSet' sampleNames(object) ## S4 replacement method for signature 'PharmacoSet,character' sampleNames(object) <- value ## S4 method for signature 'PharmacoSet' curation(object) ## S4 replacement method for signature 'PharmacoSet,list' curation(object) <- value ## S4 method for signature 'PharmacoSet' datasetType(object) ## S4 replacement method for signature 'PharmacoSet,character' datasetType(object) <- value ## S4 method for signature 'PharmacoSet' molecularProfiles(object, mDataType, assay) ## S4 replacement method for signature 'PharmacoSet,character,character,matrix' molecularProfiles(object, mDataType, assay) <- value ## S4 method for signature 'PharmacoSet' featureInfo(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,data.frame' featureInfo(object, mDataType) <- value ## S4 method for signature 'PharmacoSet,character' phenoInfo(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,data.frame' phenoInfo(object, mDataType) <- value ## S4 method for signature 'PharmacoSet,character' fNames(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,character' fNames(object, mDataType) <- value ## S4 method for signature 'PharmacoSet' mDataNames(object) ## S4 replacement method for signature 'PharmacoSet' mDataNames(object) <- value ## S4 method for signature 'PharmacoSet' molecularProfilesSlot(object) ## S4 replacement method for signature 'PharmacoSet,list_OR_MAE' molecularProfilesSlot(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityInfo(object, dimension, ...) ## S4 replacement method for signature 'PharmacoSet,data.frame' sensitivityInfo(object, dimension, ...) <- value ## S4 method for signature 'PharmacoSet' sensitivityMeasures(object) ## S4 replacement method for signature 'PharmacoSet,character' sensitivityMeasures(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityProfiles(object) ## S4 replacement method for signature 'PharmacoSet,data.frame' sensitivityProfiles(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityRaw(object) ## S4 replacement method for signature 'PharmacoSet,array' sensitivityRaw(object) <- value ## S4 method for signature 'PharmacoSet' treatmentResponse(object) ## S4 replacement method for signature 'PharmacoSet,list_OR_LongTable' treatmentResponse(object) <- value ## S4 method for signature 'PharmacoSet' sensNumber(object) ## S4 replacement method for signature 'PharmacoSet,matrix' sensNumber(object) <- value ## S4 method for signature 'PharmacoSet' pertNumber(object) ## S4 replacement method for signature 'PharmacoSet,array' pertNumber(object) <- value
drugInfo(...) drugInfo(...) <- value drugNames(...) drugNames(...) <- value ## S4 method for signature 'PharmacoSet' annotation(object) ## S4 replacement method for signature 'PharmacoSet,list' annotation(object) <- value ## S4 method for signature 'PharmacoSet' dateCreated(object) ## S4 replacement method for signature 'PharmacoSet,character' dateCreated(object) <- value ## S4 method for signature 'PharmacoSet' name(object) ## S4 replacement method for signature 'PharmacoSet' name(object) <- value ## S4 method for signature 'PharmacoSet' sampleInfo(object) ## S4 replacement method for signature 'PharmacoSet,data.frame' sampleInfo(object) <- value ## S4 method for signature 'PharmacoSet' sampleNames(object) ## S4 replacement method for signature 'PharmacoSet,character' sampleNames(object) <- value ## S4 method for signature 'PharmacoSet' curation(object) ## S4 replacement method for signature 'PharmacoSet,list' curation(object) <- value ## S4 method for signature 'PharmacoSet' datasetType(object) ## S4 replacement method for signature 'PharmacoSet,character' datasetType(object) <- value ## S4 method for signature 'PharmacoSet' molecularProfiles(object, mDataType, assay) ## S4 replacement method for signature 'PharmacoSet,character,character,matrix' molecularProfiles(object, mDataType, assay) <- value ## S4 method for signature 'PharmacoSet' featureInfo(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,data.frame' featureInfo(object, mDataType) <- value ## S4 method for signature 'PharmacoSet,character' phenoInfo(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,data.frame' phenoInfo(object, mDataType) <- value ## S4 method for signature 'PharmacoSet,character' fNames(object, mDataType) ## S4 replacement method for signature 'PharmacoSet,character,character' fNames(object, mDataType) <- value ## S4 method for signature 'PharmacoSet' mDataNames(object) ## S4 replacement method for signature 'PharmacoSet' mDataNames(object) <- value ## S4 method for signature 'PharmacoSet' molecularProfilesSlot(object) ## S4 replacement method for signature 'PharmacoSet,list_OR_MAE' molecularProfilesSlot(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityInfo(object, dimension, ...) ## S4 replacement method for signature 'PharmacoSet,data.frame' sensitivityInfo(object, dimension, ...) <- value ## S4 method for signature 'PharmacoSet' sensitivityMeasures(object) ## S4 replacement method for signature 'PharmacoSet,character' sensitivityMeasures(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityProfiles(object) ## S4 replacement method for signature 'PharmacoSet,data.frame' sensitivityProfiles(object) <- value ## S4 method for signature 'PharmacoSet' sensitivityRaw(object) ## S4 replacement method for signature 'PharmacoSet,array' sensitivityRaw(object) <- value ## S4 method for signature 'PharmacoSet' treatmentResponse(object) ## S4 replacement method for signature 'PharmacoSet,list_OR_LongTable' treatmentResponse(object) <- value ## S4 method for signature 'PharmacoSet' sensNumber(object) ## S4 replacement method for signature 'PharmacoSet,matrix' sensNumber(object) <- value ## S4 method for signature 'PharmacoSet' pertNumber(object) ## S4 replacement method for signature 'PharmacoSet,array' pertNumber(object) <- value
... |
See details. |
value |
See details. |
object |
A |
mDataType |
|
assay |
|
dimension |
See details. |
treatmentInfo: data.frame
Metadata for all treatments in a PharmacoSet
object. Arguments:
object: PharmacoSet
An object to retrieve treatment metadata from.
treatmentInfo<-: PharmacoSet
object with updated treatment metadata.
object. Arguments:
object: PharmacoSet
An object to set treatment metadata for.
value: data.frame
A new table of treatment metadata for object
.
treatmentNames: character
Names for all treatments in a PharmacoSet
object. Arguments:
object: PharmacoSet
An object to retrieve treatment names from.
treatmentNames<-: PharmacoSet
Object with updates treatment names.
object. Arguments:
object: PharmacoSet
An object to set treatment names from.
value: character
A character vector of updated treatment names.
annotation: A list
of PharmacoSet annotations with items: 'name',
the name of the object; 'dateCreated', date the object was created; 'sessionInfo',
the sessionInfo()
when the object was created; 'call', the R constructor call;
and 'version', the object version.
annotation<-: Setter method for the annotation slot. Arguments:
value: a list
of annotations to update the PharmacoSet with.
dateCreated: character(1)
The date the PharmacoSet
object was
created, as returned by the date()
function.
dateCreated<-: Update the 'dateCreated' item in the annotation
slot of
a PharmacoSet
object. Arguments:
value: A character(1)
vector, as returned by the date()
function.
name: character(1)
The name of the PharmacoSet
, retreived from
the @annotation
slot.
name<-: Update the @annotation$name
value in a PharmacoSet
object.
value: character(1)
The name of the PharmacoSet
object.
cellInfo: data.frame
Metadata for all sample in a PharmacoSet
object.
sampleInfo<-: assign updated sample annotations to the PharmacoSet
object.
Arguments:
value: a data.frame
object.
sampleNames: character
Retrieve the rownames of the data.frame
in
the sample
slot from a PharmacoSet object.
sampleNames<-: assign new rownames to the sampleInfo data.frame
for
a PharmacoSet object.
Arguments:
value: character
vector of rownames for the sampleInfo(object)
data.frame
.
curation: A list
of curated mappings between identifiers in the
PharmacoSet object and the original data publication. Contains three data.frame
s, 'cell' with
cell-line ids and 'tissue' with tissue ids and 'drug' with drug ids.
curation<-: Update the curation
slot of a PharmacoSet object. Arugments:
value: A list
of data.frame
s, one for each type of curated
identifier. For a PharmacoSet
object the slot should
contain tissue, cell-line and drug id data.frame
s.
datasetType: character(1)
The type treatment response in the
sensitivity
slot. Valid values are 'sensitivity', 'perturbation' or 'both'.
datasetType<-: Update the datasetType slot of a PharmacoSet object. Arguments:
value: A character(1)
vector with one of 'sensitivity', 'perturbation'
or 'both'
molecularProfiles: matrix()
Retrieve an assay in a
SummarizedExperiment
from the molecularProfiles
slot of a PharmacoSet
object with the specified mDataType
. Valid mDataType
arguments can be
found with mDataNames(object)
. Exclude mDataType
and assay
to
access the entire slot. Arguments:
assay: Optional character(1)
vector specifying an assay in the
SummarizedExperiment
of the molecularProfiles
slot of the
PharmacoSet
object for the specified mDataType
. If excluded,
defaults to modifying the first assay in the SummarizedExperiment
for
the given mDataType
.
molecularProfiles<-: Update an assay in a SummarizedExperiment
from
the molecularProfiles
slot of a PharmacoSet object with the specified
mDataType
. Valid mDataType
arguments can be found with
mDataNames(object)
. Omit mDataType
and assay
to update the slot.
assay: Optional character(1)
vector specifying an assay in the
SummarizedExperiment
of the molecularProfiles
slot of the
PharmacoSet
object for the specified mDataType
. If excluded,
defaults to modifying the first assay in the SummarizedExperiment
for
the given mDataType
.
value: A matrix
of values to assign to the assay
slot of the
SummarizedExperiment
for the selected mDataType
. The rownames and
column names must match the associated SummarizedExperiment
.
featureInfo: Retrieve a DataFrame
of feature metadata for the specified
mDataType
from the molecularProfiles
slot of a PharmacoSet
object. More
specifically, retrieve the @rowData
slot from the SummarizedExperiment
from the @molecularProfiles
of a PharmacoSet
object with the name
mDataType
.
featureInfo<-: Update the featureInfo(object, mDataType)
DataFrame
with new feature metadata. Arguments:
value: A data.frame
or DataFrame
with updated feature metadata for
the specified molecular profile in the molecularProfiles
slot of a
PharmacoSet
object.
phenoInfo: Return the @colData
slot from the SummarizedExperiment
of
mDataType
, containing sample-level metadata, from a PharmacoSet
object.
phenoInfo<-: Update the @colData
slot of the SummarizedExperiment
of mDataType
in the @molecularProfiles
slot of a PharmacoSet
object.
This updates the sample-level metadata in-place.
value: A data.frame
or DataFrame
object where rows are samples
and columns are sample metadata.
fNames: character()
The features names from the rowData
slot of a
SummarizedExperiment
of mDataType
within a PharmacoSet
object.
fNames: Updates the rownames of the feature metadata (i.e., rowData
)
for a SummarizedExperiment
of mDataType
within a PharmacoSet
object.
value: character()
A character vector of new features names for the
rowData
of the SummarizedExperiment
of mDataType
in the
@molecularProfiles
slot of a PharmacoSet
object. Must be the same
length as nrow(featureInfo(object, mDataType))
,
the number of rows in the feature metadata.
mDataNames: character
Retrieve the names of the molecular data types
available in the molecularProfiles
slot of a PharmacoSet
object. These
are the options which can be used in the mDataType
parameter of various
molecularProfiles
slot accessors methods.
mDataNames: Update the molecular data type names of the
molecularProfiles
slot of a PharmacoSet object. Arguments:
value: character
vector of molecular datatype names, with length
equal to length(molecularProfilesSlot(object))
.
molecularProfilesSlot: Return the contents of the @molecularProfiles
slot of a PharmacoSet
object. This will either be a list
or
MultiAssayExperiment
of SummarizedExperiment
s.
molecularProfilesSlot<-: Update the contents of the @molecularProfiles
slot of a PharmacoSet
object. Arguemnts:
value: A list
or MultiAssayExperiment
of SummarizedExperiment
s. The
list
and assays
should be named for the molecular datatype in each
SummarizedExperiment
.
dimension
: Optional character(1)
One of 'treatment', 'sample' or
'assay' to retrieve rowData
, colData
or the 'assay_metadata' assay from
the PharmacoSet
@sensitvity
LongTable
object, respectively. Ignored with
warning if @treatmentResponse
is not a LongTable
object.
...
: Additional arguments to the rowData
or colData
.
LongTable
methods. Only used if the sensitivity slot contains a
LongTable
object instead of a list
and the dimension
argument is
specified.
sensitivityInfo: DataFrame
or data.frame
of sensitivity treatment combo
by sample metadata for the PharmacoSet
object. When the dimension
parameter is used, it allows retrieval of the dimension specific metadata
from the LongTable
object in @treatmentResponse
of a PharmacoSet object.
sensitivityInfo<-: Update the @treatmentResponse
slot metadata for a
PharmacoSet
object. When used without the dimension
argument is behaves
similar to the old PharmacoSet implementation, where the @treatmentResponse
slot
contained a list with a $info
data.frame
item. When the dimension
arugment is used, more complicated assignments can occur where 'sample'
modifies the @sensitvity
LongTable
colData, 'treatment' the rowData and
'assay' the 'assay_metadata' assay.
Arguments:
value: A data.frame
of treatment response experiment metadata,
documenting experiment level metadata (mapping to treatments and samples). If
the @treatmentResponse
slot doesn't contain a LongTable
and dimension
is
not specified, you can only modify existing columns as returned by
sensitivityInfo(object)
.
sensitivityMeaures: Get the 'sensitivityMeasures' available in a PharmacoSet
object. Each measure reprents some summary of sample sensitivity to a given
treatment, such as ic50, ec50, AUC, AAC, etc. The results are returned as a
character
vector with all available metrics for the PSet object.
sensitivityMeaures: Update the sensitivity meaure in a PharmacoSet
object. Thesee values are the column names of the 'profiles' assay and
represent various compued sensitviity metrics such as ic50, ec50, AUC, AAC,
etc.
value: A character
vector of new sensitivity measure names, the
then length of the character vector must matcht he number of columns of the
'profiles' assay, excluding metadata and key columns.
sensitivityProfiles: Return the sensitivity profile summaries from the sensitivity slot. This data.frame cotanins vaarious sensitivity summary metrics, such as ic50, amax, EC50, aac, HS, etc as columns, with rows as treatment by sample experiments.
sensitivityProfiles<-: Update the sensitivity profile summaries the
sensitivity slot. Arguments:
-value: A data.frame
the the same number of rows as as returned by
sensitivityProfiles(object)
, but potentially modified columns, such as the
computation of additional summary metrics.
sensitivityRaw: Access the raw sensitiity measurents for a PharmacoSet
object. A 3D array
where rows are experiment_ids, columns are doses
and the third dimension is metric, either 'Dose' for the doses used or
'Viability' for the sample viability at that dose.
sensitvityRaw<-: Update the raw dose and viability data in a PharmacoSet
.
value: A 3D array
object where rows are experiment_ids, columns are
replicates and pages are c('Dose', 'Viability'), with the corresponding
dose or viability measurement for that experiment_id and replicate.
sensNumber: Return a count of viability observations in a PharmacoSet
object for each treatment-combo by sample combination.
sensNumber<-: Update the 'n' item, which holds a matrix with a count
of treatment by sample-line experiment counts, in the list
in @treatmentResponse
slot of a PharmacoSet
object. Will error when @sensitviity
contains
a LongTable
object, since the counts are computed on the fly. Arguments:
value: A matrix
where rows are samples and columns are treatments, with a
count of the number of experiments for each combination as the values.
pertNumber: array
Summary of available perturbation experiments
from in a PharmacoSet
object. Returns a 3D array
with the number of
perturbation experiments per treatment and sample, and data type.
pertNumber<-: Update the @perturbation$n
value in a PharmacoSet
object,
which stores a summary of the available perturbation experiments. Arguments:
value: A new 3D array
with the number of perturbation experiments per
treatment and sample, and data type
Accessors: See details.
Setters: An updated PharmacoSet
object, returned invisibly.
data(CCLEsmall) treatmentInfo(CCLEsmall) treatmentInfo(CCLEsmall) <- treatmentInfo(CCLEsmall) treatmentNames(CCLEsmall) treatmentNames(CCLEsmall) <- treatmentNames(CCLEsmall) ## @annotation annotation(CCLEsmall) annotation(CCLEsmall) <- annotation(CCLEsmall) dateCreated(CCLEsmall) ## dateCreated dateCreated(CCLEsmall) <- date() name(CCLEsmall) name(CCLEsmall) <- 'new_name' sampleInfo(CCLEsmall) <- sampleInfo(CCLEsmall) sampleNames(CCLEsmall) sampleNames(CCLEsmall) <- sampleNames(CCLEsmall) ## curation curation(CCLEsmall) curation(CCLEsmall) <- curation(CCLEsmall) datasetType(CCLEsmall) datasetType(CCLEsmall) <- 'both' # No assay specified molecularProfiles(CCLEsmall, 'rna') <- molecularProfiles(CCLEsmall, 'rna') # Specific assay molecularProfiles(CCLEsmall, 'rna', 'exprs') <- molecularProfiles(CCLEsmall, 'rna', 'exprs') # Replace the whole slot molecularProfiles(CCLEsmall) <- molecularProfiles(CCLEsmall) featureInfo(CCLEsmall, 'rna') featureInfo(CCLEsmall, 'rna') <- featureInfo(CCLEsmall, 'rna') phenoInfo(CCLEsmall, 'rna') phenoInfo(CCLEsmall, 'rna') <- phenoInfo(CCLEsmall, 'rna') fNames(CCLEsmall, 'rna') fNames(CCLEsmall, 'rna') <- fNames(CCLEsmall, 'rna') mDataNames(CCLEsmall) mDataNames(CCLEsmall) <- mDataNames(CCLEsmall) molecularProfilesSlot(CCLEsmall) molecularProfilesSlot(CCLEsmall) <- molecularProfilesSlot(CCLEsmall) sensitivityInfo(CCLEsmall) sensitivityInfo(CCLEsmall) <- sensitivityInfo(CCLEsmall) sensitivityMeasures(CCLEsmall) <- sensitivityMeasures(CCLEsmall) sensitivityMeasures(CCLEsmall) <- sensitivityMeasures(CCLEsmall) sensitivityProfiles(CCLEsmall) sensitivityProfiles(CCLEsmall) <- sensitivityProfiles(CCLEsmall) head(sensitivityRaw(CCLEsmall)) sensitivityRaw(CCLEsmall) <- sensitivityRaw(CCLEsmall) treatmentResponse(CCLEsmall) treatmentResponse(CCLEsmall) <- treatmentResponse(CCLEsmall) sensNumber(CCLEsmall) sensNumber(CCLEsmall) <- sensNumber(CCLEsmall) pertNumber(CCLEsmall) pertNumber(CCLEsmall) <- pertNumber(CCLEsmall)
data(CCLEsmall) treatmentInfo(CCLEsmall) treatmentInfo(CCLEsmall) <- treatmentInfo(CCLEsmall) treatmentNames(CCLEsmall) treatmentNames(CCLEsmall) <- treatmentNames(CCLEsmall) ## @annotation annotation(CCLEsmall) annotation(CCLEsmall) <- annotation(CCLEsmall) dateCreated(CCLEsmall) ## dateCreated dateCreated(CCLEsmall) <- date() name(CCLEsmall) name(CCLEsmall) <- 'new_name' sampleInfo(CCLEsmall) <- sampleInfo(CCLEsmall) sampleNames(CCLEsmall) sampleNames(CCLEsmall) <- sampleNames(CCLEsmall) ## curation curation(CCLEsmall) curation(CCLEsmall) <- curation(CCLEsmall) datasetType(CCLEsmall) datasetType(CCLEsmall) <- 'both' # No assay specified molecularProfiles(CCLEsmall, 'rna') <- molecularProfiles(CCLEsmall, 'rna') # Specific assay molecularProfiles(CCLEsmall, 'rna', 'exprs') <- molecularProfiles(CCLEsmall, 'rna', 'exprs') # Replace the whole slot molecularProfiles(CCLEsmall) <- molecularProfiles(CCLEsmall) featureInfo(CCLEsmall, 'rna') featureInfo(CCLEsmall, 'rna') <- featureInfo(CCLEsmall, 'rna') phenoInfo(CCLEsmall, 'rna') phenoInfo(CCLEsmall, 'rna') <- phenoInfo(CCLEsmall, 'rna') fNames(CCLEsmall, 'rna') fNames(CCLEsmall, 'rna') <- fNames(CCLEsmall, 'rna') mDataNames(CCLEsmall) mDataNames(CCLEsmall) <- mDataNames(CCLEsmall) molecularProfilesSlot(CCLEsmall) molecularProfilesSlot(CCLEsmall) <- molecularProfilesSlot(CCLEsmall) sensitivityInfo(CCLEsmall) sensitivityInfo(CCLEsmall) <- sensitivityInfo(CCLEsmall) sensitivityMeasures(CCLEsmall) <- sensitivityMeasures(CCLEsmall) sensitivityMeasures(CCLEsmall) <- sensitivityMeasures(CCLEsmall) sensitivityProfiles(CCLEsmall) sensitivityProfiles(CCLEsmall) <- sensitivityProfiles(CCLEsmall) head(sensitivityRaw(CCLEsmall)) sensitivityRaw(CCLEsmall) <- sensitivityRaw(CCLEsmall) treatmentResponse(CCLEsmall) treatmentResponse(CCLEsmall) <- treatmentResponse(CCLEsmall) sensNumber(CCLEsmall) sensNumber(CCLEsmall) <- sensNumber(CCLEsmall) pertNumber(CCLEsmall) pertNumber(CCLEsmall) <- pertNumber(CCLEsmall)
The PharmacoSet (pSet) class was developed to contain and organise large PharmacoGenomic datasets, and aid in their metanalysis. It was designed primarily to allow bioinformaticians and biologists to work with data at the level of genes, drugs and cell lines, providing a more naturally intuitive interface and simplifying analyses between several datasets. As such, it was designed to be flexible enough to hold datasets of two different natures while providing a common interface. The class can accomidate datasets containing both drug dose response data, as well as datasets contaning genetic profiles of cell lines pre and post treatement with compounds, known respecitively as sensitivity and perturbation datasets.
object |
A |
mDataType |
A |
value |
A replacement value |
An object of the PharmacoSet class
annotation
A list
of annotation data about the PharmacoSet,
including the $name
and the session information for how the object
was creating, detailing the exact versions of R and all the packages used
molecularProfiles
A list
containing SummarizedExperiment
type object for holding data for RNA, DNA, SNP and CNV
measurements, with associated fData
and pData
containing the row and column metadata
sample
A data.frame
containing the annotations for all the cell
lines profiled in the data set, across all data types
treatment
A data.frame
containg the annotations for all the drugs
profiled in the data set, across all data types
treatmentResponse
A list
containing all the data for the
sensitivity experiments, including $info
, a data.frame
containing the experimental info,$raw
a 3D array
containing
raw data, $profiles
, a data.frame
containing sensitivity
profiles statistics, and $n
, a data.frame
detailing the
number of experiments for each cell-drug pair
perturbation
A list
containting $n
, a data.frame
summarizing the available perturbation data,
curation
A list
containing mappings for $treatment
,
cell
, tissue
names used in the data set to universal
identifiers used between different PharmacoSet objects
datasetType
A character
string of 'sensitivity',
'perturbation', or both detailing what type of data can be found in the
PharmacoSet, for proper processing of the data
PharmacoSet
object.Documentation for utility methods for a PharmacoSet
object, such as
set operations like subset and intersect. See @details for information
on different types of methods and their implementations.
## S4 method for signature 'PharmacoSet' subsetBySample(x, samples) ## S4 method for signature 'PharmacoSet' subsetByTreatment(x, treatments) ## S4 method for signature 'PharmacoSet' subsetByFeature(x, features, mDataTypes)
## S4 method for signature 'PharmacoSet' subsetBySample(x, samples) ## S4 method for signature 'PharmacoSet' subsetByTreatment(x, treatments) ## S4 method for signature 'PharmacoSet' subsetByFeature(x, features, mDataTypes)
x |
A |
samples |
|
treatments |
|
features |
|
mDataTypes |
|
subsetBySample: Subset a PharmacoSet
object by sample identifier.
value: a PharmacoSet
object containing only samples
.
subsetByTreatment: Subset a PharmacoSet
object by treatment identifier.
value: a PharmacoSet
object containing only treatments
.
subsetByFeature: Subset a PharmacoSet
object by molecular feature
identifier.
value: a PharmacoSet
object containing only features
.
See details.
data(CCLEsmall) ## subset methods ### subsetBySample samples <- sampleInfo(CCLEsmall)$sampleid[seq_len(10)] CCLEsmall_sub <- subsetBySample(CCLEsmall, samples) ## subset methods ### subsetByTreatment #treatments <- drugInfo(CCLEsmall)$drugid[seq_len(10)] #CCLEsmall_sub <- subsetByTreatment(CCLEsmall, treatments) ## subset methods ### subsetByFeature features <- fNames(CCLEsmall, 'rna')[seq_len(5)] CCLEsmall_sub <- subsetByFeature(CCLEsmall, features, 'rna')
data(CCLEsmall) ## subset methods ### subsetBySample samples <- sampleInfo(CCLEsmall)$sampleid[seq_len(10)] CCLEsmall_sub <- subsetBySample(CCLEsmall, samples) ## subset methods ### subsetByTreatment #treatments <- drugInfo(CCLEsmall)$drugid[seq_len(10)] #CCLEsmall_sub <- subsetByTreatment(CCLEsmall, treatments) ## subset methods ### subsetByFeature features <- fNames(CCLEsmall, 'rna')[seq_len(5)] CCLEsmall_sub <- subsetByFeature(CCLEsmall, features, 'rna')
New implementation of the CoreSet constructor to support MAE and TRE. This
constructor will be swapped with the original CoreSet
constructor as
part of an overhaul of the CoreSet class structure.
PharmacoSet2( name = "emptySet", treatment = data.frame(), sample = data.frame(), molecularProfiles = MultiAssayExperiment(), treatmentResponse = TreatmentResponseExperiment(), perturbation = list(), curation = list(sample = data.frame(), treatment = data.frame(), tissue = data.frame()), datasetType = "sensitivity" )
PharmacoSet2( name = "emptySet", treatment = data.frame(), sample = data.frame(), molecularProfiles = MultiAssayExperiment(), treatmentResponse = TreatmentResponseExperiment(), perturbation = list(), curation = list(sample = data.frame(), treatment = data.frame(), tissue = data.frame()), datasetType = "sensitivity" )
name |
A |
treatment |
A |
sample |
A |
molecularProfiles |
A |
treatmentResponse |
A |
perturbation |
A deprecated slot in a |
curation |
This class requires an additional curation item, tissue, which maps from published to standardized tissue idenifiers. |
datasetType |
A deprecated slot in a |
A CoreSet
object storing standardized and curated treatment
response and multiomic profile data associated with a given publication.
data(CCLEsmall) CCLEsmall
data(CCLEsmall) CCLEsmall
Contructor for the PharmacoSig S4 class
PharmacoSig( Data = array(NA, dim = c(0, 0, 0)), PSetName = "", DateCreated = date(), SigType = "sensitivity", SessionInfo = sessionInfo(), Call = "No Call Recorded", Arguments = list() )
PharmacoSig( Data = array(NA, dim = c(0, 0, 0)), PSetName = "", DateCreated = date(), SigType = "sensitivity", SessionInfo = sessionInfo(), Call = "No Call Recorded", Arguments = list() )
Data |
of data to build the signature from |
PSetName |
|
DateCreated |
|
SigType |
|
SessionInfo |
|
Call |
|
Arguments |
|
A PharmacoSig
object build from the provided signature data
PharmacoSig()
PharmacoSig()
Given a PharmacoSig, this will plot a volcano plot, with parameters to set cutoffs for a significant effect size, p value, to pick multiple testing correction strategy, and to change point colors. Built on top of ggplot, it will return the plot object which can be easily customized as any other ggplot.
## S3 method for class 'PharmacoSig' plot( x, adjust.method, drugs, features, effect_cutoff, signif_cutoff, color, ... )
## S3 method for class 'PharmacoSig' plot( x, adjust.method, drugs, features, effect_cutoff, signif_cutoff, color, ... )
x |
|
adjust.method |
|
drugs |
|
features |
|
effect_cutoff |
the cutoff to use for coloring significant effect sizes. |
signif_cutoff |
the cutoff to use for coloring significance by p value or adjusted p values. Not on log scale. |
color |
one color if no cutoffs set for plotting. A vector of colors otherwise used to color points the in three categories above. |
... |
additional arguments, not currently used, but left here for consistency with plot |
returns a ggplot object, which by default will be evaluated and the plot displayed, or can be saved to a variable for further customization by adding ggplot elements to the returned graph
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) plot(drug.sensitivity)
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) plot(drug.sensitivity)
Show a PharamcoSet
## S4 method for signature 'PharmacoSet' show(object)
## S4 method for signature 'PharmacoSet' show(object)
object |
|
Prints the PharmacoSet object to the output stream, and returns invisible NULL.
@importFrom CoreGx show @importFrom methods callNextMethod
data(CCLEsmall) CCLEsmall
data(CCLEsmall) CCLEsmall
Show PharmacoGx Signatures
## S4 method for signature 'PharmacoSig' show(object)
## S4 method for signature 'PharmacoSig' show(object)
object |
|
Prints the PharmacoGx Signatures object to the output stream, and returns invisible NULL.
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) drug.sensitivity
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) drug.sensitivity
This funtion prints out the information about the call used to compute the drug signatures, and the session info for the session in which the computation was done. Useful for determining the exact conditions used to generate signatures.
## S4 method for signature 'PharmacoSig' showSigAnnot(object)
## S4 method for signature 'PharmacoSig' showSigAnnot(object)
object |
An object of the |
Prints the PharmacoGx Signatures annotations to the output stream, and returns invisible NULL.
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) showSigAnnot(drug.sensitivity)
data(GDSCsmall) drug.sensitivity <- drugSensitivitySig(GDSCsmall, mDataType="rna", nthread=1, features = fNames(GDSCsmall, "rna")[1]) showSigAnnot(drug.sensitivity)
This is the prefered method of subsetting a PharmacoSet. This function allows abstraction of the data to the level of biologically relevant objects: drugs and cells. The function will automatically go through all of the combined data in the PharmacoSet and ensure only the requested drugs and cell lines are found in any of the slots. This allows quickly picking out all the experiments for a drug or cell of interest, as well removes the need to keep track of all the metadata conventions between different datasets.
## S4 method for signature 'PharmacoSet' subsetTo( object, cells = NULL, drugs = NULL, molecular.data.cells = NULL, keep.controls = TRUE, ... )
## S4 method for signature 'PharmacoSet' subsetTo( object, cells = NULL, drugs = NULL, molecular.data.cells = NULL, keep.controls = TRUE, ... )
object |
A |
cells |
A list or vector of cell names as used in the dataset to which the object will be subsetted. If left blank, then all cells will be left in the dataset. |
drugs |
A list or vector of drug names as used in the dataset to which the object will be subsetted. If left blank, then all drugs will be left in the dataset. |
molecular.data.cells |
A list or vector of cell names to keep in the molecular data |
keep.controls |
If the dataset has perturbation type experiments, should the controls be kept in the dataset? Defaults to true. |
... |
Other arguments passed by other function within the package |
A PharmacoSet with only the selected drugs and cells
data(CCLEsmall) CCLEdrugs <- treatmentNames(CCLEsmall) CCLEcells <- sampleNames(CCLEsmall) pSet <- subsetTo(CCLEsmall, drugs = CCLEdrugs[1], cells = CCLEcells[1]) pSet
data(CCLEsmall) CCLEdrugs <- treatmentNames(CCLEsmall) CCLEcells <- sampleNames(CCLEsmall) pSet <- subsetTo(CCLEsmall, drugs = CCLEdrugs[1], cells = CCLEcells[1]) pSet
This function creates a table with cell lines as rows and drugs as columns, summarising the drug senstitivity data of a PharmacoSet into drug-cell line pairs
## S4 method for signature 'PharmacoSet' summarizeSensitivityProfiles( object, sensitivity.measure = "auc_recomputed", cell.lines, profiles_assay = "profiles", treatment_col = "treatmentid", sample_col = "sampleid", drugs, summary.stat = c("mean", "median", "first", "last", "max", "min"), fill.missing = TRUE, verbose = TRUE )
## S4 method for signature 'PharmacoSet' summarizeSensitivityProfiles( object, sensitivity.measure = "auc_recomputed", cell.lines, profiles_assay = "profiles", treatment_col = "treatmentid", sample_col = "sampleid", drugs, summary.stat = c("mean", "median", "first", "last", "max", "min"), fill.missing = TRUE, verbose = TRUE )
object |
PharmacoSet The PharmacoSet from which to extract the data |
sensitivity.measure |
character The sensitivity measure to use. Use the sensitivityMeasures function to find out what measures are available for each object. |
cell.lines |
character The cell lines to be summarized. If any cell lines have no data, they will be filled with missing values. |
profiles_assay |
character The name of the assay in the PharmacoSet object that contains the sensitivity profiles. |
treatment_col |
character The name of the column in the profiles assay that contains the treatment IDs. |
sample_col |
character The name of the column in the profiles assay that contains the sample IDs. |
drugs |
character The drugs to be summarized. If any drugs have no data, they will be filled with missing values. |
summary.stat |
character The summary method to use if there are repeated cell line-drug experiments. Choices are "mean", "median", "first", "last", "max", or "min". |
fill.missing |
Should the missing cell lines not in the molecular data object be filled in with missing values? |
verbose |
Should the function print progress messages? |
matrix A matrix with cell lines going down the rows, drugs across the columns, with the selected sensitivity statistic for each pair.
data(GDSCsmall) GDSCauc <- summarizeSensitivityProfiles(GDSCsmall, sensitivity.measure='auc_published')
data(GDSCsmall) GDSCauc <- summarizeSensitivityProfiles(GDSCsmall, sensitivity.measure='auc_published')
Update the PharmacoSet class after changes in it struture or API
## S4 method for signature 'PharmacoSet' updateObject(object)
## S4 method for signature 'PharmacoSet' updateObject(object)
object |
A |
PharmacoSet
with update class structure.
data(GDSCsmall) updateObject(GDSCsmall)
data(GDSCsmall) updateObject(GDSCsmall)