Package 'DrugScreenExplorer'

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

Help Index


Server Function for DrugScreenExplorer Shiny Application

Description

This function defines the server-side logic for the DrugScreenExplorer Shiny application. It handles data processing, visualization, and user interactions for drug screening analysis.

Usage

.buildServer(...)

Arguments

...

additional arguments

Value

Shiny server function


Main Application UI for DrugScreenExplorer

Description

Creates the complete Shiny user interface for the DrugScreenExplorer application. This function builds a multi-tab navigation interface for drug screening data analysis.

Usage

.buildUI(...)

Arguments

...

additinal argument

Value

A Shiny UI object (typically 'shiny.tag' or 'shiny.tag.list') containing the application layout.


Build the DrugScreenExplorer Shiny Application

Description

This function constructs a Shiny app object by combining a user interface (UI) component and a server function.

Usage

buildApp(...)

Arguments

...

Additional parameters passed to both '.build_ui()' and '.build_server()' functions. The specific parameters available depend on the implementation of these internal builder functions.

Details

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.

Value

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.

Examples

# Build the Shiny application
app <- buildApp()
# Run the application
if (interactive()) {
  shiny::runApp(app)
}

Estimate and correct edge effect for each screen plate

Description

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.

Usage

correctEdgeEffect(
  screenData,
  estimateMethod = "loess",
  useNeg = TRUE,
  useLowConcentrations = 0L,
  span = 1,
  correctMethod = "bliss",
  exclude = c()
)

Arguments

screenData

a data frame containing screening results generated by readScreen() function. In order for the edge effect estimate algorithm to work, plate normalization needs to be performed first.

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 loess method, which controls the degree of smoothing.

correctMethod

a character string specifying the method used for adjusting the edge effect. Currently two methods 'bliss' and 'linear' are supported. If bliss is selected, the corrected values are simply the normalized signal intensity values divided by the estimated incubation/edge effect intensity. If linear is selected, the correction process will be smoothed by a linear function depends on the original normalized signal intensity. This option is suitable for the situation when the edge effect is very strong and results in instability in the correction process.

exclude

a list of samples that should be excluded when performing edge effect correction

Value

This function will add one column, normVal.cor, which is the normalized viability corrected for incubation/edge effect, to the input data frame.

Examples

# load drug screen dataset
data('screenData_normalized')
screenData_corrected <- correctEdgeEffect(screenData_normalized,
                                          estimateMethod = 'loess',
                                          useNeg = TRUE,
                                          useLowConcentrations = 0,
                                          span =1,
                                          correctMethod = 'bliss')

Create a Template for Plate Annotation File

Description

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.

Usage

createPlateInput(rawDir, file, entries = c(), batchAsFolder = FALSE)

Arguments

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 FALSE. If TRUE, the folder names will be used as batch identifiers automatically.

Value

This function creates a tab-separated values (tsv) file in the working directory.

Examples

# 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

Prepare Data for Shiny Application

Description

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.

Usage

createShinyData(
  rawDir,
  plateAnnotationFile,
  wellAnnotationFile,
  dir = ".",
  filename = "ShinyData"
)

Arguments

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"

Value

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.

Examples

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 directory

Create a template for well annotation file

Description

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.

Usage

createWellInput(
  file,
  colNum,
  rowNum,
  entries = c("drug", "concentration", "drug2", "concentration2"),
  platePerSample = 1
)

Arguments

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.

Value

This function creates a tab-separated values (tsv) file in the working directory.

Examples

# create a template for well annotation file
createWellInput(file = 'wellAnno.tsv', colNum = 24,
                rowNum = 16, entries = c('drug', 'concentration'))
# see vignette for more instructions

Estimate edge effect intensity

Description

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.

Usage

estimateEdgeEffect(
  screenData,
  nLayer = 1,
  onlyNeg = TRUE,
  identifier = "fileName",
  pdfName = NULL
)

Arguments

screenData

a data frame containing the screening results generated by readScreen() function

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 FALSE, all the measurements on each plate are used for edge effect estimation. The default value is TRUE.

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.

Value

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.

Examples

# 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.

Fit a 2D surface to capture the incubation/edge effect on each plate

Description

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.

Usage

fitEdgeEffect(
  screenData,
  method = "loess",
  useNeg = TRUE,
  useLowConcentrations = 0L,
  span = 1,
  exclude = c()
)

Arguments

screenData

the data frame containing screen results generated by readScreen() function. For this function to work, the normVal (normalized viability values) generated by readScreen() function with normalization = TRUE must be present.

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.

Value

This function will add one column, edgeFactor, which is the estimated incubation or edge effect, to the input data frame.

Examples

# load drug screen dataset
data('screenData_normalized')
screenData_fitted <- fitEdgeEffect(screenData_normalized,
                                   method = 'loess',
                                   useNeg = TRUE)

Fitting 4 parameter log-logistic (4PL) models.

Description

Use the dr4pl package to perform IC50 curve fitting. The outputs can be directly used for geom_smooth() in ggplot2.

Usage

fitIC50(formula, data = NULL, weights = NULL, logDose = NULL, ...)

Arguments

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.

Value

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).

Examples

# 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)

Generate a quality report of the screen data

Description

This function generates a customized Rmarkdown based html report for priliminary quality assurance.

Usage

makeReport(
  screenData,
  dir = ".",
  showCode = FALSE,
  title = "Report for my drug screening project",
  author = "Author Name",
  ifPlatePlot = FALSE
)

Arguments

screenData

a data table that contains the screen results generated by readScreen() function.

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 TRUE, the generated HTML report will include the underlying R code. Default is FALSE.

title

a character string specifying the title for the html report

author

a character string specifying the author name

ifPlatePlot

Logical; if TRUE, the report includes plate-level heatmap plots. Note that enabling heatmap plotting can significantly increase rendering time for large datasets. Default is FALSE.

Value

An HTML report named report.html created within a subdirectory named report inside the specified (or default) directory.

Examples

# load processed data
data(screenData_normalized)

# make html report
makeReport(screenData_normalized, showCode = TRUE,
           title = 'Report example',
           author = 'Author Name', ifPlatePlot = FALSE)

Generate a Ready-to-Run Shiny Application Directory

Description

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.

Usage

makeShiny(rawDir, plateAnnotationFile, wellAnnotationFile, dir = ".")

Arguments

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 ('.').

Value

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.

Examples

# 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)

Per-plate normalization

Description

This function calculates the percent inhibition or normalized viability values for each plate based on the control wells on the same plate.

Usage

normalizePlate(
  screenData,
  method = "negatives",
  discardLayer = 0L,
  bySample = FALSE
)

Arguments

screenData

a data frame that contains the output from the readScreen() function.

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 xnormalized=x/Median(xneg)x_{normalized} = x / Median(x_{neg}). If 'NPI', a 'normalized percent inhibition (NPI)' is applied in a per-plate basis. NPI measures the extent to which the signal of interest is diminished compared to a positive control: xnormalized=(x−Median(xpos))/(Median(xneg)−Median(xpos))x_{normalized} = (x - Median(x_{pos}))/(Median(x_{neg}) - Median(x_{pos})). The default value is 'negatives'.

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.

Value

This function will add one column, normVal, which is the normalized viability based on user-specified normalization method, to the input data.frame.

Examples

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)

Plot Drug Combination Effects

Description

Generates a heatmap visualization for drug combination screening data using the output of 'summariseScreenCombination()'.

Usage

plotCombination(obj, whichIndex = NULL, drug1 = NULL, drug2 = NULL)

Arguments

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".

Details

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.

Value

A ggplot object showing a heatmap of the drug combination effects.

Examples

data(screenData_combine_normalized)
obj <- summariseScreenCombination(screenData_combine_normalized,
                                  negDrug = "DMSO",
                                  method = "bliss")
plotCombination(obj, whichIndex = "CI", drug1 = "Venetoclax", drug2 = "DCA")

Plot Dose-Response Curves for Drug Screening Data

Description

Generates dose-response curves for specified compounds from screening data, with options for different response metrics, logarithmic scaling, and IC50 model fitting.

Usage

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
)

Arguments

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.

Value

A ggplot object displaying dose-response curves for the specified compounds.

Examples

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)

Plot the layout or measurements on each screening plate

Description

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.

Usage

plotPlate(
  screenData,
  plotPlate = "all",
  plotType = "layout",
  ifCorrected = FALSE,
  limits = NULL,
  pdfName = NULL,
  ncol = 2,
  nrow = 3,
  width = 16,
  height = 16
)

Arguments

screenData

a data frame containing screen data generated by readScreen() function

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 fitEdgeEffect() will be plotted. This choice is only valid when plate normalization is performed by readScreen() function or normalizePlate() function. Default is 'layout'

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 [0,2] for plotType = "viability" and [-3,3] for plotType = 'zscore'.

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

Value

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.

Examples

# 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.

Plot the distribution of the raw signal intensity (raw counts) on each plate

Description

This function generates a box plot to show the raw signal distribution on each plate.

Usage

plotRawCount(screenData, topN = NULL, ifLog10 = FALSE)

Arguments

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

Value

a ggplot object

Examples

# load processed data
data('screenData')

# plot the raw ATP counts on all plates
plotRawCount(screenData)
# Please see the vignette for more information.

Plotting raw signal distribution for each well type

Description

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.

Usage

plotTypeDist(screenData, plotPlate = "all", ifLog10 = FALSE, pdfName = NULL)

Arguments

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.

Value

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.

Examples

# load processed data
data('screenData')

# plot raw ATP count distribution for each well type
plotTypeDist(screenData)
# Please see the vignette for more information.

Predict the response using the fitted IC50 curve.

Description

This function predicts the response with given fitted log-logistic model and concentration values.

Usage

## S3 method for class 'fitIC50'
predict(
  object,
  newdata = NULL,
  se.fit = FALSE,
  level = 0.95,
  interval = c("none", "confidence", "prediction"),
  ...
)

Arguments

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().

Value

a vector of predicted response based on a fitted model and input concentration values.

Examples

# 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))

Rank drugs against a selected sample and group summary

Description

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.

Usage

rankDrugs(
  screenData,
  score = c("DSS", "AUC", "IC50", "meanViab"),
  sampleID,
  group = "All samples",
  summary = c("mean", "median"),
  useCorrected = FALSE,
  topN = 30L,
  plot = TRUE
)

Arguments

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.

Value

If 'plot = TRUE', a list with components 'rankData' and 'plot'. Otherwise, a data frame containing the ranked results.


Read and assemble a drug screen dataset

Description

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.

Usage

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
)

Arguments

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 N layers of wells on the edge should be discarded.

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.

Value

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 normalization = TRUE

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.

Examples

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 instructions

Example drug screen data on CLL samples

Description

This is an example drug screen dataset of CLL samples processed by readScreen() function. Normalization was not performed.

Usage

data(screenData)

Format

an object of "tbl_df" (tidy table)

Examples

data(screenData)

Example drug screen data for two-drug combination

Description

This is an example drug screen dataset for two-drug combination processed by readScreen() function.

Usage

data(screenData_combine)

Format

an object of "tbl_df" (tidy table)

Examples

data(screenData_normalized)

Example drug screen data for the two-drug combination with normalization

Description

This is an example drug screen dataset for two-drug combination processed by readScreen() function. Normalization was performed based on negative controls.

Usage

data(screenData_combine_normalized)

Format

an object of "tbl_df" (tidy table)

Examples

data(screenData_combine_normalized)

Example drug screen data on CLL samples with normalization

Description

This is an example drug screen dataset of CLL samples processed by readScreen() function. Normalization was performed based on negative controls.

Usage

data(screenData_normalized)

Format

an object of "tbl_df" (tidy table)

Examples

data(screenData_normalized)

Summarize drug effect across concentrations using a 4-parameter log-logistic model

Description

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.

Usage

sumIC50(formula, data = NULL, minConc = 0, maxConc = 15, n = 100, ...)

Arguments

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.

Value

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.

Examples

# 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)

Summarize the drug effect across concentrations

Description

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.

Usage

summariseScreen(
  screenData,
  method = c("average", "AUC", "IC50", "DSS"),
  minConc = 0,
  maxConc = 15,
  dssType = "DSS2",
  dssThreshold = 10
)

Arguments

screenData

the data frame containing screening data generated by readScreen() function

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 sumIC50().

maxConc

upper bound of concentrations for the integration of area under curve. Used for method = "IC50". See sumIC50().

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)

Value

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 calcDSS() function. The DSS2 score is further normalized by comparing the DSS1 score to the maximum possible AUC for the given concentration range. The DSS3 score is a modified version of the DSS2 score that takes into account the slope of the dose-response curve.

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.

Examples

data(screenData_normalized)
screenData <- summariseScreen(screenData_normalized)

# Please see the vignette for more information

Summarize drug combination effects across concentrations for two-drug combination

Description

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.

Usage

summariseScreenCombination(
  screenData,
  negDrug,
  method = c("bliss", "bayesynergy")
)

Arguments

screenData

the data frame containing screening data generated by readScreen() function

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.

Value

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.

Examples

data(screenData_combine_normalized)
summariseScreenCombination(screenData_combine_normalized,
                           negDrug = "DMSO",
                           method = "bliss")
# Please see the vignette for more information.