Skip to content

Guide · Agent skill

How to use the Scanpy single-cell analysis agent skill

Updated · written with AI from the project's own documentation and checked against our catalogue data

The Scanpy skill gives an AI agent a tested set of command-line scripts and reference notes for exploratory single-cell RNA-seq analysis in Python. This guide explains what the skill does, how to install it from a ZIP file, how to ask for work in plain language, and which data and safety conditions matter. After reading it you should be able to install the skill, run a basic QC-to-clustering workflow, and know when the skill is the wrong tool.

Scanpy Single-Cell AnalysisK-Dense-AI/scientific-agent-skills · MIT

Quick start

  1. 1Download and unzip the skill. Download the scanpy skill ZIP from this page and unzip it so that SKILL.md sits in the skill folder.
  2. 2Place the folder or upload it. Move the folder into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
  3. 3Install Python and Scanpy. Use Python 3.12 or newer and run uv pip install "scanpy[leiden]". Add optional packages only for the branches you need.
  4. 4Prepare your data. Make sure your input has identified raw counts. Use inspect_data.py to confirm the layers and whether the data are raw or normalized.
  5. 5Ask for the task in plain language. Describe the input file and the goal, such as QC, clustering or marker ranking, and mention any batch or sample column.
  6. 6Review the outputs. Check the QC plots, cluster sizes and marker lists. Have an expert review cell-type labels before you rely on them.

What the Scanpy skill makes the agent do

Once installed, the agent can run a single-cell RNA sequencing analysis with the Scanpy toolkit. Typical work includes quality control, normalizing counts, highly variable gene selection, PCA, UMAP and t-SNE, Leiden clustering, ranking marker genes for each cluster, preparing pseudobulk data, and making plots.

The skill also converts Seurat or SingleCellExperiment R objects (.rds, .RData) to .h5ad files so Scanpy can load them. The agent is told to prefer the bundled scripts over writing code from scratch, and it warns about common statistical pitfalls such as confounded designs and cell-type labels that have not been reviewed.

Install the skill from the ZIP file

Download the ZIP for the scanpy skill from this page, then unzip it. The folder must contain SKILL.md at its top level, along with the scripts, assets and references folders.

For a personal setup, place the unzipped folder in ~/.claude/skills/. To limit the skill to one project, place it in that project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

  • Personal use: unzip into ~/.claude/skills/
  • Single project: unzip into the project's .claude/skills/ folder
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP

Install Scanpy and the Python requirements

The skill requires Python 3.12 or newer and Scanpy with the leiden extra, which installs the igraph and leidenalg packages used for clustering. The skill also depends on anndata. Install Scanpy with uv:

Some branches need optional packages: harmonypy, bbknn, scikit-misc, scikit-image, loompy or dask. Install only the ones your analysis needs. R is needed only for converting .rds, .RData, Seurat or SingleCellExperiment inputs.

uv pip install "scanpy[leiden]"

Trigger the skill with natural requests

You do not need special syntax. Describe the task and mention your data file. The agent should pick the skill when your request matches its scope, such as quality control, clustering, marker genes or UMAP plots for scRNA-seq data.

Good requests name the input, the goal and any known structure in the data, for example the sample or batch column. If you want a specific step, say so.

  • Check whether my pbmc.h5ad file has raw counts and summarize what is already computed.
  • Run QC on raw.h5ad, filter low-quality cells, and show before and after plots.
  • Cluster my processed data at resolutions 0.3, 0.6 and 1.0 and rank marker genes for each cluster.
  • Convert my Seurat object sample.rds to h5ad, then run the full pipeline.

Run the scripts step by step

The skill bundles CLI scripts in its scripts folder. Each script reads and writes .h5ad files, so the outputs chain together, and each has its own --help option. Figures are saved to ./figures/ by default. The scripts include run_pipeline.py for a full workflow in one command, inspect_data.py for summarizing an unknown dataset, convert.py for loading 10x, csv, loom or mtx input, qc_analysis.py, preprocess.py, reduce_dimensions.py, batch_correct.py, cluster.py and find_markers.py.

Use the full pipeline for a first pass, or run the steps separately when you want to check each result. Run the scripts from the skill directory or pass full paths.

  • Full workflow: run_pipeline.py takes load, QC, normalization, HVG, PCA, optional batch correction, UMAP, Leiden and markers in one command
  • Inspect first: inspect_data.py reports shape, layers and whether data are raw or normalized
  • Convert: convert.py writes .h5ad from 10x directories, csv, loom or mtx
python scripts/run_pipeline.py raw.h5ad -o processed.h5ad

Safety, data requirements and limits

The scripts reject negative, fractional, nonfinite or zero-total cells. Input to QC must be identified raw counts. If your X matrix is already normalized, tell the agent and use the counts layer option. The skill does not infer provenance from integer-looking values, so check this yourself when the metadata is unclear.

The skill runs scripts and does not use the network. Local analysis needs no credentials. The toolkit loads data into memory, so it is not a general out-of-core pipeline for very large datasets. Cell-type mappings and marker signatures in the assets are illustrative human examples that need expert review. Results are exploratory and not biologically validated, and they are not for clinical or diagnostic decisions.

  • Clinical or diagnostic use is out of scope
  • Datasets without a declared counts layer may produce wrong results
  • Batch correction changes coordinates or the graph, so keep original counts for differential expression
python scripts/convert.py 10x_dir/ -o data.h5ad

Tips for more reliable results

Run inspect_data.py before anything else so you know which layers and raw data are present. Keep a full-gene object for pseudobulk work, since the full pipeline keeps one. When you compare conditions, use independent biological replicates; aggregating cells cannot fix missing replication or confounded design.

Treat cluster numbers as labels, not cell types. Check marker genes against known biology before naming a cluster. Markers found on the same data used to define clusters are exploratory.

  • Use independent biological replicates for condition comparisons
  • Name cell types only after expert review of markers
  • Save intermediate .h5ad files so each step can be checked

What people use it for

  • Quality control of a 10x dataset with before and after plots and filtering of low-quality cells
  • Clustering a processed dataset at several Leiden resolutions and ranking marker genes per cluster
  • Converting a Seurat object to .h5ad so it can be analyzed with Scanpy
  • Preparing pseudobulk data for a condition comparison with independent replicates
  • Making UMAP and t-SNE plots for a figure in an exploratory analysis

Frequently asked questions

Is the Scanpy agent skill free to use?

The directory listing states the licence as MIT, but the SKILL.md front matter says BSD-3-Clause. Check the licence file in the downloaded ZIP before reusing the code. Scanpy itself and the other packages you install are separate projects with their own licences.

What do I need to install before using the Scanpy skill?

You need Python 3.12 or newer and Scanpy with the leiden extra, installed with uv pip install "scanpy[leiden]". R is needed only if you convert .rds or .RData files. Optional packages are needed only for specific integration branches.

How do I install a Claude agent skill from a ZIP file?

Unzip the download and place the folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder for one project. In the Claude apps, you can instead upload the ZIP under Settings → Capabilities → Skills.

Does the scanpy skill need internet access or an API key?

No. The skill runs local scripts and does not use the network, and local analysis needs no credentials. Optional packages you install may need downloads at install time.

Why does the script reject my data?

The scripts reject negative, fractional, nonfinite or zero-total cells. This usually means the input is normalized or is not a raw count matrix. If X is already normalized, use the counts layer option and make sure the counts are present.

How does the Scanpy skill compare with other single-cell tools?

The skill is for Scanpy workflows on CPU in Python. For GPU-accelerated Scanpy-like operations, the source points to rapids-singlecell as a separate package. For probabilistic models and batch correction it points to the scvi-tools skill, and for AnnData structure details it points to the anndata skill.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you analyze your own scRNA-seq count matrices in Python and want scripted, reproducible QC-to-clustering steps with clear defaults. Pick another option if you need clinical or diagnostic conclusions, very large out-of-core data, or input that is already normalized with no declared counts.

Download the skill