Skip to content

msherafatian/masih-python

Repository files navigation

MASIH-Python: Modular Analysis Suite for Interactive Heterogeneity

DOI Python 3.10+ License: GPL v3 GitHub issues

**A Python/Dash implementation for comprehensive single-cell RNA sequencing analysis, maintaining architectural parity with the R/Shiny version.sequencing analysis, maintaining architectural parity with the R/Shiny version.


πŸ“‹ Table of Contents


πŸ“– Overview

MASIH-Python provides a user-friendly web interface for analyzing single-cell RNA sequencing (scRNA-seq) data, with a focus on the multidimensional biological portrait of each cell.

Built with Dash and Scanpy, it offers a complete workflow from raw 10X Genomics data or processed AnnData objects to comprehensive biological insights.


🌟 Key Features

πŸ“‚ Flexible Input & Preprocessing

  • Accepts 10X Genomics outputs, H5AD files, and expression matrices
  • Preserves existing analysis results and metadata
  • Automatically detects and completes missing analysis steps
  • Customizable quality control with interactive parameters

πŸ” Cellular Landscape Mapping

  • High-Resolution Clustering β€” Leiden and Louvain algorithms with resolution optimization
  • Dimensionality Reduction β€” PCA, t-SNE, UMAP for revealing data structure
  • Marker Gene Profiling β€” Multiple differential expression methods with statistical validation
  • Interactive Visualization β€” Plotly-powered plots with real-time exploration

🧠 Functional & Dynamic State Inference

  • Functional State Characterization β€” CancerSEA-based scoring of 14 cancer-related pathways
  • Trajectory Mapping β€” PAGA-based pseudotime analysis for developmental progression
  • Cell Cycle Deconvolution β€” G1/S/G2M phase scoring integrated into downstream analyses
  • Comparative Analysis β€” Cross-cluster and cross-pathway correlation studies

πŸ”€ Insight Sharing & Reporting

  • Export publication-quality plots (PNG, PDF, SVG)
  • Comprehensive data export (Excel, CSV, H5AD)
  • Auto-generate dataset-specific methods text for manuscripts
  • Batch export of all visualizations

🎯 Why MASIH-Python?

  • 🐍 Python Ecosystem: Leverage the power of Scanpy and the Python scientific stack
  • 🌐 Web-Based: No local software installation required (with Docker)
  • πŸ”¬ Cancer-Focused: Specialized tools with CancerSEA pathway integration
  • πŸ’» No Coding Required: Accessible to all researchers through intuitive interface
  • πŸ“Š Comprehensive Workflow: From raw data to publication-ready figures
  • πŸ”„ Reproducible: Exports parameters and generates methods text
  • 🧩 Modular Design: Easily extend with new analysis modules
  • 🐳 Docker Support: One-command deployment for easy setup

πŸš€ Quick Start

Installation

# Option 1: Using Docker (Recommended)
git clone https://github.com/msherafatian/masih-python.git
cd masih-python
docker compose up --build

# Option 2: Using pip
git clone https://github.com/msherafatian/masih-python.git
cd masih-python
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.py

Launch MASIH-Python

# If installed locally
python app.py

# If using Docker
docker compose up

Access the application at http://localhost:8050

Load Example Data

Download example datasets from the Upload & QC tab, or use your own:

  • 10X Genomics Cell Ranger output
  • AnnData H5AD files
  • Expression matrices (CSV/TSV)

πŸ”¬ Analysis Modules

Core Analysis

  • πŸ“€ Data Upload: Multiple format support (10X, H5AD, CSV/TSV matrices)
  • βœ… Quality Control: Interactive filtering with customizable thresholds
  • 🎯 Clustering: Graph-based clustering with Leiden/Louvain algorithms
  • 🧬 Marker Genes: Statistical testing with multiple methods (Wilcoxon, t-test, logreg)

Cancer-Specific Features

  • 🦠 CancerSEA Integration: 14 functional state pathways for cancer analysis
  • πŸ“Š Pathway Comparison: Correlation and comparative pathway analysis
  • πŸ”€ Trajectory Analysis: PAGA-based pseudotime inference
  • πŸ”„ Cell Cycle Scoring: G1/S/G2M phase identification and integration

Visualization & Export

  • πŸ“ˆ Interactive Plots: Real-time exploration with Plotly
  • πŸ–ΌοΈ High-Quality Export: Publication-ready figures (PNG, PDF, SVG)
  • πŸ’Ύ Comprehensive Data Export: Excel, CSV, and H5AD formats
  • πŸ“ Methods Generation: Automatic methods text for manuscripts

πŸ“Š Supported Data Formats

  • 10X Genomics: Cell Ranger outputs (matrix directories, H5 files)
  • AnnData Objects: H5AD files from Scanpy or other Python tools
  • Expression Matrices: CSV/TSV format (genes Γ— cells or cells Γ— genes)
  • Previous MASIH-Python Sessions: Reload processed data seamlessly

πŸ§ͺ Example Workflows

Basic Cancer Analysis (30 minutes)

  1. πŸ“€ Upload 10X data β†’ 2. βœ… Quality control β†’ 3. 🎯 Clustering β†’ 4. 🦠 CancerSEA analysis β†’ 5. πŸ’Ύ Export results

Advanced Trajectory Analysis (45 minutes)

  1. πŸ”„ Basic workflow β†’ 2. πŸ” Cell type selection β†’ 3. πŸ”€ Trajectory inference β†’ 4. ⏱️ Pseudotime analysis β†’ 5. πŸ“Š Publication figures

Comparative Study (60 minutes)

  1. πŸ“€ Load dataset β†’ 2. 🎯 Clustering analysis β†’ 3. πŸ“Š Comparative pathways β†’ 4. πŸ“ˆ Statistical analysis β†’ 5. πŸ’Ύ Export results

πŸ₯Ό Use Cases

MASIH-Python is designed for researchers studying:

  • πŸ”¬ Tumor Heterogeneity: Identify and characterize cancer cell subpopulations
  • πŸ’Š Treatment Response: Analyze single-cell responses to therapy
  • πŸ“ˆ Cancer Progression: Trace developmental trajectories and metastasis
  • ⚑ Functional States: Characterize stemness, invasion, drug resistance
  • 🧫 Microenvironment: Analyze tumor-immune interactions
  • 🧬 Gene Expression Patterns: Discover marker genes and regulatory networks

πŸ“‹ System Requirements

Local Installation

  • Python: Version 3.10 or higher
  • Operating System: Windows 10+, macOS 10.14+, or Linux
  • Memory: 4GB RAM minimum (8GB+ recommended for large datasets)
  • Storage: 2GB free space for installation and dependencies

Docker Installation

  • Docker Desktop: Latest version
  • Memory: 4GB RAM allocated to Docker (8GB+ recommended)
  • Storage: 5GB free space for Docker images

🀝 Contributing

We welcome contributions! Please read our Contributing Guidelines for details (coming soon).

Ways to Contribute

  • πŸ› Report bugs and request features
  • πŸ“– Improve documentation
  • πŸ§ͺ Add new analysis modules
  • 🎨 Enhance user interface
  • 🧬 Add new pathway databases
  • 🐳 Improve Docker deployment

πŸ“„ Citation

If you use MASIH-Python in your research, please cite the Zenodo DOI:

DOI

Concept DOI (latest MASIH-Python release):
https://doi.org/10.5281/zenodo.17824054

Version-specific DOI (e.g., for the archived release used in a paper):
vX.Y.Z β†’ https://doi.org/10.5281/zenodo.17824053

BibTeX

@software{masih_python_2024,
  author       = {Sherafatian, Masih},
  title        = {MASIH-Python: Modular Analysis Suite for Interactive Heterogeneity},
  year         = 2024,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.17824054},
  url          = {https://doi.org/10.5281/zenodo.17824054}
}

*[Full publication citation will be added upon publication]*

πŸ“ž Support


πŸ™ Acknowledgments

MASIH-Python is built on the shoulders of giants:

  • Scanpy β€” Single-cell analysis in Python
  • Dash β€” Web application framework by Plotly
  • CancerSEA β€” Cancer functional state database
  • CellRank β€” Trajectory inference
  • Plotly β€” Interactive visualizations
  • MASIH R/Shiny β€” Original implementation

Special thanks to all contributors and the single-cell community!


πŸ“œ License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.


πŸ”— Related Projects


MASIH-Python: Making single-cell cancer analysis accessible to all researchers.

Made with ❀️ for Cancer Research

About

MASIH: Modular Analysis Suite for Interactive Heterogeneity Exploration in Single Cells - An interactive platform for single-cell data exploration

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors