knitr::opts_chunk$set(
  collapse = TRUE,
  echo = TRUE,
  warning = FALSE,
  message = FALSE
)
library(CellSurvAssay)

CellSurvAssay

CellSurvAssay consists of a couple of tools that can be used to perform Clonogenic Survival Analysis in R very easily and efficiently. These two tools are:

This document is the vignette that accompanies with the R package, and describes comprehensively how the package works and how it can be used to perform the analysis. For details on the Shiny app, please access it and refer to its Help pages. For more details on both of these tools and methodologies, please refer to (cite our paper).

Purpose of the CellSurvAssay R package

Installing the package

# if installing from Bioconductor
# install BiocManager, if required
if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
# install CellSurvAssay
BiocManager::install("CellSurvAssay")
# load CellSurvAssay in R
library(CellSurvAssay) 



# if installing from GitHub
# install devtools, if required
if(!require(devtools)) {
    install.packages("devtools")
    library(devtools)
}
# install CellSurvAssay
install_github("pickeringlab/CellSurvAssay", 
               build_vignettes = TRUE,
               dependencies = TRUE)
# load CellSurvAssay in R memory
library(CellSurvAssay) 
browseVignettes("CellSurvAssay")

Importing the data set

datatab <- importData("path/to/file", "type of file")
datatab <- importData("path/to/file.xlsx") #for an excel file
datatab <- importData("path/to/file.csv", filetype = "csv") #for a csv file
datatab <- importData("path/to/file.tsv", filetype = "tsv") #for a tsv file
#for a '|' delimited file
datatab <- importData("path/to/file", filetype = "txt", separator = "|") 

#for a tab delimited file
datatab <- importData("path/to/file", filetype = "txt", separator = "\t") 
datatab <- CASP8_data

Additional arguments

#to skip the first couple of rows
datatab <- importData("path/to/file.xlsx", skip = 2)

#to tell R that missing values are denoted by "-" in the data being imported
datatab <- importData("path/to/file.xlsx", na = "-") 
View(datatab)

Fitting the Linear Quadratic Model

lqmodelFit(datatab, "shCASP8-N")

Other method options

lqmodelFit(datatab, "shCASP8-N", method = "ls") #least squares method
lqmodelFit(datatab, "shCASP8-N", method = "franken") #franken method
lqmodelFit(datatab, "shCASP8-N", PEmethod = "fix")

Plotting Cell Survival curves

Plotting using plotCSCurve()

Individual curves

plotCSCurve(datatab, "control-B")

Multiple curves

plotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N")

Customizing the plots

plotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N",
            col = c("red", "blue", "darkgreen", "steelblue"), pch = 4, ylim = c(0.01, 1),
            xlab = "X-axis", ylab = "Y-axis", title = "Cell Survival Curves")

Other options

plotCSCurve(datatab, "control-B", method = "franken", PEmethod = "fix")

Plotting using ggplotCSCurve()

Individual curves

ggplotCSCurve(datatab, "shCASP8-NT")

Multiple curves

ggplotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N")

Customizing the plots

ggplotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N",
              colors = c("red", "blue", "darkgreen", "steelblue"),
              title = "Cell Survival Curves", title_size = 20, title_color = "darkgreen", 
              title_align = "left", subtitle = "CellSurvAssay", sub_color = "steelblue", 
              sub_align = "left", xlab = "X-axis", xlab_color = "red", xlab_size = 14, 
              xlab_face = "bold.italic", ylab = "Y-axis", ylab_color = "red", ylab_size = 14,
              ylab_face = "bold.italic",
              xtext_color = "purple", ytext_color = "purple", 
              legend_title = "Cell types", ltitle_size = 15, legend_back = "gray", 
              legend_border = "black", legend_border_width = 0.5, ltitle_align = "center",
              point_shape = 15, point_size = 1, segment_width = 1, segment_type = 1,
              curve_width = 1.1, curve_type = 1,
              theme = ggplot2::theme_test())
ggplotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N",
              save = "Yes", plot_height = 4, plot_width = 5, units = "in",
              save_path = "C:/User1/desktop", save_filename = "Plot.pdf")

Another way of customizing the ggplotCSCurve() plots

library(ggplot2)
ggplotCSCurve(datatab, "shCASP8-NT", "shCASP8-B", "shCASP8-B+Z", "shCASP8-B+Z+N") +
  theme(legend.position = "none")

Other options

Comparing two curves

compareCurves(datatab, "shCASP8-N", "shCASP8-B+Z+N")

Other options

Calculating Dose Enhancement Ratio

calculateDER(datatab, "shCASP8-NT", "shCASP8-N", 0.25)

Other options

Session Information

sessionInfo()


PickeringLab/CellSurvAssay documentation built on June 15, 2022, 12:33 a.m.