| Title: | Multi-panel visualization for single cell expression data |
|---|---|
| Description: | scGenePanel creates coordinated, gene-centric multi-panel visualizations for single-cell RNA-seq data stored in Seurat or SingleCellExperiment objects. It combines group-stratified UMAP embeddings, cell-type-specific expression distributions, and quantitative cell-frequency and expression summaries in a single figure. An accompanying Shiny application supports interactive exploration using the same workflow. |
| Authors: | Shristi Shrestha [aut] (ORCID: <https://orcid.org/0000-0003-4519-1712>), Jean-Philippe Cartailler [aut, cre] (ORCID: <https://orcid.org/0000-0002-0312-2391>) |
| Maintainer: | Jean-Philippe Cartailler <[email protected]> |
| License: | AGPL-3 + file LICENSE |
| Version: | 0.99.0 |
| Built: | 2026-10-08 07:59:43 UTC |
| Source: | https://github.com/BiocStaging/scGenePanel |
Check if the specified dimension reduction embedding exists in the Seurat object
.check_if_dim_red_exists(seurat_obj, dim_red).check_if_dim_red_exists(seurat_obj, dim_red)
seurat_obj |
A Seurat object |
dim_red |
The name of the dimension reduction embedding to check |
returns an error message if the specified dimension reduction does not exist #' @noRd
Discrete color palettes from multiple packages (varibow, Rcolorbrewer, ggtheme)
discrete_col_palette(num_colors, hex_cols = NULL, palette = NULL)discrete_col_palette(num_colors, hex_cols = NULL, palette = NULL)
num_colors |
Number of colors to be generated. |
hex_cols |
hex code of the colors to be selected for violin plot |
palette |
Options are "Tableau" or RColorBrewer qualitative variables like "Dark2","Paired","Set1","Set2", "Set3", "Accent" etc. if empty, the function will use based on the entered n. |
A color palette for plotting violin plot
scGenePanel exports a multi-panel scRNAseq gene expression plots of
UMAP clusters highlighted with user defined cell types and split view on
user defined sample groups, violin plot with user defined sample groups
along with tabular cell counts, ratios and expression values per sample
group, in one visual
scGenePanel( object, gene, meta_group, cell_type_name, cell_type_colname, dim_red = "umap", col_palette = "Tableau", group_order = NULL, output_dir = tempdir() )scGenePanel( object, gene, meta_group, cell_type_name, cell_type_colname, dim_red = "umap", col_palette = "Tableau", group_order = NULL, output_dir = tempdir() )
object |
A Seurat or SingleCellExperiment object. Seurat objects will be automatically updated to the current package version if needed |
gene |
Name of gene to explore gene expression in UMAP, violin plot, and cell frequency table |
meta_group |
The metadata column name of the variable to split the UMAP, violinplot and cell frequency table by. for example, to split by disease condition |
cell_type_name |
The cell type identity to highlight in UMAP |
cell_type_colname |
The metadata column name that contains the cell identity annotations |
dim_red |
Dimension reduction embedding to use |
col_palette |
Color palettes to choose for violinplot panel. Options are "Tableau" or RColorBrewer qualitative variables like "Dark2", "Paired", "Set1", "Set2", "Set3", "Accent" etc. |
group_order |
User defined order of the meta_groups to be displayed |
output_dir |
Output directory where the image will be saved |
A ggplot object containing a multi-panel visualization with UMAP plots, violin plots, and cell frequency statistics for the specified gene and cell type
# Load example pancreatic islet data from package example_file <- system.file( "extdata", "human_panc_islets.Rds", package = "scGenePanel") human_panc_islets <- readRDS(example_file) # Basic usage - create gene panel for insulin expression in beta cells panel <- scGenePanel( object = human_panc_islets, gene = "INS", # Insulin gene meta_group = "Age", # Group by age (14y, 39y, 50y, 59y, 66y) cell_type_name = "Beta", # Highlight beta cells cell_type_colname = "CellTypes" # Cell type column ) # Advanced usage with custom colors and ordering panel_advanced <- scGenePanel( object = human_panc_islets, gene = "GCG", # Glucagon for alpha cells meta_group = "Sex", # Group by sex (F/M) cell_type_name = "Alpha", # Highlight alpha cells cell_type_colname = "CellTypes", col_palette = "Set2", # Custom color palette group_order = c("F", "M"), # Custom group order output_dir = tempdir() # Save to temp directory ) # Example with different cell type and gene somatostatin_panel <- scGenePanel( object = human_panc_islets, gene = "SST", # Somatostatin for delta cells meta_group = "Batch", # Group by batch cell_type_name = "Delta", # Highlight delta cells cell_type_colname = "CellTypes" )# Load example pancreatic islet data from package example_file <- system.file( "extdata", "human_panc_islets.Rds", package = "scGenePanel") human_panc_islets <- readRDS(example_file) # Basic usage - create gene panel for insulin expression in beta cells panel <- scGenePanel( object = human_panc_islets, gene = "INS", # Insulin gene meta_group = "Age", # Group by age (14y, 39y, 50y, 59y, 66y) cell_type_name = "Beta", # Highlight beta cells cell_type_colname = "CellTypes" # Cell type column ) # Advanced usage with custom colors and ordering panel_advanced <- scGenePanel( object = human_panc_islets, gene = "GCG", # Glucagon for alpha cells meta_group = "Sex", # Group by sex (F/M) cell_type_name = "Alpha", # Highlight alpha cells cell_type_colname = "CellTypes", col_palette = "Set2", # Custom color palette group_order = c("F", "M"), # Custom group order output_dir = tempdir() # Save to temp directory ) # Example with different cell type and gene somatostatin_panel <- scGenePanel( object = human_panc_islets, gene = "SST", # Somatostatin for delta cells meta_group = "Batch", # Group by batch cell_type_name = "Delta", # Highlight delta cells cell_type_colname = "CellTypes" )
scGenePanelShiny launches a Shiny web application for interactive
exploration of single-cell gene expression data with dynamic parameter
selection.
scGenePanelShiny(object = NULL)scGenePanelShiny(object = NULL)
object |
A Seurat or SingleCellExperiment object. If NULL, loads example data |
Invisibly returns NULL. Function is called for its side effect of launching the Shiny application.
# Example 1: Launch with example data if (interactive()){ scGenePanelShiny() } # Example 2: Launch with seurat object data <- readRDS(system.file("extdata", "human_panc_islets.Rds", package = "scGenePanel")) if (interactive()){ scGenePanelShiny(data) } # Example 3: Launch with SCE object data <- readRDS(system.file("extdata", "sce_object.Rds", package = "scGenePanel")) if (interactive()){ scGenePanelShiny(data) }# Example 1: Launch with example data if (interactive()){ scGenePanelShiny() } # Example 2: Launch with seurat object data <- readRDS(system.file("extdata", "human_panc_islets.Rds", package = "scGenePanel")) if (interactive()){ scGenePanelShiny(data) } # Example 3: Launch with SCE object data <- readRDS(system.file("extdata", "sce_object.Rds", package = "scGenePanel")) if (interactive()){ scGenePanelShiny(data) }