plotGeneExprHistAcrossCells: Histogram of Gene / Geneset Aggregate Expression Across Cells

View source: R/Seurat.Utils.Visualization.R

plotGeneExprHistAcrossCellsR Documentation

Histogram of Gene / Geneset Aggregate Expression Across Cells

Description

Creates and optionally saves a histogram showing expression levels of specified genes within a Seurat object. Provides options for aggregate gene expression, expression threshold filtering, and quantile clipping for count data.

Usage

plotGeneExprHistAcrossCells(
  genes = c("MALAT1", "MT-CO1", "MT-CO2", "MT-CYB", "TMSB4X", "KAZN"),
  obj = combined.obj,
  assay = "RNA",
  layerX = "data",
  thr_expr = 10,
  suffix = NULL,
  prefix = NULL,
  plotname = c("Summed Gene-set Expression -", "Expression of"),
  xlab = paste0("Expression -log10(Summed UMIs @", layerX, ")"),
  return_cells_passing = TRUE,
  clip_count_qtl_thr = 0.99,
  log10_counts = TRUE,
  return_quantile,
  w = 9,
  h = 5,
  show_plot = TRUE,
  ...
)

Arguments

genes

Vector of gene names to include in the analysis; Default: c("MALAT1", "MT-CO1").

obj

Seurat object to analyze; Default: combined.obj.

assay

Assay to use from the Seurat object; Default: "RNA".

layerX

Data slot to use ('data' or 'counts'); Default: "data".

thr_expr

Expression threshold for highlighting in the plot; Default: 10.

suffix

Additional text to append to the plot title; Default: NULL.

prefix

Additional text to prepend to the plot title; Default: NULL.

xlab

Label for the x-axis; Default: "log10(Summed UMI count @data)".

return_cells_passing

If TRUE, returns count of cells exceeding the expression threshold; Default: TRUE.

clip_count_qtl_thr

Quantile threshold for clipping if using count data; Default: 0.95. Needed for visualization (to avoid x axis compression).

log10_counts

If TRUE, log10-transforms the COUNT expression values; Default: TRUE.

return_quantile

If TRUE, returns cell count exceeding the quantile threshold; Default: FALSE.

w

Width of the plot in inches; Default: 9.

h

Height of the plot in inches; Default: 5.

show_plot

If TRUE, displays the generated plot; Default: TRUE.

...

Additional arguments for customization.

Value

Depending on the parameters, can return a ggplot object, the number of cells passing the expression threshold, or the number of cells exceeding the quantile threshold.

Depending on the parameters, can return a ggplot object, the number of cells passing the expression threshold, or the number of cells exceeding the quantile threshold.

Examples

## Not run: 
plotGeneExprHistAcrossCells(obj = yourSeuratObject, genes = c("GeneA", "GeneB"))

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.