𧬠Single-Cell Analysis Platform (scRNA-seq)
An end-to-end single-cell RNA sequencing (scRNA-seq) analysis and visualization platform built using FastAPI, Scanpy, and AnnData, supporting real biological datasets (PBMC) with interactive UMAP visualization.
π Overview
This project implements a complete backend pipeline for single-cell transcriptomic analysis, starting from raw count data to dimensionality reduction, clustering, and visualization.
The system is designed as a research prototype, focusing on correctness, reproducibility, and extensibility rather than UI complexity.
π§ͺ Features Implemented β Data Handling
Load real PBMC scRNA-seq datasets
Support for large sparse gene expression matrices
Automatic cell Γ gene matrix handling via AnnData
β Preprocessing Pipeline
Library size normalization
Log-normalization
Feature scaling
Principal Component Analysis (PCA)
β Dimensionality Reduction
UMAP computed on PCA space
Configurable parameters (neighbors, components)
β Clustering
Graph-based Leiden clustering
Uses igraph backend
Cluster labels stored in AnnData object
β Visualization
Interactive UMAP plot (HTML)
Zoom, pan, hover cell IDs
Cells colored by cluster
Suitable for exploratory biological analysis
ποΈ System Architecture singlecell-platform/ β βββ backend/ β βββ app/ β β βββ api/ β β β βββ datasets.py # CSV / dataset endpoints β β β βββ umap.py # UMAP + clustering API β β β βββ default.py # PBMC loader API β β βββ services/ β β β βββ singlecell_csv.py β β βββ state.py # Global AnnData state β β βββ main.py # FastAPI app β βββ static/ β βββ umap.html # Interactive UMAP visualization β βββ README.md
π How to Run
1οΈβ£ Create Environment
python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate
2οΈβ£ Install Dependencies pip install fastapi uvicorn scanpy anndata umap-learn igraph plotly
3οΈβ£ Start Server uvicorn app.main:app --reload
Server runs at: http://127.0.0.1:8000
π§ API Endpoints Load PBMC Dataset POST /api/load_pbmc
Response { "status": "PBMC loaded", "cells": 2700, "genes": 2000 }
Get UMAP Coordinates GET /api/umap Returns cell-wise UMAP coordinates with cluster labels.
Visualization Open in browser: http://127.0.0.1:8000/static/umap.html
π§ Research Significance
Implements a standard scRNA-seq analysis workflow
Uses industry-standard tools (Scanpy, AnnData)
Suitable as:
Research prototype
Methods chapter foundation
Base for further biological extensions
π Project Status
β Completed β Version 1.0 This version represents a stable, functional, and research-ready implementation.
π€ Author Anurag Lal Software Engineer | Scientific Computing | Research Systems