| Title: | A pipeline for processing drug sensitivity screen data |
|---|---|
| Description: | DrugScreenExplorer is a comprehensive R package designed for streamlined processing, quality control, and interactive visualization of high-throughput drug sensitivity screen data. It offers a suite of functions that enable users to efficiently read, assemble, and normalize drug screen datasets. Additionally, the package supports the estimation and correction of edge effect intensity, the summarization of drug responses across concentrations, and a variety of visualization options. To enhance usability, DrugScreenExplorer incorporates an R Shiny application, providing a user-friendly graphical interface that facilitates data analysis, even for those with limited programming experience. DrugScreenExplorer serves as a valuable resource for pharmacologists and biomedical researchers working with large-scale drug screening datasets. |
| Authors: | Forrest Hyde [aut] (ORCID: <https://orcid.org/0009-0006-3288-4965>), Shuo Wang [aut, cre], Junyan Lu [aut] |
| Maintainer: | Shuo Wang <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.99.0 |
| Built: | 2026-11-30 10:09:36 UTC |
| Source: | https://github.com/BiocStaging/DrugScreenExplorer |
This function defines the server-side logic for the DrugScreenExplorer Shiny application. It handles data processing, visualization, and user interactions for drug screening analysis.
.buildServer(...).buildServer(...)
... |
additional arguments |
Shiny server function
Creates the complete Shiny user interface for the DrugScreenExplorer application. This function builds a multi-tab navigation interface for drug screening data analysis.
.buildUI(...).buildUI(...)
... |
additinal argument |
A Shiny UI object (typically 'shiny.tag' or 'shiny.tag.list') containing the application layout.
This function constructs a Shiny app object by combining a user interface (UI) component and a server function.
buildApp(...)buildApp(...)
... |
Additional parameters passed to both '.build_ui()' and '.build_server()' functions. The specific parameters available depend on the implementation of these internal builder functions. |
This interactive web interface provides comprehensive access to all package functionality through an intuitive graphical user interface. Designed for users of all skill levels, the application enables complete analysis of drug screening experiments - from data import to response effect calculation - through a streamlined point-and-click workflow.
A Shiny application object ('shiny.appobj') that can be run using 'shiny::runApp()'. This object contains both the UI definition and server logic required to execute the application.
# Build the Shiny application app <- buildApp() # Run the application if (interactive()) { shiny::runApp(app) }# Build the Shiny application app <- buildApp() # Run the application if (interactive()) { shiny::runApp(app) }
This function subtract the incubation (or edge) effect from the observed
signal intensity to recover the true signal intensity. If the incubation
effect has already been estimated by fitEdgeEffect() function,
the values in the edgeFactor column will be used. Otherwise, this function
will first call fitEdgeEffect() function to estimate the edge effect.
correctEdgeEffect( screenData, estimateMethod = "loess", useNeg = TRUE, useLowConcentrations = 0L, span = 1, correctMethod = "bliss", exclude = c() )correctEdgeEffect( screenData, estimateMethod = "loess", useNeg = TRUE, useLowConcentrations = 0L, span = 1, correctMethod = "bliss", exclude = c() )
screenData |
a data frame containing screening results generated by
|
estimateMethod |
a character string specifying the method used for estimating the shape and strength of edge effect. Currently two methods are supported: 'loess', which uses a local regression model to estimate edge effect; 'sigmoid', an experimental feature, which uses use a 2D-sigmoid model to estimate edge effect. The "loess" method is suitable for both regular incubation effect, such as edge effect, and irregular incubation effect. But sometimes it tends to over-smooth the edge effect when the edge effect is rectangular. In this case, "sigmoid" method can better capture the shape of edge effect. But the "sigmoid" method can not deal with incubation effect with irregular shape. |
useNeg |
a logical value. If TRUE, only negative controls are used to estimate edge effect. Otherwise, all the wells are used for edge effect estimation. |
useLowConcentrations |
a integer value. In addition to negative controls, sample wells with low concentrations of compounds can be considered as 'de facto' negative controls and included in edge effect estimation. The default value is 0, means no sample wells are used. If the value n >= 1, the n lowest concentrations will be used. |
span |
a numeric value. The span parameter for |
correctMethod |
a character string specifying the method used for
adjusting the edge effect. Currently two methods 'bliss' and 'linear' are
supported.
If |
exclude |
a list of samples that should be excluded when performing edge effect correction |
This function will add one column, normVal.cor, which is the
normalized viability corrected for incubation/edge effect, to the input data
frame.
# load drug screen dataset data('screenData_normalized') screenData_corrected <- correctEdgeEffect(screenData_normalized, estimateMethod = 'loess', useNeg = TRUE, useLowConcentrations = 0, span =1, correctMethod = 'bliss')# load drug screen dataset data('screenData_normalized') screenData_corrected <- correctEdgeEffect(screenData_normalized, estimateMethod = 'loess', useNeg = TRUE, useLowConcentrations = 0, span =1, correctMethod = 'bliss')
This function creates a tab-separated values (tsv) file required for
annotating plates, for example, the sample ID or patient ID for each plate.
Users can use the file created by this function as a starting point for
preparing the plate annotation file required by the readScreen()
function. Users can also prepare the plate annotation file from scratch, as
long as it follows the format requirement. More information is available in
the package vignette.
createPlateInput(rawDir, file, entries = c(), batchAsFolder = FALSE)createPlateInput(rawDir, file, entries = c(), batchAsFolder = FALSE)
rawDir |
a character string specifying the directory of the raw data folder |
file |
the output file name and path for the plate annotation file |
entries |
a vector of character strings to use as the column names in the plate annotation file (optional) |
batchAsFolder |
a logical value, whether the raw data from different
batches are stored in different sub-folders.
The default value is |
This function creates a tab-separated values (tsv) file in the working directory.
# create a template for plate annotation file rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') createPlateInput(rawDir = rawFolder, file = 'plateAnno.tsv', entries = c('sampleID', 'patientID')) # see vignette for more instructions# create a template for plate annotation file rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') createPlateInput(rawDir = rawFolder, file = 'plateAnno.tsv', entries = c('sampleID', 'patientID')) # see vignette for more instructions
This function prepares the data used in the Shiny Application. It gathers raw data files, plate annotation, and well annotation files, organizes them into a specific directory structure within a temporary location, and then compresses this structure into a zip archive.
createShinyData( rawDir, plateAnnotationFile, wellAnnotationFile, dir = ".", filename = "ShinyData" )createShinyData( rawDir, plateAnnotationFile, wellAnnotationFile, dir = ".", filename = "ShinyData" )
rawDir |
a character string specifying the location of the raw data folder. |
plateAnnotationFile |
a character string specifying the location of the plate annotation file. |
wellAnnotationFile |
a character string specifying the location of the well annotation file. |
dir |
A character string specifying the path to the output directory where the final zip file will be saved. Defaults to the current working directory ('.'). |
filename |
a character string specify the zipped file name. defaulted as "ShinyData" |
NULL (invisibly). The function primarily works via side effects, creating a zip file in the specified output directory ('dir'). It prints messages to the console indicating the progress and success/failure of file copying operations.
rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') createShinyData(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile) # return a zipped file names as "ShinyData.zip" in the working directoryrawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') createShinyData(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile) # return a zipped file names as "ShinyData.zip" in the working directory
This function creates a tab-separated values (tsv) file required for
annotating wells on drug screening plate, for example, the name of the drug
or drug concentration in each well.
Users can use the file created by this function as a starting point for
preparing the well annotation file required by the readScreen()
function. Users can also prepare the well annotation file from scratch, as
long as it follows the format requirement. More information is available in
the package vignette.
createWellInput( file, colNum, rowNum, entries = c("drug", "concentration", "drug2", "concentration2"), platePerSample = 1 )createWellInput( file, colNum, rowNum, entries = c("drug", "concentration", "drug2", "concentration2"), platePerSample = 1 )
file |
the output file name and directory for the sample annotation file |
colNum |
the number of columns on the plate, will be labeled by numeric numbers |
rowNum |
the number of rows on the plate, will be labeled by alphabets |
entries |
a vector of characters to use as the column names in the drug file (optional). Allow drug combination by using "name" and "name1". |
platePerSample |
a numeric value indicates the number of plates used for each sample in the screen. The default value is 1. |
This function creates a tab-separated values (tsv) file in the working directory.
# create a template for well annotation file createWellInput(file = 'wellAnno.tsv', colNum = 24, rowNum = 16, entries = c('drug', 'concentration')) # see vignette for more instructions# create a template for well annotation file createWellInput(file = 'wellAnno.tsv', colNum = 24, rowNum = 16, entries = c('drug', 'concentration')) # see vignette for more instructions
This function estimates the intensity of edge effect on each screen plate by comparing the median signal intensities on the edge to those on the inner plate. The results will be shown as a bar plot with plate IDs as x-axis and edge effect intensities as y-axis.
estimateEdgeEffect( screenData, nLayer = 1, onlyNeg = TRUE, identifier = "fileName", pdfName = NULL )estimateEdgeEffect( screenData, nLayer = 1, onlyNeg = TRUE, identifier = "fileName", pdfName = NULL )
screenData |
a data frame containing the screening results generated by
|
nLayer |
an integer value (larger than 1), which indicates up to how many layers on the edge of the screen are considered as edges. The default value is 1. |
onlyNeg |
a logical value, whether only wells annotated as negative
controls are used for edge effect estimation.
If |
identifier |
a character string specifying the column in the input data frame that should be used as identifiers (x-axis) in the plot. Default value is "fileName". If one identifier matches several plates, error bars indicating standard deviations will be shown in the plot. |
pdfName |
either NULL or a character string specifying the output file name for the plot in pdf format. If NULL, no plot will be created. |
Depends on the number N specified with the nLayer
argument, this function will add N columns with the names edgeRatio1,
edgeRatio2, ... edgeRationN. Each column contains the estimated edge
effect intensity when considering the N outer layers on the plate as
edge layers.
If a file name is specified for the pdfName argument, a pdf file that
contains a bar plot visualizing the edge effect intensity will be created in
the working directly.
# load processed data data('screenData_normalized') # estimate the intensity of edge effect. # The wells from the first outside layer on the plate will be defined as the # edge wells. estimateEdgeEffect(screenData_normalized, nLayer = 1) # Please see the vignette for more information.# load processed data data('screenData_normalized') # estimate the intensity of edge effect. # The wells from the first outside layer on the plate will be defined as the # edge wells. estimateEdgeEffect(screenData_normalized, nLayer = 1) # Please see the vignette for more information.
This function fits a 2D surface using either loess (local regression) model or a 2D sigmod model based on the measurements on each plate to estimate the shape and strength of per-plate incubation effect. This function is normally called by the correctEdgeEffect() function instead of used as a standalone function.
fitEdgeEffect( screenData, method = "loess", useNeg = TRUE, useLowConcentrations = 0L, span = 1, exclude = c() )fitEdgeEffect( screenData, method = "loess", useNeg = TRUE, useLowConcentrations = 0L, span = 1, exclude = c() )
screenData |
the data frame containing screen results generated by
|
method |
a character string specifying the method used for estimating the shape and strength of edge effect. Currently two methods are supported: 'loess', which uses local regression to estimate edge effect; 'sigmoid', a experimental feature, using 2D-sigmoid model to estimate edge effect. |
useNeg |
a logical value. If TRUE, only negative controls are used to estimate edge effect. Otherwise, all the wells are used for edge effect estimation. |
useLowConcentrations |
an integer value. In addition to negative controls, sample wells with low concentrations of drugs or other perturbators can be considered as 'de facto' negative controls and included in edge effect estimation. The default value is 0, means no sample wells are used. If the value n >= 1, the n lowest concentrations will be used. |
span |
a numeric value. The span parameter for loess, which controls the degree of smoothing. |
exclude |
a list of samples that should be excluded when performing edge effect correction. Both plate file names or sampleIDs can be used as identifiers. |
This function will add one column, edgeFactor, which is the
estimated incubation or edge effect, to the input data frame.
# load drug screen dataset data('screenData_normalized') screenData_fitted <- fitEdgeEffect(screenData_normalized, method = 'loess', useNeg = TRUE)# load drug screen dataset data('screenData_normalized') screenData_fitted <- fitEdgeEffect(screenData_normalized, method = 'loess', useNeg = TRUE)
Use the dr4pl package to perform IC50 curve fitting. The outputs can be directly used for geom_smooth() in ggplot2.
fitIC50(formula, data = NULL, weights = NULL, logDose = NULL, ...)fitIC50(formula, data = NULL, weights = NULL, logDose = NULL, ...)
formula |
formula for the curve fitting in the form of 'response ~ concentration'. |
data |
a data frame that contains concentration values and normalized viability values or percent inhibition values. |
weights |
not used, mainly for geom_smooth() purpose. |
logDose |
a numeric value indicates the base of a log function if concentrations have been log-transformed. The argument will transform the concentrations back. The default value is NULL (indicating no log transformation has been applied). |
... |
further arguments to be passed to dr4pl function in dr4pl package. |
fitIC50 returns an object of class 'fitIC50', which is a list containing the following components:
model |
the input dose-response table |
formula |
the formula used for the model fitting |
parm_fit |
the fitted parameters for a 4-paramater logistic model |
logDose |
a numeric value specifying the base of log transformation for concentration, if the concentration is log transformed. The default value is NULL (not log transformed). |
# create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # fit a four-parameter logistic model using dr4pl package fitIC50(viability ~ concentration, data = doseTab)# create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # fit a four-parameter logistic model using dr4pl package fitIC50(viability ~ concentration, data = doseTab)
This function generates a customized Rmarkdown based html report for priliminary quality assurance.
makeReport( screenData, dir = ".", showCode = FALSE, title = "Report for my drug screening project", author = "Author Name", ifPlatePlot = FALSE )makeReport( screenData, dir = ".", showCode = FALSE, title = "Report for my drug screening project", author = "Author Name", ifPlatePlot = FALSE )
screenData |
a data table that contains the screen results generated
by |
dir |
a character string specifying the directory in which the report will be generated. By default, the report is created in the current working directory. |
showCode |
if |
title |
a character string specifying the title for the html report |
author |
a character string specifying the author name |
ifPlatePlot |
Logical; if |
An HTML report named report.html created within a subdirectory
named report inside the specified (or default) directory.
# load processed data data(screenData_normalized) # make html report makeReport(screenData_normalized, showCode = TRUE, title = 'Report example', author = 'Author Name', ifPlatePlot = FALSE)# load processed data data(screenData_normalized) # make html report makeReport(screenData_normalized, showCode = TRUE, title = 'Report example', author = 'Author Name', ifPlatePlot = FALSE)
This function prepares a self-contained directory structure for a Shiny application designed for drug screen analysis. It processes the input data, bundles it, and includes the necessary Shiny application script ('shinyAPP.R').
The resulting 'shiny' directory contains everything needed to launch an interactive web interface. This interface provides comprehensive access to the 'DrugScreenExplorer' package functionality through an intuitive graphical user interface (GUI), enabling analysis workflows from data import to response effect calculation via point-and-click.
makeShiny(rawDir, plateAnnotationFile, wellAnnotationFile, dir = ".")makeShiny(rawDir, plateAnnotationFile, wellAnnotationFile, dir = ".")
rawDir |
A character string specifying the path to the directory containing the raw experimental data files. |
plateAnnotationFile |
A character string specifying the path to the plate annotation file (e.g., a TSV or CSV file). |
wellAnnotationFile |
A character string specifying the path to the well annotation file (e.g., a TSV or CSV file). |
dir |
A character string specifying the path to the **parent** directory where the 'shiny' application directory should be created. Defaults to the current working directory ('.'). |
This function creates a new directory named 'shiny' inside the directory specified by the ‘dir' argument. This ’shiny' directory will contain:
shinyAPP.R: The R script required to launch the Shiny application.
ShinyData.zip: A compressed archive containing the structured
data processed from the inputs, ready for use by the Shiny application.
# Create a temporary directory for the output temp_output_dir <- tempdir() # Get example data file paths from the package rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') # Check if example data exists before running makeShiny(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, dir = temp_output_dir)# Create a temporary directory for the output temp_output_dir <- tempdir() # Get example data file paths from the package rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') # Check if example data exists before running makeShiny(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, dir = temp_output_dir)
This function calculates the percent inhibition or normalized viability values for each plate based on the control wells on the same plate.
normalizePlate( screenData, method = "negatives", discardLayer = 0L, bySample = FALSE )normalizePlate( screenData, method = "negatives", discardLayer = 0L, bySample = FALSE )
screenData |
a data frame that contains the output from the
|
method |
a character string, either 'negatives' or 'NPI', specifying
the method of per-plate normalization.
If 'negatives', the raw signals on the plate will be divided by the median
signal intensity of negative control wells on the same plate
|
discardLayer |
an integer value. To avoid the impact of incubation effect on the negative controls, a certain number of the exterior layers on the plate can be ignored when calculating the median of control wells. 0 means do not discard any control wells. |
bySample |
a logical value, indicates whether normalized the viability by sample rather than by plate. This is for the situation that multiple samples are on the same plate. |
This function will add one column, normVal, which is the normalized
viability based on user-specified normalization method, to the input
data.frame.
rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') # Read in screen data without normalization screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(3,18), colRange = 2, sep = '[;\t]', negWell = c('DMSO','PBS'), posWell = c(), normalization = FALSE) # Perform a normalization step separately screenData <- normalizePlate(screenData, method = 'negatives', discardLayer = 2)rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') # Read in screen data without normalization screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(3,18), colRange = 2, sep = '[;\t]', negWell = c('DMSO','PBS'), posWell = c(), normalization = FALSE) # Perform a normalization step separately screenData <- normalizePlate(screenData, method = 'negatives', discardLayer = 2)
Generates a heatmap visualization for drug combination screening data using the output of 'summariseScreenCombination()'.
plotCombination(obj, whichIndex = NULL, drug1 = NULL, drug2 = NULL)plotCombination(obj, whichIndex = NULL, drug1 = NULL, drug2 = NULL)
obj |
A data.frame containing drug combination screening results, typically the output from 'summariseScreenCombination()'. Must contain columns for drug identifiers, concentrations, and at least one of the supported synergy score columns. |
whichIndex |
Character. The name of the column in 'obj' to use for plotting. If NULL (default), the function will attempt to use the first available metric from: "CI", "synergyScore", "logCI", "antagonismScore". |
drug1 |
Character. Name of the first drug to plot. Required when 'whichIndex' is "CI" or "logCI". |
drug2 |
Character. Name of the second drug to plot. Required when 'whichIndex' is "CI" or "logCI". |
This function provides visualizations for different drug combination screening analysis methods:
Bliss method: When combination effects are computed by 'bliss' method in 'summariseScreenCombination()', this function generates a concentration- response heatmap for a specific drug pair using Combination Index (CI) or log(CI) values. Requires specification of 'drug1' and 'drug2'.
Bayesynergy method: When combination effects are computed by 'bayesynergy' method in 'summariseScreenCombination()', this function generates a comprehensive heatmap showing synergy or antagonism scores across all tested drug combinations. Does not require 'drug1' and 'drug2' parameters.
A ggplot object showing a heatmap of the drug combination effects.
data(screenData_combine_normalized) obj <- summariseScreenCombination(screenData_combine_normalized, negDrug = "DMSO", method = "bliss") plotCombination(obj, whichIndex = "CI", drug1 = "Venetoclax", drug2 = "DCA")data(screenData_combine_normalized) obj <- summariseScreenCombination(screenData_combine_normalized, negDrug = "DMSO", method = "bliss") plotCombination(obj, whichIndex = "CI", drug1 = "Venetoclax", drug2 = "DCA")
Generates dose-response curves for specified compounds from screening data, with options for different response metrics, logarithmic scaling, and IC50 model fitting.
plotDoseResponse( screenData, drugList, logDose = TRUE, whichResponse = c("viability", "normalized", "adjusted"), fitModel = TRUE, showPoints = TRUE, pointSize = 2, lineSize = 0.8, title = NULL, subtitle = NULL, caption = NULL )plotDoseResponse( screenData, drugList, logDose = TRUE, whichResponse = c("viability", "normalized", "adjusted"), fitModel = TRUE, showPoints = TRUE, pointSize = 2, lineSize = 0.8, title = NULL, subtitle = NULL, caption = NULL )
screenData |
A data frame containing drug screening data. Must include columns: 'drug', 'concentration', and one of 'value', 'normVal', or 'normVal.cor' depending on the 'whichResponse' parameter. Typically, it is the output of 'readScreen()' function. |
drugList |
A character vector of drug names to plot. Drugs not found in 'screenData' will be silently ignored. |
logDose |
Logical indicating whether to use logarithmic x-axis for concentration values. Default is 'TRUE'. |
whichResponse |
Character string specifying which response values to use. Must be one of: "viability" (raw values), "normalized", or "adjusted". Default is "viability". |
fitModel |
Logical indicating whether to fit and display IC50 curves. Default is 'TRUE'. |
showPoints |
Logical indicating whether to show raw data points. Default is 'TRUE'. |
pointSize |
Numeric value for point size. Default is 2. |
lineSize |
Numeric value for line size. Default is 0.8. |
title |
Plot title. If 'NULL', uses a descriptive default title. |
subtitle |
Plot subtitle. If 'NULL', uses a descriptive default subtitle. |
caption |
Plot caption. If 'NULL', uses a descriptive default caption. |
A ggplot object displaying dose-response curves for the specified compounds.
library(DrugScreenExplorer) rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, normalization = TRUE, rowRange = c(3,18), colRange = 2, sep = '[;\t]', commaAsDecimal = FALSE, negWell = c('DMSO','PBS')) plotDoseResponse(screenData, drugList = c("A-1210477", "Palbociclib", "Motolimod"), logDose = TRUE, whichResponse = "normalized", fitModel = TRUE, showPoints = TRUE, pointSize = 2, lineSize = 0.8, title = NULL, subtitle = NULL, caption = NULL)library(DrugScreenExplorer) rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, normalization = TRUE, rowRange = c(3,18), colRange = 2, sep = '[;\t]', commaAsDecimal = FALSE, negWell = c('DMSO','PBS')) plotDoseResponse(screenData, drugList = c("A-1210477", "Palbociclib", "Motolimod"), logDose = TRUE, whichResponse = "normalized", fitModel = TRUE, showPoints = TRUE, pointSize = 2, lineSize = 0.8, title = NULL, subtitle = NULL, caption = NULL)
This function generates a heatmap or a series of heatmaps showing the plate layout, raw intensity or normalized intensity for each plate in the screen dataset.
plotPlate( screenData, plotPlate = "all", plotType = "layout", ifCorrected = FALSE, limits = NULL, pdfName = NULL, ncol = 2, nrow = 3, width = 16, height = 16 )plotPlate( screenData, plotPlate = "all", plotType = "layout", ifCorrected = FALSE, limits = NULL, pdfName = NULL, ncol = 2, nrow = 3, width = 16, height = 16 )
screenData |
a data frame containing screen data generated by
|
plotPlate |
a character string or a vector of character strings specifying the file name of the plates. If all plates should be included, 'all' can be used. Default value is 'all' |
plotType |
a character string specifying the type of the plot, one of
'layout', 'zscore', 'viability' and 'edgeEffect'.
If 'layout' is specified, the plate layout will be plotted in a heatmap
according to the information in the 'wellType' column.
If 'zscore' is chosen, the zscore of each well on a plate will be plotted
in the heatmaps.
If 'viability' is used, the normalized intensity or viability values on
each plate will be plotted.
If plotType = 'edgeEffect', the edge effects estimated using
|
ifCorrected |
a logical value, whether to plot values after edge effect correction. The default value is FALSE, plot the original value. |
limits |
a numeric vector indicates the lower and upper limits of the
value shown in the heatmap.
The default values is |
pdfName |
a character string specifying the output pdf file name. If not specified, a list containing the ggplot objects of plate plots will be returned. Default is NULL. |
ncol |
the number of columns in a pdf page. Default number is 2. |
nrow |
the number of rows in a pdf page. Default number is 3. |
width |
the width of the page, in points |
height |
the height of the page, in points |
If the argument pdfName = NULL, this function returns a list
of ggplot objects and each object is a heatmap for each plate. If a file
name is specified for the pdfName argument, a pdf file with the
specified name and layout will be created in the working directory.
# load processed data data('screenData_normalized') # plot the cell viability heatmap on all plates plotPlate(screenData_normalized, plotPlate = 'all', plotType = 'viability') # Please see the vignette for more information.# load processed data data('screenData_normalized') # plot the cell viability heatmap on all plates plotPlate(screenData_normalized, plotPlate = 'all', plotType = 'viability') # Please see the vignette for more information.
This function generates a box plot to show the raw signal distribution on each plate.
plotRawCount(screenData, topN = NULL, ifLog10 = FALSE)plotRawCount(screenData, topN = NULL, ifLog10 = FALSE)
screenData |
a data frame containing screen date generated by readScreen() function |
topN |
an integer value or NULL, indicating how many plates should be included in the plot If NULL, all the plates are included |
ifLog10 |
a logical value, whether to perform log10 transformation |
a ggplot object
# load processed data data('screenData') # plot the raw ATP counts on all plates plotRawCount(screenData) # Please see the vignette for more information.# load processed data data('screenData') # plot the raw ATP counts on all plates plotRawCount(screenData) # Please see the vignette for more information.
A function to generate box plots to show the raw signal distribution for each well type on all or selected plates. For this function to work, the "wellType" column must be present in the data frame.
plotTypeDist(screenData, plotPlate = "all", ifLog10 = FALSE, pdfName = NULL)plotTypeDist(screenData, plotPlate = "all", ifLog10 = FALSE, pdfName = NULL)
screenData |
a data frame containing the screen data generated by readScreen() function |
plotPlate |
a character string or a vector of character strings specifying the file name of the plates to be included in the plots. If all plates should be included, 'all' can be used. The default value is 'all'. |
ifLog10 |
a logical value, whether to perform a log10 transformation on the values. |
pdfName |
a character string specifying the output pdf file name. If not specified, a list containing the ggplot objects will be returned. Default is NULL. |
If the argument pdfName = NULL, this function returns a
list of ggplot objects. If a file name is specified \
for the pdfName argument, a pdf file that contains the plots will
be created in the working directory.
# load processed data data('screenData') # plot raw ATP count distribution for each well type plotTypeDist(screenData) # Please see the vignette for more information.# load processed data data('screenData') # plot raw ATP count distribution for each well type plotTypeDist(screenData) # Please see the vignette for more information.
This function predicts the response with given fitted log-logistic model and concentration values.
## S3 method for class 'fitIC50' predict( object, newdata = NULL, se.fit = FALSE, level = 0.95, interval = c("none", "confidence", "prediction"), ... )## S3 method for class 'fitIC50' predict( object, newdata = NULL, se.fit = FALSE, level = 0.95, interval = c("none", "confidence", "prediction"), ... )
object |
an object of class 'fitIC50', generated by fitIC50 function. |
newdata |
a numeric vector or data frame with one column that contains the new concentration values If omitted, concentrations in the original fit are used. |
se.fit |
a logical value. Not used, but for geom_smooth purpose. |
level |
a numeric values, Not used, mainly for geom_smooth purpose. |
interval |
not used, mainly for geom_smooth purpose. |
... |
further arguments to be passed to ggplot when using geom_smooth(). |
a vector of predicted response based on a fitted model and input concentration values.
# Create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # Fit a four-parameter logistic model using dr4pl package mm <- fitIC50(viability ~ concentration, data = doseTab) # Predict response using the input concentrations predict(mm) # Predict response using new concentrations predict(mm, newdata = c(0.25, 2.5, 5, 15))# Create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # Fit a four-parameter logistic model using dr4pl package mm <- fitIC50(viability ~ concentration, data = doseTab) # Predict response using the input concentrations predict(mm) # Predict response using new concentrations predict(mm, newdata = c(0.25, 2.5, 5, 15))
This function reproduces the logic used in the Shiny server for the "Drug Effect Ranking" panel. It compares a selected sample's drug score to the summary score for a chosen group and returns the ranked drugs, along with a waterfall-style graph.
rankDrugs( screenData, score = c("DSS", "AUC", "IC50", "meanViab"), sampleID, group = "All samples", summary = c("mean", "median"), useCorrected = FALSE, topN = 30L, plot = TRUE )rankDrugs( screenData, score = c("DSS", "AUC", "IC50", "meanViab"), sampleID, group = "All samples", summary = c("mean", "median"), useCorrected = FALSE, topN = 30L, plot = TRUE )
screenData |
A data frame containing drug screening data with at least the columns 'sampleID', 'drug', 'wellType', and a score column such as 'DSS', 'AUC', 'IC50', 'meanViab', or their corrected variants. |
score |
Character string naming the score to rank by. |
sampleID |
Character string identifying the sample to compare against. |
group |
Character string naming the grouping variable to compare within. Use '"All samples"' for global comparison. |
summary |
Character string specifying the summary statistic used to aggregate the group score: either '"mean"' or '"median"'. |
useCorrected |
Logical. If 'TRUE', prefer the corrected score column when available (e.g. 'DSS.cor' instead of 'DSS'). |
topN |
Integer indicating the number of top-ranked drugs to return. |
plot |
Logical. If 'TRUE', return a ggplot object together with the ranked table; otherwise return only the table. |
If 'plot = TRUE', a list with components 'rankData' and 'plot'. Otherwise, a data frame containing the ranked results.
This function creates a data frame that contains the screening result from a whole drug screen experiment. Drugs and samples are annotated based on the drug and sample annotation files.
readScreen( rawDir, plateAnnotationFile, wellAnnotationFile, sep, setManualRanges = FALSE, rowRange = NULL, colRange = NULL, negWell = c(), posWell = c(), normalization = FALSE, method = "negatives", discardLayer = 0, commaAsDecimal = FALSE, allowNA = FALSE, bySample = FALSE )readScreen( rawDir, plateAnnotationFile, wellAnnotationFile, sep, setManualRanges = FALSE, rowRange = NULL, colRange = NULL, negWell = c(), posWell = c(), normalization = FALSE, method = "negatives", discardLayer = 0, commaAsDecimal = FALSE, allowNA = FALSE, bySample = FALSE )
rawDir |
a character string specifying the location of the raw data folder. |
plateAnnotationFile |
a character string specifying the location of the plate annotation file. |
wellAnnotationFile |
a character string specifying the location of the well annotation file. |
sep |
a character string specifying the delimiters for extracting values in the text file. A regular expression can be used. The default value is using either tab or semicolon as delimiter. |
rowRange |
either an integer vector with length of two or an integer value. If it's an vector, it should specify the range of the lines that contain the actual values. If it's an integer values, only the starting line is indicated and the end line is the end of the file. |
colRange |
either an integer vector with length of two or an integer value. If it's an vector, it should specify the range of the columns (separated by delimiters) that contain the actual values. If it's an integer, only the starting column is indicated and the end column is the last column in the file. |
negWell |
a character vector or a character string of well IDs or drug names (if the 'name' column is present in well annotation), which specifies the negative control wells |
posWell |
a character vector or a character string of well IDs or drug names (if the 'name' column is present in well annotation), which specifies the positive control wells |
normalization |
a logical value to indicate whether to calculate percent inhibition based on control wells on the plate. Default is FALSE. |
method |
a character string, either 'negatives' or 'NPI', specifying the method for calculating percent inhibition values. If 'negatives', each measurement on the plate will be divided by the median of the values of negative control wells on the same plate. If 'NPI', a 'normalized percent inhibition (NPI)' is applied in a per-plate basis. For an inhibition assay, this method divides the difference between each measurement on a plate and the median measurement of the positive controls on that plate by the difference between the median measurement of negative controls and positive controls on that well. The default value is 'negatives'. |
discardLayer |
an integer values. To avoid the impact of incubation
effect on the negative controls, a certain number of the exterior wells on
the plate can be ignored when summarising the measurement of controls.
0 means do not discard any control wells. A value above zero indicates
the |
commaAsDecimal |
a logical value, whether commas is used as decimal in the input data. Default is FALSE. |
allowNA |
a logical value, whether to allow NA (missing or empty) values in the input data. Default is FALSE. |
bySample |
a logic value, indicates whether to normalize the viability by sample rather than by plate. This is for situations where multiple samples are on the same plate. |
A data frame with each row represent a well on a plate and the following columns:
wellID |
well identifier |
rowID |
row identifier |
colID |
column identifier |
value |
raw signal intensity from a plate reader |
fileName |
input files names (without extension names) for the plates |
drug |
drug name, if this column is present in the well annotation file |
concentration |
drug concentration, if this column is present in the well annotation file |
wellType |
the type of wells, can be either neg (negative controls), pos (positive controls), or sample (drug wells) |
normVal |
normalized viability based on control wells on the plate,
if the normalization step is performed by setting |
Depends on the user-specified plate and well annotations, other columns, such as sampleID, patientID, batch and so on, in the annotation files can also be present in the output table.
rawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(3,18), colRange = 2, sep = '[;\t]', commaAsDecimal = FALSE, negWell = c('DMSO','PBS'), posWell = c()) # Example with combined data rawFolder <- system.file('testData/rawDataCombine', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnnoCombine/plateAnnoCombine.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnnoCombine/wellAnnoCombine.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(7, 22), colRange = 2, sep = ',', commaAsDecimal = FALSE, negWell = c("DMSO_DMSO"), posWell = c()) # see vignette for more instructionsrawFolder <- system.file('testData/rawData', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnno/plateAnno.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnno/wellAnno.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(3,18), colRange = 2, sep = '[;\t]', commaAsDecimal = FALSE, negWell = c('DMSO','PBS'), posWell = c()) # Example with combined data rawFolder <- system.file('testData/rawDataCombine', package = 'DrugScreenExplorer') plateFile <- system.file('testData/plateAnnoCombine/plateAnnoCombine.tsv', package = 'DrugScreenExplorer') wellFile <- system.file('testData/wellAnnoCombine/wellAnnoCombine.tsv', package = 'DrugScreenExplorer') screenData <- readScreen(rawDir = rawFolder, plateAnnotationFile = plateFile, wellAnnotationFile = wellFile, rowRange = c(7, 22), colRange = 2, sep = ',', commaAsDecimal = FALSE, negWell = c("DMSO_DMSO"), posWell = c()) # see vignette for more instructions
This is an example drug screen dataset of CLL samples processed by
readScreen() function.
Normalization was not performed.
data(screenData)data(screenData)
an object of "tbl_df" (tidy table)
data(screenData)data(screenData)
This is an example drug screen dataset for two-drug combination processed
by readScreen() function.
data(screenData_combine)data(screenData_combine)
an object of "tbl_df" (tidy table)
data(screenData_normalized)data(screenData_normalized)
This is an example drug screen dataset for two-drug combination processed
by readScreen() function.
Normalization was performed based on negative controls.
data(screenData_combine_normalized)data(screenData_combine_normalized)
an object of "tbl_df" (tidy table)
data(screenData_combine_normalized)data(screenData_combine_normalized)
This is an example drug screen dataset of CLL samples processed by
readScreen() function.
Normalization was performed based on negative controls.
data(screenData_normalized)data(screenData_normalized)
an object of "tbl_df" (tidy table)
data(screenData_normalized)data(screenData_normalized)
This function will fit a 4-parameter log-logistic model using dr4pl package based on the input dose-response table and return the model parameters as well as integrated area under the fitted sigmoid curve.
sumIC50(formula, data = NULL, minConc = 0, maxConc = 15, n = 100, ...)sumIC50(formula, data = NULL, minConc = 0, maxConc = 15, n = 100, ...)
formula |
formula for the curve fitting. |
data |
a data frame containing the raw concentration and the viability value. |
minConc |
lower bound of concentrations for the integration of area under curve. |
maxConc |
upper bound of concentrations for the integration of area under curve. |
n |
number of bins for integration. |
... |
further arguments to be passed to dr4pl function. |
a dataframe with only one row and four columns:
UpperLimit |
the upper limit of the fitted logistic model |
IC50 |
the half maximal inhibitory concentration (IC50), or the half maximal effective concentration (EC50), depends on the type of input data |
Slope |
the slope of the fitted logistic model |
lowerLimit |
the upper limit of the fitted logistic model |
AUC |
the area under the fitted sigmoid doese-response curve |
If the model fitting is failed, all values in the dataframe will be NA.
# create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # get the parameters sumIC50(viability ~ concentration, data = doseTab)# create an example dose-response table doseTab <- data.frame(viability = c(1.0, 0.95, 0.5, 0.2, 0.1), concentration = c(0.001, 0.01, 0.1, 1, 10)) # get the parameters sumIC50(viability ~ concentration, data = doseTab)
This function summarizes the normalized drug effect (viability) across multiple concentrations into a single value. The summary is based on the normalized viability values, which require plate normalization as a prerequisite. If the viability values have been corrected for incubation/edge effect, the function will normalize both the corrected and uncorrected values and add a suffix, ‘.cor’, to the columns with the summary values.
summariseScreen( screenData, method = c("average", "AUC", "IC50", "DSS"), minConc = 0, maxConc = 15, dssType = "DSS2", dssThreshold = 10 )summariseScreen( screenData, method = c("average", "AUC", "IC50", "DSS"), minConc = 0, maxConc = 15, dssType = "DSS2", dssThreshold = 10 )
screenData |
the data frame containing screening data generated by
|
method |
a character string or a vector of character strings specifying the method to summarize the drug effects. There are currently four methods available: average, AUC, DSS, and IC50. The average method calculates the average drug effect across all concentrations. The AUC method calculates the normalized area under the dose-response curve using the trapezoidal method. The IC50 method fits a robust four-parameter log-logistic model using the dr4pl package and returns the IC50/EC50 score and the area under the fitted sigmoid curve. You can use multiple methods simultaneously by specifying a vector of method names. |
minConc |
lower bound of concentrations for the integration of area
under curve. Used for method = "IC50". See |
maxConc |
upper bound of concentrations for the integration of area
under curve. Used for method = "IC50". See |
dssType |
type of DSS score to calculate. Options are "DSS1", "DSS2", and "DSS3". (default is "DSS2") |
dssThreshold |
threshold for DSS score calculation provided as a percentage. Should be a numeric value between 0 and 100. (default is 10) |
The following columns will be added to the input data frame depending on the user-specified summarizing methods:
If method = 'average',
meanViab |
the averaged viability across all concentrations for a certain drug |
If method = 'AUC'
AUC |
the area under the dose-response curve calculated by using the trapezoidal rule. |
If method = 'IC50'
IC50 |
the half maximal inhibitory concentration (IC50), or the half maximal effective concentration (EC50), depends on the type of input data |
IC50AUC |
the area under the fitted sigmoid dose-response curve |
If the logistic model can not be fitted for a certain drug, the above four values will be set to NA.
If method = 'DSS'
DSS |
the drug sensitivity score calculated based on the viability and concentration values.
The DSS1 score is a normalized version of the AUC that will only consider the drug effect above a
a user-defined threshold. The DSS score is calculated using the |
If a column that contains the edge/incubation effect corrected viability
values is present in the input data frame,
the above columns with a suffix .cor, which represent the summarized
values based on edge/incubation corrected viabilities, will also be added to
the input data frame.
data(screenData_normalized) screenData <- summariseScreen(screenData_normalized) # Please see the vignette for more informationdata(screenData_normalized) screenData <- summariseScreen(screenData_normalized) # Please see the vignette for more information
summariseScreenCombination() function summarizes the synergy or
antagonism effects of two-drug combination. The summary is based on
the normalized viability values, which require plate normalization as a
prerequisite. If the viability values have been corrected for
incubation/edge effect, the function will normalize both the corrected and
uncorrected values and add a suffix, ‘.cor’, to the columns with the summary
values.
summariseScreenCombination( screenData, negDrug, method = c("bliss", "bayesynergy") )summariseScreenCombination( screenData, negDrug, method = c("bliss", "bayesynergy") )
screenData |
the data frame containing screening data generated by
|
negDrug |
the negative drug, e.g., DMSO. The viability indeed reflects the effects of a single drug, if the drug is combined with the negative drug. |
method |
a character string specifying the method to summarize the synergy or antagonism effects. Currently, There are two methods available: bliss and bayesynergy. Please install bayesynergy package from github (https://github.com/ocbe-uio/bayesynergy) manually, if bayesynergy method is selected. |
The function returns a data frame.
If method = "bliss", the function returns the pointwise combination
index (CI) and log (CI), indicating the synergy or antagonism effects.
If method = “bayesynergy”, the function returns the synergy and
antagonism scores for drug combinations.
If a column that contains the edge/incubation effect corrected viability values
is present in the input data frame, the above columns with a suffix .cor,
which represent the summarized values based on edge/incubation corrected
viabilities, will also be added to the input data frame.
data(screenData_combine_normalized) summariseScreenCombination(screenData_combine_normalized, negDrug = "DMSO", method = "bliss") # Please see the vignette for more information.data(screenData_combine_normalized) summariseScreenCombination(screenData_combine_normalized, negDrug = "DMSO", method = "bliss") # Please see the vignette for more information.