A comprehensive Shiny application for analyzing single-cell RNA sequencing data using the Seurat framework. This interactive tool provides a user-friendly interface for performing common scRNA-seq analysis tasks without extensive coding knowledge.
- Data Import: Load 10X Genomics data formats
- Quality Control: Interactive filtering based on metrics like mitochondrial percentage, number of genes, and UMI counts
- Doublet Detection: Identify and remove cell doublets using scDblFinder
- Dimensionality Reduction: UMAP visualizations
- Clustering: Flexible clustering options with multiple algorithms and resolution settings
- Gene Expression Visualization: Feature plots and violin plots for gene expression patterns
- Marker Gene Identification: Find differentially expressed genes between clusters
- Clone this repository:
git clone https://github.com/iichelhadi/Shiny_apps/scRNA-seq-explorer.git
cd scRNA-seq-explorer- Install the required R packages:
# Install CRAN packages
install.packages(c("shiny", "shinythemes", "shinyFiles", "DT", "tidyverse",
"ggplot2", "patchwork", "cowplot", "parallelly", "reticulate"))
# Install Bioconductor packages
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(c("scDblFinder", "BiocParallel", "MAST"))
# Install Seurat and scCustomize
install.packages("remotes")
remotes::install_version("Seurat", version = "4.3.0")
devtools::install_github("samuel-marsh/scCustomize")- For Leiden clustering, install the leidenalg Python package:
pip install leidenalg- Run the application:
shiny::runApp("path/to/scRNA-seq-explorer")- Select a 10X Genomics output directory containing the matrix, barcodes, and features files
- Set QC parameters to filter cells based on quality metrics
- Optionally detect and filter out doublets
- Set parameters for variable feature selection and dimensionality reduction
- Run the dimension reduction to visualize cells in UMAP space
- Run clustering with desired resolution and algorithm
- Select genes of interest to visualize their expression on UMAP or as violin plots
- Explore the relationship between gene expression and cell clusters
- Find marker genes for all clusters or between specific clusters
- Visualize top marker genes in a heatmap
- Download marker gene lists for further analysis
- Perform manual cell type annotation
- Visualize cell types on UMAP plot
- Export annotated Seurat object for further analysis
Example 10X Genomics datasets can be downloaded from:
scRNA-seq-explorer/
├── app.R # Main application file
├── global.R # Global variables and functions
├── www/ # Static assets
│ └── styles.css # Custom CSS styles
├── data/ # Example datasets (optional)
└── README.md # Documentation
The app can be customized by modifying the following files:
app.R: UI layout and server logicglobal.R: Functions for data processing and analysiswww/styles.css: Custom styling for the application
- The app performs memory-intensive operations. We recommend at least 16GB of RAM for analyzing datasets with more than 5,000 cells.
- For larger datasets (>20,000 cells), consider subsampling or using a server with more RAM.
- Some operations (dimensionality reduction, clustering, marker gene identification) may take several minutes to complete depending on dataset size.
Common issues:
- Memory errors: Increase the memory allocation for R and/or use a smaller dataset
- Missing leidenalg: Ensure Python is properly configured with reticulate and leidenalg is installed
- Slow performance: Adjust parameters (reduce number of variable features, use fewer PCs for analysis)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this application in your research, please cite this repo:
https://github.com/iichelhadi/Shiny_apps/tree/main/scRNA-seq_analysis_app
And the core software packages:
- Seurat: Stuart et al. (2019). Comprehensive Integration of Single-Cell Data. Cell, 177(7), 1888-1902.
- scDblFinder: Germain et al. (2021). scDblFinder: a pipeline for filtering cells with artifactual doublet-like expression profiles. Bioinformatics, 37(19), 3333-3335.
- MAST: Finak et al. (2015). MAST: a flexible statistical framework for assessing transcriptional changes and characterizing heterogeneity in single-cell RNA sequencing data. Genome Biology, 16, 278.