| Title: | An 'Shiny' App for Exploring scRNA-seq Data Processed in 'Seurat' |
|---|---|
| Description: | A simple, one-command package which runs an interactive dashboard capable of common visualizations for single cell RNA-seq. 'SeuratExplorer' requires a processed 'Seurat' object, which is saved as 'rds' or 'qs2' file. |
| Authors: | Yongchao Zhang [aut, cre] (https://github.com/fentouxungui) |
| Maintainer: | Yongchao Zhang <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.9 |
| Built: | 2026-10-15 11:53:52 UTC |
| Source: | https://github.com/fentouxungui/seuratexplorer |
support facet, codes refer to: https://github.com/junjunlab/scRNAtoolVis/blob/master/R/cellRatioPlot.R, with modification
cellRatioPlot( object = NULL, idents = NULL, sample.name = NULL, sample.order = NULL, celltype.name = NULL, celltype.order = NULL, facet.name = NULL, facet.order = NULL, col.width = 0.7, flow.alpha = 0.25, flow.curve = 0, color.choice = NULL )cellRatioPlot( object = NULL, idents = NULL, sample.name = NULL, sample.order = NULL, celltype.name = NULL, celltype.order = NULL, facet.name = NULL, facet.order = NULL, col.width = 0.7, flow.alpha = 0.25, flow.curve = 0, color.choice = NULL )
object |
an Seurat object |
idents |
idents used, default all idents |
sample.name |
x axis |
sample.order |
order for x axis |
celltype.name |
column fill by |
celltype.order |
order for fill by |
facet.name |
column name for facet |
facet.order |
the order for facet |
col.width |
column width, from 0-1 |
flow.alpha |
transparency for flow |
flow.curve |
curve for flow |
color.choice |
color choice for fill |
a ggplot2 object
#NULL#NULL
explorer_sidebar_ui
generate the body UI for each menu item specified in explorer_sidebar_ui
explorer_body_ui(tab_list)explorer_body_ui(tab_list)
tab_list |
a tag list for the body UI of shiny dashboard |
a filled tag list for body UI
tab_list <- list() tab_list <- explorer_body_ui(tab_list = tab_list)tab_list <- list() tab_list <- explorer_body_ui(tab_list = tab_list)
explorer_sidebar_ui
server side functions related to explorer_sidebar_ui
explorer_server(input, output, session, data, verbose = FALSE)explorer_server(input, output, session, data, verbose = FALSE)
input |
server input |
output |
server output |
session |
server session |
data |
the Seurat object and related parameters |
verbose |
for debug use |
server side functions related to explorer_sidebar_ui
to generate some menu items for the dashboard, which can be integrated to other packages, such as 'fentouxungui/SeuratExplorerServer' from github.
explorer_sidebar_ui()explorer_sidebar_ui()
return some menu items for the dashboard
explorer_sidebar_ui()explorer_sidebar_ui()
A data set containing the gene information from species of human, mouse and fly.
GenesDBGenesDB
A list:
a data frame, with columns: "Ensembl","Symbol", "EntrezID", "UniProt", "Name", "Alias"
a data frame, with columns: "Ensembl","Symbol", "MGI", "EntrezID", "UniProt", "Name", "Alias"
a data frame, with columns: "Ensembl","Symbol", "HGNC", "EntrezID", "UniProt", "Name", "Alias"
Helper function to extract counts matrix with proper handling
get_counts_matrix(SeuratObj, assay = "RNA")get_counts_matrix(SeuratObj, assay = "RNA")
SeuratObj |
A Seurat object |
assay |
Assay name |
A counts matrix
Helper function to extract data matrix with proper handling
get_data_matrix(SeuratObj, assay = "RNA")get_data_matrix(SeuratObj, assay = "RNA")
SeuratObj |
A Seurat object |
assay |
Assay name |
A data matrix
getColors
getColors(color.platte = NULL, choice = "default", n = NULL)getColors(color.platte = NULL, choice = "default", n = NULL)
color.platte |
predefined color list |
choice |
color name |
n |
how many colors to return |
a color list
# null# null
Helper function to join layers for Assay5 objects
join_layers_if_needed(SeuratObj, assay = "RNA")join_layers_if_needed(SeuratObj, assay = "RNA")
SeuratObj |
A Seurat object |
assay |
Assay name |
Seurat object with joined layers
used to launch the shiny app in a web browser.
launchSeuratExplorer( verbose = FALSE, ReductionKeyWords = c("umap", "tsne", "pca"), SplitOptionMaxLevel = 12, MaxInputFileSize = 20 * 1024^3, DemoDataURL = c("https://raw.githubusercontent.com/fentouxungui/SeuratExplorerServer/refs/heads/main/inst/extdata/source-data/fly/Rds-file/G101_PC20res04.rds", "https://drive.usercontent.google.com/download?id=1iscfl4zyNbtjAol0bwndnBI08MDcZvYE&export=download&authuser=0&confirm=t&uuid=6352f610-9125-4551-afaa-e1eedd15701c&at=AMrWOn0YlTymrOPO6Rb0GlFtJ07o%3A1790127440033", "https://www.daokedao.site/data/G101_PC20res04.rds"), DemoDataCacheDir = NULL, DemoDataMD5 = "e144cabc42684f037e60a603f74ed4f1" )launchSeuratExplorer( verbose = FALSE, ReductionKeyWords = c("umap", "tsne", "pca"), SplitOptionMaxLevel = 12, MaxInputFileSize = 20 * 1024^3, DemoDataURL = c("https://raw.githubusercontent.com/fentouxungui/SeuratExplorerServer/refs/heads/main/inst/extdata/source-data/fly/Rds-file/G101_PC20res04.rds", "https://drive.usercontent.google.com/download?id=1iscfl4zyNbtjAol0bwndnBI08MDcZvYE&export=download&authuser=0&confirm=t&uuid=6352f610-9125-4551-afaa-e1eedd15701c&at=AMrWOn0YlTymrOPO6Rb0GlFtJ07o%3A1790127440033", "https://www.daokedao.site/data/G101_PC20res04.rds"), DemoDataCacheDir = NULL, DemoDataMD5 = "e144cabc42684f037e60a603f74ed4f1" )
verbose |
for debug use |
ReductionKeyWords |
key words used for prepare Reduction options |
SplitOptionMaxLevel |
max level cutoff for prepare Split options |
MaxInputFileSize |
set the limited upload file size |
DemoDataURL |
one or more URLs of the demo Seurat object downloaded by the "Download and Run a demo data" button. Multiple URLs are tried in order until one succeeds (primary, then backup) |
DemoDataCacheDir |
directory used to cache the downloaded demo data; if NULL, a per-user cache directory is used |
DemoDataMD5 |
expected md5 checksum of the downloaded demo data; set to NULL to skip the integrity check |
In-browser Shiny Application launch
if(interactive()){launchSeuratExplorer()}if(interactive()){launchSeuratExplorer()}
Creates a styled, collapsible parameter group for the Plot Settings sidebar. Clicking the header toggles visibility of the content area. The group preserves the existing color-coded left border styling.
param_group_collapse(id, title, icon_name, color = "#3b82f6", ...)param_group_collapse(id, title, icon_name, color = "#3b82f6", ...)
id |
A unique identifier for the collapse target (used as the div ID). |
title |
Character string for the group header title. |
icon_name |
Character string passed to |
color |
Hex color string for the left border and title accent. Default: "#3b82f6". |
... |
UI elements to place inside the collapsible content area. Groups always start expanded. |
A shiny.tag div representing the collapsible parameter group.
extract the features from row names or annotation slot of assays
prepare_gene_annotations(obj, verbose = FALSE)prepare_gene_annotations(obj, verbose = FALSE)
obj |
a Seurat object |
verbose |
whether output messages |
a list with data.frames
#NULL#NULL
Server
server(input, output, session)server(input, output, session)
input |
Input from the UI |
output |
Output to send back to UI |
session |
from shiny server function |
the server functions of shiny app
for each cell, find genes that has high UMI percentage, for example, if a cell has 10000 UMIs, and the UMI percentage cutoff is set to 0.01, then all genes that has more than 10000 * 0.01 = 100 UMIs is thought to be the highly expressed genes for this cell.summary those genes for each cluster, firstly get all highly expressed genes in a cluster, some genes may has less cells, then for each gene, count cells in which this genes is highly expressed, and also calculate the mean and median UMI percentage in those highly expressed cells.
top_genes(SeuratObj, percent.cut = 0.01, group.by, assay = "RNA")top_genes(SeuratObj, percent.cut = 0.01, group.by, assay = "RNA")
SeuratObj |
Seurat object |
percent.cut |
UMI percentage cutoff, in a cell, if a gene with UMIs ratio more than this cutoff, this gene will be assigned to highly expressed gene for this cell |
group.by |
how to group cells |
assay |
which assay used |
a data frame