Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

scanpy

БесплатноЗапускает вложенные скриптыНе проверен

Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA/UMAP/t-SNE), clustering, differential expression…

KalarisLabsот KalarisLabs★ 218 звёзд на GitHub

Об этом скилле

Scanpy: Single-Cell Analysis

Overview

Scanpy is a scalable Python toolkit for analyzing single-cell RNA-seq data, built on AnnData. Apply this skill for complete single-cell workflows including quality control, normalization, dimensionality reduction, clustering, marker gene identification, visualization, and trajectory analysis. Current stable release: scanpy 1.12.x (January 2026).

Installation

Requires Python 3.12+ (scanpy 1.12 dropped Python ≤3.11) and anndata ≥0.10.

uv pip install "scanpy[leiden]"

The [leiden] extra installs python-igraph and leidenalg, required for Leiden clustering. For reproducible environments, pin a version: uv pip install "scanpy[leiden]==1.12.1".

For large or out-of-core datasets, many functions support Dask arrays (experimental):

uv pip install "scanpy[leiden]" dask

See the Using dask with Scanpy tutorial. For GPU-accelerated scanpy-like operations, use rapids-singlecell as a separate package.

If the input is an R-native single-cell object (.rds, .RData, Seurat, or SingleCellExperiment), first convert it to .h5ad with R tooling, then load it with Scanpy. Read references/r_interop.md for agent-run installation and conversion instructions across macOS, Linux, and Windows.

For AnnData structure and I/O details, use the anndata skill. For probabilistic models and batch correction, use scvi-tools.

When to Use This Skill

This skill should be used when:

  • Analyzing single-cell RNA-seq data (.h5ad, 10X, CSV formats)
  • Working with R-friendly single-cell datasets (.rds, .RData, Seurat, SingleCellExperiment) that need conversion to .h5ad
  • Performing quality control on scRNA-seq datasets
  • Creating UMAP, t-SNE, or PCA visualizations
  • Identifying cell clusters and finding marker genes
  • Annotating cell types based on gene expression
  • Conducting trajectory inference or pseudotime analysis
  • Generating publication-quality single-cell plots

Script Toolkit (prefer these over writing code from scratch)

This skill bundles ready-to-run CLI scripts in scripts/ for every common step. Run these instead of hand-writing scanpy code — they handle file loading by extension, figure setup, sensible defaults, raw-count preservation, and progress logging. Each reads and writes .h5ad, so they chain together, and each has its own --help. Only drop down to writing scanpy code when a task isn't covered by a script or needs unusual customization.

All scripts use a shared scripts/_common.py helper (loading, saving, figure config) — keep it alongside the others. Run from the skill directory or pass full paths; figures default to ./figures/.

Script Purpose Typical call
run_pipeline.py Full workflow in one command: load → QC → normalize → HVG → PCA → (batch) → UMAP → Leiden → markers python scripts/run_pipeline.py raw.h5ad -o processed.h5ad
inspect_data.py Summarize an unknown dataset (shape, obs/var, layers, what's already computed, raw vs normalized) python scripts/inspect_data.py data.h5ad
convert.py Load any format (10x dir/.h5, csv, loom, mtx) and write .h5ad python scripts/convert.py 10x_dir/ -o data.h5ad
qc_analysis.py QC metrics, before/after plots, filtering, optional Scrublet doublets python scripts/qc_analysis.py raw.h5ad -o qc.h5ad --scrublet
preprocess.py Normalize, log1p, HVG, optional scale/regress (keeps counts layer + raw) python scripts/preprocess.py qc.h5ad -o norm.h5ad
reduce_dimensions.py PCA + variance plot, neighbors, UMAP, optional t-SNE python scripts/reduce_dimensions.py norm.h5ad -o red.h5ad
batch_correct.py Integration: harmony / bbknn / combat python scripts/batch_correct.py red.h5ad -o int.h5ad --method harmony --batch-key sample
cluster.py Leiden (or louvain) at one or many resolutions python scripts/cluster.py red.h5ad -o clu.h5ad --resolution 0.3 0.6 1.0
find_markers.py rank_genes_groups + per-group CSVs + marker plots python scripts/find_markers.py clu.h5ad --groupby leiden -o clu.h5ad
annotate.py Map clusters → cell types from JSON/CSV; optional marker reference dotplot python scripts/annotate.py clu.h5ad -o ann.h5ad --mapping map.json
score_genes.py Score gene signatures (JSON) and/or cell-cycle phase python scripts/score_genes.py ann.h5ad -o scored.h5ad --gene-sets sigs.json
pseudobulk.py Aggregate counts by sample × cell type → matrix for pydeseq2 python scripts/pseudobulk.py ann.h5ad --by sample cell_type --out-prefix pb
subset.py Subset by obs values or gene list (optionally clear stale embeddings) python scripts/subset.py ann.h5ad -o tcells.h5ad --obs cell_type --keep "T cells"
plot.py Generate umap/tsne/pca/v
Полный SKILL.md на GitHub

Установить scanpy в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

assets/analysis_template.pyassets/celltype_mapping.jsonassets/gene_signatures.jsonassets/pipeline_config.jsonreferences/analysis_workflow.mdreferences/api_reference.mdreferences/plotting_guide.mdreferences/r_interop.mdreferences/standard_workflow.mdscripts/_common.pyscripts/annotate.pyscripts/batch_correct.pyscripts/cluster.pyscripts/convert.pyscripts/find_markers.pyscripts/inspect_data.pyscripts/plot.pyscripts/preprocess.pyscripts/pseudobulk.pyscripts/qc_analysis.pyscripts/reduce_dimensions.pyscripts/run_pipeline.pyscripts/score_genes.pyscripts/subset.py

FAQ

Что делает скилл scanpy?

Standard single-cell RNA-seq analysis pipeline. Use for QC, normalization, dimensionality reduction (PCA/UMAP/t-SNE), clustering, differential expression, visualization, and converting R-friendly single-cell formats such as Seurat or SingleCellExperiment RDS files into h5ad for Scanpy. Best for exploratory scRNA-seq analysis with established workflows. For deep learning models use scvi-tools; for data format questions use anndata.

Как установить скилл scanpy?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл scanpy запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить scanpy с