scanpy

Runs the standard scanpy scRNA-seq workflow from QC through clustering and marker identification.

1|Updated Nov 20, 2025
One-click install
npx skills add https://github.com/tony-zhelonkin/scio --skill scanpy-tony-zhelonkin
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: scanpy
Source: https://github.com/tony-zhelonkin/scio/tree/main/skills/scanpy
Command: npx skills add https://github.com/tony-zhelonkin/scio --skill scanpy-tony-zhelonkin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires scanpy, anndata, numpy, pandas.

What problem does it solve? Single-cell RNA-seq analysis involves a long chain of steps—QC filtering, normalization, HVG selection, PCA, UMAP, Leiden clustering, and marker gene identification—where wrong parameter choices or missing steps (like forgetting to save raw counts) silently corrupt results. This Skill encodes the standard scanpy workflow with correct parameter ranges and known pitfalls so analyses are reproducible. ## Core Features & Use Cases - Complete standard pipeline: QC metrics and filtering, normalization, log1p, highly variable gene selection, PCA, neighbors, UMAP, and Leiden clustering at multiple resolutions. - Marker genes and DE: rank_genes_groups with Wilcoxon, cluster-vs-rest and condition-vs-condition comparisons, plus score_genes for gene program scoring. - Publication-quality visualization: dotplots, heatmaps, stacked violins, and UMAPs with dpi/format settings for figures. - Use Case: Given a QC'd 10x dataset as an h5ad file, load it into AnnData, normalize, find HVGs, cluster with Leiden at several resolutions, and produce a dotplot of canonical markers to annotate cell types. ## Quick Start Load my filtered h5ad file with scanpy, run normalization through Leiden clustering, and plot the top marker genes per cluster on a UMAP.

Frequently Asked Questions about scanpy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a standard scRNA-seq analysis with scanpy?▼

Load data with sc.read_h5ad, calculate QC metrics, filter cells and genes, then run normalize_total, log1p, highly_variable_genes, pca, neighbors, umap, and leiden clustering. Finish with rank_genes_groups using method='wilcoxon' to find cluster markers.

Scanpy vs scVI for single-cell analysis: which should I use?▼

Use scanpy for the standard single-modality workflow and publication plots. Use scVI when you need probabilistic batch correction across samples, then return to scanpy for neighbors, UMAP, Leiden clustering, and visualization on the scVI latent space.

Why does scanpy plotting fail with use_raw=True?▼

Plotting with use_raw=True fails if you never saved raw counts before filtering. Set adata.raw = adata right after loading and before normalize_total and HVG subsetting so gene expression plots can access unfiltered values.

What Leiden resolution should I use for clustering single-cell data?▼

Typical Leiden resolution ranges from 0.3 to 1.5, with higher values producing more clusters. Run several resolutions (e.g., 0.3, 0.5, 0.8, 1.0) with key_added per run and compare them on UMAP before choosing.

When should I not use scanpy for single-cell analysis?▼

Avoid scanpy for MAD-based QC or doublet detection (use a dedicated QC workflow), multi-sample probabilistic batch correction (use scVI), annotation transfer (use scANVI), RNA velocity, or multi-assay containers like CITE-seq.