SeuratExplorer

Badge AskDeepWiki AskZreadAI

An Shiny App for Exploring scRNA-seq Data Processed in Seurat

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.

Why build this R package

Currently, there is still no good tools for visualising the analysis results from Seurat, when the bioinformatics analyst hands over the results to the user, if the user does not have any R language foundation, it is still difficult to retrieve the results and re-analysis on their own, and this R package is designed to help such users to visualize and explore the anaysis results. The only thing to do for such users is to configure R and Rstudio on their own computers, and then install SeuratExplorer, without any other operations, an optional way is to upload the Seurat object file to a server which has been deployed with shinyserver and SeuratExplorer.

Essentially, what SeuratExplorer done is just to perform visual operations for command line tools from Seurat or other packages.

Key Features

Installation

Install the latest version from github - Recommended:

if(!require(devtools)){install.packages("devtools")}
install_github("fentouxungui/SeuratExplorer", dependencies = TRUE)

Or install from CRAN:

# Install non-CRAN dependencies first
if (!require("BiocManager", quietly = TRUE)){
  install.packages("BiocManager")
}
BiocManager::install(c("ComplexHeatmap", "MAST", "limma", "DESeq2"))

# Install presto from GitHub
if(!require(devtools)){
  install.packages("devtools")
}
devtools::install_github("immunogenomics/presto")

# Install SeuratExplorer from CRAN
install.packages("SeuratExplorer")

System Requirements:

Run app on local

library(SeuratExplorer)
launchSeuratExplorer()

You can customize the launch behavior with additional parameters:

# Example with custom parameters
launchSeuratExplorer(
  verbose = TRUE,
  ReductionKeyWords = c("umap", "tsne", "pca"),
  MaxInputFileSize = 10*1024^3  # 10GB
)

Exported Functions

Besides the interactive Shiny app, SeuratExplorer provides several utility functions that can be used in R scripts:

Main Functions

UI/Server Components

For advanced users who want to customize the Shiny app:

See function documentation for detailed usage examples.

Deploy on server

You can deploy this app on a shiny server, which allows people to view their data on a webpage by uploading the data to server.

A live demo: Upload an Rds or qs2 file, with file size no more than 20GB, to Demo Site. You can download a mini demo data from github.

# app.R
library(SeuratExplorer)
launchSeuratExplorer()

Assay option

Seurat Assay

The Assay class stores single cell data. For typical scRNA-seq experiments, a Seurat object will have a single Assay (“RNA”). This assay will also store multiple ‘transformations’ of the data, including raw counts (@counts slot), normalized data (@data slot), and scaled data for dimensional reduction (@scale.data slot).

SeuratExplorer allows for assay switching, thereby multiple data types can be supported, including:

Single-cell Modalities:

Normalization Methods:

Assay Slots:

Assay Slot Support by Feature

Different visualization features support different assay slots:

Introduction

Load data

Dimensional Reduction Plot

Example plots:

Feature Plot

Example plots:

Violin Plot

Example plots:

Dot Plot

Example plots:

Heatmap for cell level expression

Example plots:

Heatmap for group averaged expression

Example plots:

Ridge Plot

Example plots:

Plot Cell Percentage

Example plots:

Find Cluster Markers and DEGs Analysis

This usually takes longer, please wait patiently.Please save the results before start a new analysis, the old results will be overwritten by the new results, the results can be downloaded as csv format.

Support two ways

You can modify part calculation parameters before a analysis.

Screen shots:

Output description

FindMarkers(object, …)

A data.frame with a ranked list of putative markers as rows, and associated statistics as columns (p-values, ROC score, etc., depending on the test used (test.use)). The following columns are always present:

avg_logFC: log fold-chage of the average expression between the two groups. Positive values indicate that the gene is more highly expressed in the first group

pct.1: The percentage of cells where the gene is detected in the first group

pct.2: The percentage of cells where the gene is detected in the second group

p_val_adj: Adjusted p-value, based on bonferroni correction using all genes in the dataset

Top Expressed Features

Highly expressed genes can reflect the main functions of cells, there two ways to do this. the first - Find Top Genes by Cell could find gene only high express in a few cells, while the second - Find Top Genes by Accumulated UMI counts is biased to find the highly expressed genes in most cells by accumulated UMI counts.

1. Find Top Genes by Cell

How?

Step1: 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.

Step2: 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.

Output description

2. Find Top Genes by Mean UMI counts

for each cluster, calculate the top n highly expressed genes by Mean UMI counts. if a cluster has less than 3 cells, this cluster will be escaped.

Output description

Feature Summary

Summary interested features by cluster, such as the positive cell percentage and mean/median expression level.

Output description

Feature Correlation Analysis

Can calculate the correlation value of gene pairs within cells from a cluster, support pearson & spearman methods.

3 ways to do

Output description

if nothing return, this is because the input genes has very low expression level, very low expressed genes will be removed before analysis.

Rename cluster name

You can rename cluster names, and changes will take effect immediately, while the raw Seurat object file will be never changed, once you close the session, the newly added annotation will be lost, You can download the old name and new name mapping file, and send it to technician to ask for permanent change.

Search Features

all features(genes) extracted from the row names of assay, can be used search features.

Cell Metadata

The metadata of all cells extracted from the meta.data slot of Seurat object, which contains descriptive information for each cell, such as quality control metrics, cell type classifications, batch information, and experimental conditions. This metadata is crucial for organizing, filtering, integrating, and visualizing single-cell RNA-seq data.

Structure of Seurat Object

The Seurat object is an S4 class in R designed to store and manage single-cell expression data and associated analyses. It is a highly structured and self-contained object, allowing for the integration of various data modalities and analytical results.

Key Slots and their Contents:

assays: This is a list containing one or more Assay objects. Each Assay object represents a specific type of expression data. Each Assay object itself contains slots like counts (raw data), data (normalized data), scale.data (scaled data), and meta.features (feature-level metadata).

meta.data: A data frame storing cell-level metadata. This includes information such as the number of features detected per cell (nFeature_RNA), original identity classes (orig.ident), and can be extended with additional information (e.g., cell type annotations, sample information).

active.assay: A character string indicating the name of the currently active or default assay for analysis.

active.ident: Stores the active cluster identity for each cell, typically resulting from clustering analyses.

reductions: A list of DimReduc objects, each representing a dimensionality reduction technique applied to the data (e.g., PCA, UMAP, tSNE). These objects store the lower-dimensional embeddings of the cells.

graphs: A list of Graph objects, typically storing nearest-neighbor graphs used in clustering and other analyses. images: For spatial transcriptomics data, this slot stores Image objects containing spatial image data and information linking spots to their physical locations.

project.name: A character string holding the name of the project.

misc: A list for storing miscellaneous information not fitting into other specific slots.

About

Yeah, it’s the tutorial right here!

Data Preparation Tips

Preparing Your Seurat Object

For the best experience with SeuratExplorer, ensure your Seurat object contains:

  1. Required Elements:
  2. Recommended Elements:
  3. File Formats:
  4. File Size Considerations:

Example Preprocessing Code

# Basic Seurat preprocessing
library(Seurat)

# Load your data
seurat_obj <- Read10X(data.dir = "path/to/data")
seurat_obj <- CreateSeuratObject(counts = seurat_obj)

# Standard processing
seurat_obj <- NormalizeData(seurat_obj)
seurat_obj <- FindVariableFeatures(seurat_obj)
seurat_obj <- ScaleData(seurat_obj)
seurat_obj <- RunPCA(seurat_obj)
seurat_obj <- RunUMAP(seurat_obj, dims = 1:30)

# Clustering at multiple resolutions
seurat_obj <- FindNeighbors(seurat_obj, dims = 1:30)
seurat_obj <- FindClusters(seurat_obj, resolution = 0.4)
seurat_obj <- FindClusters(seurat_obj, resolution = 0.8)

# Save for SeuratExplorer
saveRDS(seurat_obj, "my_seurat_object.rds")
# or
qs2::qs_save(seurat_obj, "my_seurat_object.qs2")

FAQ

Q: Can I use SeuratExplorer with Seurat v3 objects?

A: Yes! SeuratExplorer automatically updates old Seurat objects when loading. However, for very old versions (v2 or earlier), manual update using UpdateSeuratObject() may be required before use.

Q: Is my data uploaded to any server?

A: No. When running locally (launchSeuratExplorer()), all data stays on your computer. Only when deployed on a Shiny Server would data be uploaded to that server.

Q: Can I save my analysis results?

A: Yes! Most visualizations can be downloaded as PDF files. Analysis results (DEGs, feature summaries, etc.) can be downloaded as CSV files. Cluster name mappings can also be exported.

Q: What’s the difference between the two “Top Expressed Features” methods?

A: - Find Top Genes by Cell: Identifies genes that are highly expressed in individual cells, useful for finding cell-specific markers - Find Top Genes by Mean UMI: Finds genes with high average expression across all cells in a cluster, useful for identifying cluster characteristics

Q: How do I add custom color palettes?

A: While SeuratExplorer includes many predefined color palettes, you can use the getColors() function in your own R scripts to access these palettes for custom visualizations.

Core Dependencies

Visualization Dependencies

Contributing and Support

Getting Help

Acknowledgments

SeuratExplorer is built upon excellent work by:

中文介绍

微信公众号: 分析力工厂

Session Info

#> R version 4.4.3 (2025-02-28 ucrt)
#> Platform: x86_64-w64-mingw32/x64
#> Running under: Windows 11 x64 (build 26200)
#> 
#> Matrix products: default
#> 
#> 
#> locale:
#> [1] LC_COLLATE=Chinese (Simplified)_China.utf8 
#> [2] LC_CTYPE=Chinese (Simplified)_China.utf8   
#> [3] LC_MONETARY=Chinese (Simplified)_China.utf8
#> [4] LC_NUMERIC=C                               
#> [5] LC_TIME=Chinese (Simplified)_China.utf8    
#> 
#> time zone: Asia/Shanghai
#> tzcode source: internal
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_4.4.3    fastmap_1.2.0     cli_3.6.5         tools_4.4.3      
#>  [5] htmltools_0.5.9   otel_0.2.0        rstudioapi_0.17.1 yaml_2.3.12      
#>  [9] rmarkdown_2.30    knitr_1.51        xfun_0.55         digest_0.6.39    
#> [13] rlang_1.1.6       evaluate_1.0.5