How to Build a Single-Cell RNA-seq Analysis Pipeline with Scanpy for PBMC Clustering, Annotation, and Trajectory Discovery

This article outlines a comprehensive single-cell RNA-seq analysis pipeline using Scanpy, covering data loading, quality control, normalization, and dimensionality reduction. It details advanced steps like cell cycle scoring, doublet detection, clustering, cell type annotation, and trajectory inference for PBMC data.
This tutorial demonstrates an advanced single-cell RNA-seq analysis workflow using Scanpy on the PBMC-3k benchmark dataset. It covers data loading, quality control, and filtering of low-quality cells and genes. Doublets are detected using Scrublet, followed by data normalization and log transformation. Highly variable genes are identified for downstream analysis.
The pipeline includes scoring cell-cycle phases, regressing out unwanted technical variation, and data scaling. Dimensionality reduction is performed using PCA, UMAP, and t-SNE. Cells are clustered with the Leiden algorithm, and marker genes are identified.
Cell populations are annotated using canonical PBMC markers. Trajectory structure is explored with PAGA and diffusion pseudotime. Finally, a custom interferon-response score is calculated, and the fully analyzed AnnData object is saved for future use.
Related articles
The AI world is getting ‘loopy’
AI models are taking a significant leap forward with the adoption of "agentic loops," where AI agents continuously prompt each other to improve code and solve complex problems. This approach, though potentially resource-intensive, promises to unlock new levels of autonomous problem-solving and efficiency in AI applications.
Codex-maxxing for long-running work
Codex is increasingly being used by organizations to support long-running projects that go beyond a single prompt. This whitepaper by Jason Liu offers practical strategies for leveraging Codex as a persistent workspace, managing complex workflows and sustaining progress.
Nobel laureate John Jumper is leaving DeepMind for rival Anthropic
Nobel laureate John Jumper is departing Google DeepMind to join its competitor, Anthropic, after dedicating nearly nine years to DeepMind, where he led the AlphaFold team. Jumper, who shared a Nobel Prize for his work on AlphaFold, expressed gratitude for his time at DeepMind while looking forward to new endeavors.
