| 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.5 |
| Built: | 2026-06-04 11:18:00 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
Launch shiny app
launchSeuratExplorer( verbose = FALSE, ReductionKeyWords = c("umap", "tsne"), SplitOptionMaxLevel = 12, MaxInputFileSize = 20 * 1024^3 )launchSeuratExplorer( verbose = FALSE, ReductionKeyWords = c("umap", "tsne"), SplitOptionMaxLevel = 12, MaxInputFileSize = 20 * 1024^3 )
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 |
In-browser Shiny Application launch
if(interactive()){launchSeuratExplorer()}if(interactive()){launchSeuratExplorer()}
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