CRISPRball: Create an interactive Shiny app for visualization &...

View source: R/CRISPRball.R

CRISPRballR Documentation

Create an interactive Shiny app for visualization & exploration of CRISPR analyses

Description

This package was designed to make the visualization, interpretation, and exploration of CRISPR screen analyses accessible for both analysts and bench scientists. It makes high-quality, publication-ready figures simple to create and customize. It also provides a simple interface to DepMap data for comparison and filtering.

Usage

CRISPRball(
  gene.data = NULL,
  sgrna.data = NULL,
  count.summary = NULL,
  norm.counts = NULL,
  h.id = "mag1",
  positive.ctrl.genes = NULL,
  essential.genes = NULL,
  depmap.db = NULL,
  genesets = NULL,
  return.app = TRUE
)

Arguments

gene.data

A named list containing gene_summary.txt tables as data.frames. Multiple data.frames may be provided, one per element of the list. Users will be able to swap between them within the app. List element names should match names of sgrna.data list elements.

sgrna.data

A named list containing sgrna_summary.txt tables as data.frames. Multiple data.frames may be provided, one per element of the list. Users will be able to swap between them within the app. List element names should match names of gene.data list elements.

count.summary

Matrix or dataframe containing count summary (countsummary.txt) as generated by mageck count.

norm.counts

Matrix or dataframe containing normalized counts (count_normalized.txt) as generated by mageck count.

h.id

String indicating unique ID for interactive plots. Required if multiple apps are run within the same Rmd file.

positive.ctrl.genes

Optional character vector of gene identifiers for positive control genes from the screen so that they can be easily filtered.

essential.genes

Optional character vector of gene identifiers of common essential genes (i.e. pan-lethal) so that they can be easily filtered. If provided, overrides the depmap essential genes.

depmap.db

Optional character scalar for name of SQLite database returned by build_depmap_db.

genesets

Optional named list containing genesets that can be interactively highlighted on the plots. The elements of the list should each be a geneset with gene identifiers matching those used in the results.

return.app

Optional boolean indicating whether a Shiny app should be returned. TRUE by default. If FALSE, a named list of app elements (ui and server) will be returned instead. Useful for deploying as a standalone shiny app.

Details

Features with no variation will be removed prior to pca being run for the PCA visualization. Gene labels can be added to the MAplot and volcano plot by clicking a point. The labels can also be dragged around, though adding labels will reset the positions, so it's recommended to add all labels prior to re-positioning them.

Most users will be interested in the main function to create a Shiny application (CRISPRball), though there are certain plotting functions that may be of interest to developers (plot_volcano, plot_rank, plot_lawn, etc). Most included plotting functions produce a ggplot object by default and have few required arguments. Many additional arguments are available for customization to generate complex, publication-ready figures.

This package supplements the MAGeCKFlute package, adding additional functionality, visualizations, and a Shiny interface.

To report bugs, suggest new features, or ask for help, the best method is to create an issue on the github, here, or the bioconductor support site (be sure to tag 'CRISPRball' so that I get a notification!), here

Value

A Shiny app containing interactive visualizations of CRISPR analysis results.

Author(s)

Jared Andrews, Jacob Steele

Examples

library(CRISPRball)
# Create app with no data loaded.
app <- CRISPRball()
if (interactive()) {
    shiny::runApp(app)
}

# Create app with data loaded.
# Create lists of results summaries for each dataset.
d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt",
    package = "CRISPRball"
), check.names = FALSE)
d2.genes <- read.delim(system.file("extdata", "plasmid.gene_summary.txt",
    package = "CRISPRball"
), check.names = FALSE)

d1.sgrnas <- read.delim(system.file("extdata", "esc1.sgrna_summary.txt",
    package = "CRISPRball"
), check.names = FALSE)
d2.sgrnas <- read.delim(system.file("extdata", "plasmid.sgrna_summary.txt",
    package = "CRISPRball"
), check.names = FALSE)

count.summ <- read.delim(system.file("extdata", "escneg.countsummary.txt",
    package = "CRISPRball"
), check.names = FALSE)
norm.counts <- read.delim(system.file("extdata", "escneg.count_normalized.txt",
    package = "CRISPRball"
), check.names = FALSE)

genes <- list(ESC = d1.genes, plasmid = d2.genes)
sgrnas <- list(ESC = d1.sgrnas, plasmid = d2.sgrnas)

app <- CRISPRball(
    gene.data = genes, sgrna.data = sgrnas,
    count.summary = count.summ, norm.counts = norm.counts
)
if (interactive()) {
    shiny::runApp(app)
}

j-andrews7/CRISPRball documentation built on Nov. 30, 2023, 7:34 p.m.