Title: | Shiny Application for Interactive CRISPR Screen Visualization, Exploration, Comparison, and Filtering |
---|---|
Description: | A Shiny application for visualization, exploration, comparison, and filtering of CRISPR screens analyzed with MAGeCK RRA or MLE. Features include interactive plots with on-click labeling, full customization of plot aesthetics, data upload and/or download, and much more. Quickly and easily explore your CRISPR screen results and generate publication-quality figures in seconds. |
Authors: | Jared Andrews [aut, cre] , Jacob Steele [ctb] |
Maintainer: | Jared Andrews <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.3.1 |
Built: | 2024-11-02 03:29:23 UTC |
Source: | https://github.com/bioc/CRISPRball |
Build SQLite database of DepMap data
build_depmap_db( retrieve = c("rnai", "crispr", "dependency", "cn", "ccle_tpm", "meta", "drug", "gene.summary", "release"), file = "depmap_db.sqlite" )
build_depmap_db( retrieve = c("rnai", "crispr", "dependency", "cn", "ccle_tpm", "meta", "drug", "gene.summary", "release"), file = "depmap_db.sqlite" )
retrieve |
Character vector of data to retrieve from DepMap. Options include:
|
file |
Name of SQLite database file to create. |
Name of SQLite database containing DepMap data.
Jared Andrews
depmap_rnai
, depmap_crispr
,
depmap_copyNumber
, depmap_TPM
,
depmap_metadata
, depmap_gene_summary
,
depmap_drug_sensitivity
, depmap_release
dbPool
, dbWriteTable
library(CRISPRball) build_depmap_db(retrieve = "release")
library(CRISPRball) build_depmap_db(retrieve = "release")
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.
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 )
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 )
gene.data |
A named list containing |
sgrna.data |
A named list containing |
count.summary |
Matrix or dataframe containing count summary ( |
norm.counts |
Matrix or dataframe containing normalized counts ( |
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 |
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. |
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
A Shiny app containing interactive visualizations of CRISPR analysis results.
Jared Andrews, Jacob Steele
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) }
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) }
The DepMap copy number data for CDK2.
data(depmap_22q1_cn)
data(depmap_22q1_cn)
depmap_22q1_TPM
A dataframe with 1754 rows and 9 columns:
Depmap cell line ID
log2 copy number
Numeric entrez gene ID
Gene symbol
Screen type, either CRISPR or RNAi
Cell line name
Cell line disease origin
Cell line lineage
Cell line lineage subtype, usually a malignancy
String for hover text when plotting
A dataframe containing DepMap 22Q1 copy number data.
https://depmap.org/portal/download/all/
https://bioconductor.org/packages/release/data/experiment/html/depmap.html
The DepMap CRISPR screen data for CDK2.
data(depmap_22q1_crispr)
data(depmap_22q1_crispr)
depmap_22q1_crispr
A dataframe with 1070 rows and 9 columns:
Depmap cell line ID
Depmap dependency score
Numeric entrez gene ID
Gene symbol
Cell line name
Cell line disease origin
Cell line lineage
Cell line lineage subtype, usually a malignancy
String for hover text when plotting
A dataframe containing DepMap 22Q1 CRISPR screen data.
https://depmap.org/portal/download/all/
https://bioconductor.org/packages/release/data/experiment/html/depmap.html
The DepMap CRISPR & RNAi screen data for CDK2.
data(depmap_22q1_crispr_rnai)
data(depmap_22q1_crispr_rnai)
depmap_22q1_crispr_rnai
A dataframe with 1782 rows and 9 columns:
Depmap cell line ID
Depmap dependency score
Numeric entrez gene ID
Gene symbol
Screen type, either CRISPR or RNAi
Cell line name
Cell line disease origin
Cell line lineage
Cell line lineage subtype, usually a malignancy
String for hover text when plotting
A dataframe containing DepMap 22Q1 CRISPR and RNAi data.
https://depmap.org/portal/download/all/
https://bioconductor.org/packages/release/data/experiment/html/depmap.html
The DepMap RNAi screen data for CDK2.
data(depmap_22q1_rnai)
data(depmap_22q1_rnai)
depmap_22q1_rnai
A dataframe with 712 rows and 9 columns:
Depmap dependency score
Numeric entrez gene ID
Gene symbol
Depmap cell line ID
Cell line name
Cell line disease origin
Cell line lineage
Cell line lineage subtype, usually a malignancy
String for hover text when plotting
A dataframe containing DepMap 22Q1 RNAi screen data.
https://depmap.org/portal/download/all/
https://bioconductor.org/packages/release/data/experiment/html/depmap.html
The DepMap expression data for CDK2.
data(depmap_22q1_TPM)
data(depmap_22q1_TPM)
depmap_22q1_TPM
A dataframe with 1393 rows and 9 columns:
Depmap cell line ID
log2(TPM+1) expression
Numeric entrez gene ID
Gene symbol
Screen type, either CRISPR or RNAi
Cell line name
Cell line disease origin
Cell line lineage
Cell line lineage subtype, usually a malignancy
String for hover text when plotting
A dataframe containing DepMap 22Q1 expression data.
https://depmap.org/portal/download/all/
https://bioconductor.org/packages/release/data/experiment/html/depmap.html
Parse gene summary data for easier plotting and display
gene_ingress( df, sig.thresh, es.thresh, es.col, sig.col, positive.ctrl.genes = NULL, essential.genes = NULL, depmap.genes = NULL )
gene_ingress( df, sig.thresh, es.thresh, es.col, sig.col, positive.ctrl.genes = NULL, essential.genes = NULL, depmap.genes = NULL )
df |
data.frame of gene summary data. Gene IDs should be in the first column. |
sig.thresh |
Numeric scalar for significance threshold to consider a gene a hit. |
es.thresh |
Numeric scalar for absolute log fold change threshold to consider a gene a hit. |
es.col |
Character scalar for the column name of the effect size value. |
sig.col |
Character scalar for the column name of the significance value. |
positive.ctrl.genes |
Character vector of gene identifiers to label as positive controls. |
essential.genes |
Character vector of gene identifiers to label as essential genes. |
depmap.genes |
data.frame of DepMap gene summary data. |
A data.frame of gene summary with additional, easier to plot, columns added.
Jared Andrews
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) out.df <- gene_ingress(d1.genes, 0.05, 0.5, es.col = "LFC", sig.col = "fdr")
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) out.df <- gene_ingress(d1.genes, 0.05, 0.5, es.col = "LFC", sig.col = "fdr")
Get essential/selective gene information from DepMap summary table.
get_depmap_essentiality(gene, depmap.summary)
get_depmap_essentiality(gene, depmap.summary)
gene |
Character scalar for gene symbol. |
depmap.summary |
data.frame containing DepMap gene summary information. |
Named list containing RNAi and CRISPR named lists containing dataset information for the provided gene,
if available. If the gene is not found in the summary data.frame, the avail
element for the RNAi and CRISPR lists
will be set to FALSE
.
Jared Andrews
library(CRISPRball) build_depmap_db(retrieve = "gene.summary") pool <- pool::dbPool(RSQLite::SQLite(), dbname = "depmap_db.sqlite") depmap.gene <- pool::dbGetQuery(pool, "SELECT * FROM 'gene.summary'") essentials <- get_depmap_essentiality(gene = "CDK2", depmap.summary = depmap.gene)
library(CRISPRball) build_depmap_db(retrieve = "gene.summary") pool <- pool::dbPool(RSQLite::SQLite(), dbname = "depmap_db.sqlite") depmap.gene <- pool::dbGetQuery(pool, "SELECT * FROM 'gene.summary'") essentials <- get_depmap_essentiality(gene = "CDK2", depmap.summary = depmap.gene)
Based on the requested data type, this function will create a dataframe from the DepMap database that can be used for plotting.
get_depmap_plot_data(gene, data.type, depmap.meta, depmap.pool)
get_depmap_plot_data(gene, data.type, depmap.meta, depmap.pool)
gene |
Character scalar of gene name. |
data.type |
Character scalar of data type to retrieve. One of "dependency", "crispr", "rnai", "cn", or "ccle_tpm". |
depmap.meta |
data.frame of DepMap cell line metadata, as stored in the 'meta' table
of the SQLite database built by |
depmap.pool |
pool connection to DepMap SQLite database built with |
data.frame containing appropriate DepMap data for plotting.
Jared Andrews
## Not run: library(CRISPRball) build_depmap_db(retrieve = c("meta", "crispr")) pool <- pool::dbPool(RSQLite::SQLite(), dbname = "depmap_db.sqlite") depmap.meta <- pool::dbGetQuery(pool, "SELECT * FROM 'meta'") df <- get_depmap_plot_data( gene = "CDK2", data.type = "crispr", depmap.meta = depmap.meta, depmap.pool = pool ) ## End(Not run)
## Not run: library(CRISPRball) build_depmap_db(retrieve = c("meta", "crispr")) pool <- pool::dbPool(RSQLite::SQLite(), dbname = "depmap_db.sqlite") depmap.meta <- pool::dbGetQuery(pool, "SELECT * FROM 'meta'") df <- get_depmap_plot_data( gene = "CDK2", data.type = "crispr", depmap.meta = depmap.meta, depmap.pool = pool ) ## End(Not run)
Create an interactive bar plot for specific summary information for each sample in the dataset.
plot_bar( count.summary, x = "Label", y = "GiniIndex", title = "sgRNA Read Distribution", xlab = NULL, ylab = "Gini Index", fill = "#E69F00", yaxis.addition = 0.05 )
plot_bar( count.summary, x = "Label", y = "GiniIndex", title = "sgRNA Read Distribution", xlab = NULL, ylab = "Gini Index", fill = "#E69F00", yaxis.addition = 0.05 )
count.summary |
data.frame containing the count summary information for each sample. |
x |
Character scalar for column of count.summary to plot along the x-axis. |
y |
Character scalar for column of count.summary to plot along the y-axis. |
title |
Character scalar for title of the plot. |
xlab |
Character scalar for label of the x-axis. |
ylab |
Character scalar for label of the y-axis. |
fill |
Character scalar for bar fill color in hex. |
yaxis.addition |
Numeric scalar for additional space to add to the y-axis. |
An interactive bar chart showing the specified summary information for each sample. The axis and plot title are editable.
Jared Andrews
BarView
, for a static bar plot from the same count summary data.
library(CRISPRball) count.summ <- read.delim(system.file("extdata", "escneg.countsummary.txt", package = "CRISPRball" ), check.names = FALSE) # Gini Index plot plot_bar(count.summ) # Zero count sgRNAs plot plot_bar(count.summ, x = "Label", y = "Zerocounts", title = "Fully Depleted sgRNAs", fill = "#394E80", ylab = "Zero Count sgRNAs", yaxis.addition = 10 )
library(CRISPRball) count.summ <- read.delim(system.file("extdata", "escneg.countsummary.txt", package = "CRISPRball" ), check.names = FALSE) # Gini Index plot plot_bar(count.summ) # Zero count sgRNAs plot plot_bar(count.summ, x = "Label", y = "Zerocounts", title = "Fully Depleted sgRNAs", fill = "#394E80", ylab = "Zero Count sgRNAs", yaxis.addition = 10 )
This function creates a heatmap using ComplexHeatmap to display the correlation values in a matrix. The color of each cell in the heatmap is determined by the corresponding correlation value, using a color ramp that ranges from the minimum value color to a maximum value color.
plot_correlation_heatmap( mat, min.color = "#FF0000", max.color = "#0000FF", legend.title = "Pearson Corr.", plot.title = "Correlation Matrix" )
plot_correlation_heatmap( mat, min.color = "#FF0000", max.color = "#0000FF", legend.title = "Pearson Corr.", plot.title = "Correlation Matrix" )
mat |
A matrix containing the correlation values. |
min.color |
Character scalar for the hexadecimal color code for the minimum values in the heatmap. |
max.color |
Character scalar for the hexadecimal color code for the maximum values in the heatmap. |
legend.title |
Character scalar for title of the legend. |
plot.title |
Character scalar for title of the plot. |
A Heatmap object.
Jared Andrews
library(CRISPRball) norm.counts <- read.delim(system.file("extdata", "escneg.count_normalized.txt", package = "CRISPRball" ), check.names = FALSE) norm.counts <- as.matrix(norm.counts[, c(-1, -2)]) norm.counts.log <- log2(norm.counts + 1) cor.mat <- cor(norm.counts.log) plot_correlation_heatmap(cor.mat)
library(CRISPRball) norm.counts <- read.delim(system.file("extdata", "escneg.count_normalized.txt", package = "CRISPRball" ), check.names = FALSE) norm.counts <- as.matrix(norm.counts[, c(-1, -2)]) norm.counts.log <- log2(norm.counts + 1) cor.mat <- cor(norm.counts.log) plot_correlation_heatmap(cor.mat)
Plot gene copy number information from DepMap
plot_depmap_cn(df, color = "#CEA3CB", plot.grid = FALSE)
plot_depmap_cn(df, color = "#CEA3CB", plot.grid = FALSE)
df |
data.frame containing information for a single gene
as returned by |
color |
Character scalar for trace color. |
plot.grid |
Boolean indicating whether to plot gridlines. |
plotly object
Jared Andrews
library(CRISPRball) data(depmap_22q1_cn) plot_depmap_cn(depmap_22q1_cn)
library(CRISPRball) data(depmap_22q1_cn) plot_depmap_cn(depmap_22q1_cn)
Plot gene dependency information from DepMap CRISPR and RNAi tables
plot_depmap_dependency( df, crispr.color = "#3584B5", rnai.color = "#52288E", depline = TRUE, plot.grid = FALSE )
plot_depmap_dependency( df, crispr.color = "#3584B5", rnai.color = "#52288E", depline = TRUE, plot.grid = FALSE )
df |
data.frame containing information for a single gene
as returned by |
crispr.color |
Character scalar for CRISPR trace color as hexcode. |
rnai.color |
Character scalar for RNAi trace color as hexcode. |
depline |
Boolean indicating whether to show the dependency threshold line. |
plot.grid |
Boolean indicating whether to plot gridlines. |
plotly object
Jared Andrews
library(CRISPRball) data(depmap_22q1_crispr_rnai) plot_depmap_dependency(depmap_22q1_crispr_rnai)
library(CRISPRball) data(depmap_22q1_crispr_rnai) plot_depmap_dependency(depmap_22q1_crispr_rnai)
Plot gene expression information from DepMap, mostly from CCLE
plot_depmap_expression(df, color = "#7B8CB2", plot.grid = FALSE)
plot_depmap_expression(df, color = "#7B8CB2", plot.grid = FALSE)
df |
data.frame containing information for a single gene
as returned by |
color |
Character scalar for trace color. |
plot.grid |
Boolean indicating whether to plot gridlines. |
plotly object
Jared Andrews
library(CRISPRball) data(depmap_22q1_TPM) plot_depmap_expression(depmap_22q1_TPM)
library(CRISPRball) data(depmap_22q1_TPM) plot_depmap_expression(depmap_22q1_TPM)
Plot selected information across lineages from DepMap.
plot_depmap_lineages( df, plot.val, group.by, lineage = NULL, depline = TRUE, label.size = 12, pt.size = 5, pt.color = "#56B4E9", boxplot.fill = "#E2E2E2", boxplot.line.color = "#000000" )
plot_depmap_lineages( df, plot.val, group.by, lineage = NULL, depline = TRUE, label.size = 12, pt.size = 5, pt.color = "#56B4E9", boxplot.fill = "#E2E2E2", boxplot.line.color = "#000000" )
df |
data.frame containing information for a single gene
as returned by |
plot.val |
Character scalar of column name to plot values from. |
group.by |
Character scalar of column name to group by. |
lineage |
Character scalar of lineage for which to plot sub-lineage data. |
depline |
Boolean indicating whether to show the dependency threshold line. |
label.size |
Numeric scaler for axis label size. |
pt.size |
Numeric scalar for point size. |
pt.color |
Character scalar for point color. |
boxplot.fill |
Character scalar for boxplot fill color. |
boxplot.line.color |
Character scalar for boxplot line color. |
plotly object
Jared Andrews
library(CRISPRball) data("depmap_22q1_rnai") plot_depmap_lineages(df = depmap_22q1_rnai, plot.val = "dependency", group.by = "lineage")
library(CRISPRball) data("depmap_22q1_rnai") plot_depmap_lineages(df = depmap_22q1_rnai, plot.val = "dependency", group.by = "lineage")
This function creates a plotly plot with the distribution of values for each
column in the mat
matrix, using different colors for each column.
The legend will show the column names from mat
, and the plot will have
the title "Distribution of read counts".
plot_hist( mat, title = NULL, xlab = "Values", ylab = "Frequency", show.grid = FALSE )
plot_hist( mat, title = NULL, xlab = "Values", ylab = "Frequency", show.grid = FALSE )
mat |
A matrix with the data to plot. |
title |
A character scalar for the title of the plot. |
xlab |
Character scalar for label of the x-axis. |
ylab |
Character scalar for label of the y-axis. |
show.grid |
A boolean for whether to show the grid lines. |
A plotly plot with the distribution of read counts.
Jared Andrews
library(CRISPRball) cts <- read.delim(system.file("extdata", "escneg.count_normalized.txt", package = "CRISPRball" ), check.names = FALSE) cts.log <- as.matrix(log2(cts[, c(-1, -2)] + 1)) colnames(cts.log) <- colnames(cts)[c(-1, -2)] plot_hist(cts.log, title = "Distribution of read counts", xlab = "log2(counts + 1)", ylab = "Frequency" )
library(CRISPRball) cts <- read.delim(system.file("extdata", "escneg.count_normalized.txt", package = "CRISPRball" ), check.names = FALSE) cts.log <- as.matrix(log2(cts[, c(-1, -2)] + 1)) colnames(cts.log) <- colnames(cts)[c(-1, -2)] plot_hist(cts.log, title = "Distribution of read counts", xlab = "log2(counts + 1)", ylab = "Frequency" )
Create an interactive lawn plot for data with significance values.
Typically, this plot is randomly ordered along the x-axis,
but the user is free to order it by any term in res
that they'd like.
plot_lawn( res, ylim = 5, fc.thresh = 0.5, hover.info = NULL, sig.line = TRUE, h.id = "crispr", feat.term = "rows", x.term = "RandomIndex", sig.term = "fdr", lfc.term = "LFC", down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = TRUE, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_lawn" )
plot_lawn( res, ylim = 5, fc.thresh = 0.5, hover.info = NULL, sig.line = TRUE, h.id = "crispr", feat.term = "rows", x.term = "RandomIndex", sig.term = "fdr", lfc.term = "LFC", down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = TRUE, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_lawn" )
res |
Dataframe containing, at minimum, significance values and a term by which the x-axis can be ordered. |
ylim |
Positive numeric scalar indicating y-axis limits. The negative value will be used for the lower limit. |
fc.thresh |
Numeric scalar indicating the fold change threshold for coloring significant features. |
hover.info |
Character vector indicating which additional columns from |
sig.line |
Logical indicating whether to add a significance threshold line to the plot. |
h.id |
Character scalar indicating the unique ID of the plotly object. Can usually be ignored, but should be used if multiple plots are being created in the same R session (e.g. Shiny app). |
feat.term |
Character scalar indicating the column name of the feature IDs in |
x.term |
Character scalar for the x-axis term from |
sig.term |
Character scalar indicating the column name of the significance values in |
lfc.term |
Character scalar indicating the column name of the log fold change values in |
down.color |
Character scalar indicating the color of down-regulated features. |
up.color |
Character scalar indicating the color of up-regulated features. |
insig.color |
Character scalar indicating the color of insignificant features. |
sig.thresh |
Numeric scalar indicating the significance threshold for coloring significant features. |
fs |
Dataframe containing coordinates and label information for points that should be labeled. Columns should be:
|
sig.size |
Numeric scalar indicating the size of significant feature points. |
insig.size |
Numeric scalar indicating the size of insignificant feature points. |
sig.opacity |
Numeric scalar indicating the opacity of significant feature points. |
insig.opacity |
Numeric scalar indicating the opacity of insignificant feature points. |
label.size |
Numeric scalar indicating the size of feature labels. |
webgl |
Logical indicating whether to use WebGL for rendering the plot. |
webgl.ratio |
Numeric scalar indicating the ratio of WebGL to HTML5 canvas rendering, increases resolution of saved plot when WebGL plotting is not used. |
show.counts |
Logical indicating whether to show annotations for the number of features in the plot. |
show.hl.counts |
Logical indicating whether to show annotations for the number of highlighted features in the plot. |
counts.size |
Numeric scalar indicating the size of the feature counts labels. |
highlight.featsets |
Character vector indicating which feature sets should be highlighted. |
highlight.feats |
Character vector indicating which features should be highlighted. |
featsets |
Named list of feature sets to be used for highlighting. |
highlight.feats.color |
Character scalar indicating the color of highlighted features. |
highlight.feats.size |
Numeric scalar indicating the size of highlighted features. |
highlight.feats.opac |
Numeric scalar indicating the opacity of highlighted features. |
highlight.feats.linecolor |
Character scalar indicating the line color of highlighted features. |
highlight.feats.linewidth |
Numeric scalar indicating the line width of highlighted features. |
highlight.feats.label |
Logical indicating whether to label highlighted features. |
highlight.featsets.color |
Character scalar indicating the color of highlighted feature sets. |
highlight.featsets.size |
Numeric scalar indicating the point size of highlighted feature sets. |
highlight.featsets.opac |
Numeric scalar indicating the opacity of highlighted feature sets. |
highlight.featsets.linecolor |
Character scalar indicating the line color of highlighted feature sets. |
highlight.featsets.linewidth |
Numeric scalar indicating the line width of highlighted feature sets. |
highlight.featsets.label |
Logical indicating whether to label highlighted feature sets. |
h.id.suffix |
Character scalar indicating the suffix to be added to the plotly object ID. |
An interactive plotly rank plot.
Jared Andrews
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_lawn(plot.df, feat.term = "id")
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_lawn(plot.df, feat.term = "id")
pca
objectThis function plots a biplot from a PCAtools pca
object.
plot_pca_biplot( pca.res, dim.x = "PC1", dim.y = "PC2", dim.z = NULL, plot.title = "PCA Biplot", color.by = NULL, shape.by = NULL, hover.info = NULL, show.loadings = FALSE, n.loadings = 3, pt.size = 12 )
plot_pca_biplot( pca.res, dim.x = "PC1", dim.y = "PC2", dim.z = NULL, plot.title = "PCA Biplot", color.by = NULL, shape.by = NULL, hover.info = NULL, show.loadings = FALSE, n.loadings = 3, pt.size = 12 )
pca.res |
A |
dim.x |
Character scalar for the principal component to plot on the x-axis. |
dim.y |
Character scalar for the principal component to plot on the y-axis. |
dim.z |
Character scalar for the principal component to plot on the z-axis. |
plot.title |
Character scalar for the title of the plot. |
color.by |
Character scalar for the column name to use for coloring points. |
shape.by |
Character scalar for the column name to use for shaping points. |
hover.info |
Character vector of column name(s) to include in the hover info for each point. |
show.loadings |
Boolean indicating whether to show component loadings on the plot. |
n.loadings |
Integer for number of loadings to show. |
pt.size |
Numeric size of the plotted points. |
A plotly plot of the PCA biplot, or a text grob indicating no PCA was provided.
Jared Andrews
library("PCAtools") library("CRISPRball") col <- 10 row <- 2000 mat <- matrix( rexp(col * row, rate = 0.1), ncol = col ) rownames(mat) <- paste0("gene", seq_len(nrow(mat))) colnames(mat) <- paste0("sample", seq_len(ncol(mat))) metadata <- data.frame(row.names = colnames(mat)) metadata$Group <- rep(NA, ncol(mat)) metadata$Group[seq(1, 10, 2)] <- "A" metadata$Group[seq(2, 10, 2)] <- "B" p <- pca(mat, metadata = metadata, removeVar = 0.1) plot_pca_biplot(p, color.by = "Group")
library("PCAtools") library("CRISPRball") col <- 10 row <- 2000 mat <- matrix( rexp(col * row, rate = 0.1), ncol = col ) rownames(mat) <- paste0("gene", seq_len(nrow(mat))) colnames(mat) <- paste0("sample", seq_len(ncol(mat))) metadata <- data.frame(row.names = colnames(mat)) metadata$Group <- rep(NA, ncol(mat)) metadata$Group[seq(1, 10, 2)] <- "A" metadata$Group[seq(2, 10, 2)] <- "B" p <- pca(mat, metadata = metadata, removeVar = 0.1) plot_pca_biplot(p, color.by = "Group")
Create an interactive rank plot for data with fold change, significance terms, and rank.
plot_rank( res, ylim = c(-10, 10), y.thresh = 0.5, y.lines = TRUE, hover.info = NULL, h.id = "crispr", feat.term = "rows", sig.term = "fdr", rank.term = "LFC", rank.ascending = TRUE, down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = TRUE, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_volc" )
plot_rank( res, ylim = c(-10, 10), y.thresh = 0.5, y.lines = TRUE, hover.info = NULL, h.id = "crispr", feat.term = "rows", sig.term = "fdr", rank.term = "LFC", rank.ascending = TRUE, down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = TRUE, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_volc" )
res |
Dataframe containing, at minimum, significance values and something to rank by (LFC, RRA score, betas, etc). |
ylim |
Numeric vector of length two for the y-axis limits. |
y.thresh |
Numeric scalar used as the y-axis threshold for point coloring. The negative of this value is also used as the threshold. |
y.lines |
Logical as for whether or not to show horizontal lines at |
hover.info |
Character vector indicating which additional columns from |
h.id |
Character scalar indicating the unique ID of the plotly object. Can usually be ignored, but should be used if multiple plots are being created in the same R session (e.g. Shiny app). |
feat.term |
Character scalar indicating the column name of the feature IDs in |
sig.term |
Character scalar indicating the column name of the significance values in |
rank.term |
Character scalar for the term to rank by from |
rank.ascending |
Boolean indicating whether or not the rank should be ascending. |
down.color |
Character scalar indicating the color of down-regulated features. |
up.color |
Character scalar indicating the color of up-regulated features. |
insig.color |
Character scalar indicating the color of insignificant features. |
sig.thresh |
Numeric scalar indicating the significance threshold for coloring significant features. |
fs |
Dataframe containing coordinates and label information for points that should be labeled. Columns should be:
|
sig.size |
Numeric scalar indicating the size of significant feature points. |
insig.size |
Numeric scalar indicating the size of insignificant feature points. |
sig.opacity |
Numeric scalar indicating the opacity of significant feature points. |
insig.opacity |
Numeric scalar indicating the opacity of insignificant feature points. |
label.size |
Numeric scalar indicating the size of feature labels. |
webgl |
Logical indicating whether to use WebGL for rendering the plot. |
webgl.ratio |
Numeric scalar indicating the ratio of WebGL to HTML5 canvas rendering, increases resolution of saved plot when WebGL plotting is not used. |
show.counts |
Logical indicating whether to show annotations for the number of features in the plot. |
show.hl.counts |
Logical indicating whether to show annotations for the number of highlighted features in the plot. |
counts.size |
Numeric scalar indicating the size of the feature counts labels. |
highlight.featsets |
Character vector indicating which feature sets should be highlighted. |
highlight.feats |
Character vector indicating which features should be highlighted. |
featsets |
Named list of feature sets to be used for highlighting. |
highlight.feats.color |
Character scalar indicating the color of highlighted features. |
highlight.feats.size |
Numeric scalar indicating the size of highlighted features. |
highlight.feats.opac |
Numeric scalar indicating the opacity of highlighted features. |
highlight.feats.linecolor |
Character scalar indicating the line color of highlighted features. |
highlight.feats.linewidth |
Numeric scalar indicating the line width of highlighted features. |
highlight.feats.label |
Logical indicating whether to label highlighted features. |
highlight.featsets.color |
Character scalar indicating the color of highlighted feature sets. |
highlight.featsets.size |
Numeric scalar indicating the point size of highlighted feature sets. |
highlight.featsets.opac |
Numeric scalar indicating the opacity of highlighted feature sets. |
highlight.featsets.linecolor |
Character scalar indicating the line color of highlighted feature sets. |
highlight.featsets.linewidth |
Numeric scalar indicating the line width of highlighted feature sets. |
highlight.featsets.label |
Logical indicating whether to label highlighted feature sets. |
h.id.suffix |
Character scalar indicating the suffix to be added to the plotly object ID. |
An interactive plotly rank plot.
Jared Andrews
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_rank(plot.df, feat.term = "id")
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_rank(plot.df, feat.term = "id")
Create an interactive volcano plot for data with fold change and significance terms.
plot_volcano( res, xlim = 5, ylim = 5, fc.thresh = 0.5, fc.lines = TRUE, hover.info = NULL, sig.line = TRUE, h.id = "crispr", feat.term = "rows", sig.term = "fdr", lfc.term = "LFC", down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = 8, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_volc" )
plot_volcano( res, xlim = 5, ylim = 5, fc.thresh = 0.5, fc.lines = TRUE, hover.info = NULL, sig.line = TRUE, h.id = "crispr", feat.term = "rows", sig.term = "fdr", lfc.term = "LFC", down.color = "#0026ff", up.color = "#ff0000", insig.color = "#A6A6A6", sig.thresh = 0.05, fs = NULL, sig.size = 6, insig.size = 5, sig.opacity = 1, insig.opacity = 0.5, label.size = 10, webgl = TRUE, webgl.ratio = 7, show.counts = TRUE, show.hl.counts = TRUE, counts.size = 8, highlight.featsets = NULL, highlight.feats = NULL, featsets = NULL, highlight.feats.color = "#E69F00", highlight.feats.size = 7, highlight.feats.opac = 1, highlight.feats.linecolor = "#000000", highlight.feats.linewidth = 1, highlight.feats.label = TRUE, highlight.featsets.color = "#009E73", highlight.featsets.size = 7, highlight.featsets.opac = 1, highlight.featsets.linecolor = "#000000", highlight.featsets.linewidth = 1, highlight.featsets.label = FALSE, h.id.suffix = "_volc" )
res |
Dataframe containing, at minimum, fold change and significance values. |
xlim |
Positive numeric scalar indicating x-axis limits. The negative value will be used for the lower limit. |
ylim |
Positive numeric scalar indicating y-axis limits. The negative value will be used for the lower limit. |
fc.thresh |
Numeric scalar indicating the fold change threshold for coloring significant features. |
fc.lines |
Logical indicating whether to add fold change threshold lines to the plot. |
hover.info |
Character vector indicating which additional columns from |
sig.line |
Logical indicating whether to add a significance threshold line to the plot. |
h.id |
Character scalar indicating the unique ID of the plotly object. Can usually be ignored, but should be used if multiple plots are being created in the same R session (e.g. Shiny app). |
feat.term |
Character scalar indicating the column name of the feature IDs in |
sig.term |
Character scalar indicating the column name of the significance values in |
lfc.term |
Character scalar indicating the column name of the log fold change values in |
down.color |
Character scalar indicating the color of down-regulated features. |
up.color |
Character scalar indicating the color of up-regulated features. |
insig.color |
Character scalar indicating the color of insignificant features. |
sig.thresh |
Numeric scalar indicating the significance threshold for coloring significant features. |
fs |
Dataframe containing coordinates and label information for points that should be labeled. Columns should be:
|
sig.size |
Numeric scalar indicating the size of significant feature points. |
insig.size |
Numeric scalar indicating the size of insignificant feature points. |
sig.opacity |
Numeric scalar indicating the opacity of significant feature points. |
insig.opacity |
Numeric scalar indicating the opacity of insignificant feature points. |
label.size |
Numeric scalar indicating the size of feature labels. |
webgl |
Logical indicating whether to use WebGL for rendering the plot. |
webgl.ratio |
Numeric scalar indicating the ratio of WebGL to HTML5 canvas rendering, increases resolution of saved plot when WebGL plotting is not used. |
show.counts |
Logical indicating whether to show annotations for the number of features in the plot. |
show.hl.counts |
Logical indicating whether to show annotations for the number of highlighted features in the plot. |
counts.size |
Numeric scalar indicating the size of the feature counts labels. |
highlight.featsets |
Character vector indicating which feature sets should be highlighted. |
highlight.feats |
Character vector indicating which features should be highlighted. |
featsets |
Named list of feature sets to be used for highlighting. |
highlight.feats.color |
Character scalar indicating the color of highlighted features. |
highlight.feats.size |
Numeric scalar indicating the size of highlighted features. |
highlight.feats.opac |
Numeric scalar indicating the opacity of highlighted features. |
highlight.feats.linecolor |
Character scalar indicating the line color of highlighted features. |
highlight.feats.linewidth |
Numeric scalar indicating the line width of highlighted features. |
highlight.feats.label |
Logical indicating whether to label highlighted features. |
highlight.featsets.color |
Character scalar indicating the color of highlighted feature sets. |
highlight.featsets.size |
Numeric scalar indicating the point size of highlighted feature sets. |
highlight.featsets.opac |
Numeric scalar indicating the opacity of highlighted feature sets. |
highlight.featsets.linecolor |
Character scalar indicating the line color of highlighted feature sets. |
highlight.featsets.linewidth |
Numeric scalar indicating the line width of highlighted feature sets. |
highlight.featsets.label |
Logical indicating whether to label highlighted feature sets. |
h.id.suffix |
Character scalar indicating the suffix to be added to the plotly object ID. |
An interactive plotly volcano plot.
Jared Andrews
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_volcano(plot.df, feat.term = "id")
library(CRISPRball) d1.genes <- read.delim(system.file("extdata", "esc1.gene_summary.txt", package = "CRISPRball" ), check.names = FALSE) plot.df <- gene_ingress(d1.genes, sig.thresh = 0.05, es.thresh = 0.5, es.col = "LFC", sig.col = "fdr" ) plot_volcano(plot.df, feat.term = "id")
This function reads the gene summary file output by mageck mle
and
parses it into a list of data.frames, one for each sample. The sample names
are extracted from the column names of the input file and used as the names
of the list elements.
read_mle_gene_summary(filepath)
read_mle_gene_summary(filepath)
filepath |
Path to the gene summary file output by |
A named list of data.frames containing MAGeCK MLE output, one for each sample contained in the file.
Jared Andrews
library(CRISPRball) mle_gene_summary <- file.path(system.file("extdata", "beta_leukemia.gene_summary.txt", package = "CRISPRball" )) gene_data <- read_mle_gene_summary(mle_gene_summary)
library(CRISPRball) mle_gene_summary <- file.path(system.file("extdata", "beta_leukemia.gene_summary.txt", package = "CRISPRball" )) gene_data <- read_mle_gene_summary(mle_gene_summary)