Skip to content
Back to skills

Scanpy

ASecurity

"Use for Scanpy single-cell analysis workflows: AnnData IO,

  • 247 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 9, 2026
toolspythonexpresstestingdebuggingapi

Works with

  • cli
  • api

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill scanpy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Scanpy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Scanpy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-scanpy/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-scanpy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: scanpy
description: "Use for Scanpy single-cell analysis workflows: AnnData IO,
  preprocessing/QC, graph embeddings, clustering, marker genes,
  plotting/reporting, optional integrations, and Scanpy package
  troubleshooting."
disable-model-invocation: true
metadata:
  disco-role: operating
license: BSD 3-Clause
---

# Scanpy Repo Skill

Use this skill when a task names Scanpy, `scanpy`, scverse single-cell analysis, AnnData-based analysis, or Scanpy APIs such as `sc.pp`, `sc.tl`, `sc.pl`, `sc.get`, `sc.datasets`, `sc.queries`, `sc.metrics`, or `sc.external`.

Scanpy is a Python toolkit for single-cell gene-expression analysis built around `anndata.AnnData`. It covers data access, preprocessing, quality control, graph construction, dimensionality reduction, clustering, trajectory inference, marker-gene testing, and visualization.

## Install and Import

- Standard import: `import scanpy as sc`.
- Current source metadata requires Python `>=3.12`.
- Base install: `pip install scanpy` or `conda install -c conda-forge scanpy`.
- Common clustering install: `pip install 'scanpy[leiden]'` or `conda install -c conda-forge scanpy python-igraph leidenalg`.
- Minimal import check: `python -c "import scanpy as sc; print(sc.__version__)"`.
- CLI check: `python -m scanpy --help`; Scanpy's built-in CLI is intentionally small and primarily exposes `settings`, while broader ecosystem commands may live in separate packages.

Read `references/troubleshooting.md` before recommending broad dependency changes. Install only the optional extra or package needed by the requested method.

## Route by Workflow

| User need | Route |
| --- | --- |
| Read/write `.h5ad`, 10x HDF5/MTX, Visium output, backed data, built-in datasets, annotation queries, or extract values from AnnData | `sub-skills/io-data-access/SKILL.md` |
| Filter cells/genes, compute QC, normalize/log transform, select HVGs, scale/regress, run PCA prep, detect doublets, or manage raw/layer/inplace behavior | `sub-skills/preprocessing-qc/SKILL.md` |
| Build neighbor graphs, run UMAP/t-SNE/diffmap/draw_graph, cluster with Leiden/Louvain, PAGA/DPT trajectories, marker ranking, gene scoring, ingest, or graph metrics | `sub-skills/graph-embedding-analysis/SKILL.md` |
| Produce Scanpy plots, save figures headlessly, customize dot/matrix/violin/embedding/spatial plots, or debug color/layout/Matplotlib settings | `sub-skills/plotting-reporting/SKILL.md` |
| Choose optional extras, use `scanpy.external`, diagnose missing optional dependencies, Dask-backed arrays, or RAPIDS/GPU handoffs | `sub-skills/external-integrations/SKILL.md` |

## Cross-Workflow Order

1. Start with `io-data-access` to load data into an `AnnData` object and preserve important `obs`, `var`, `layers`, `.raw`, `.obsm`, `.obsp`, and `.uns` fields.
2. Use `preprocessing-qc` for QC, filtering, normalization, HVG selection, scaling/regression, PCA, and other matrix transformations.
3. Use `graph-embedding-analysis` after preprocessing to build neighbors and compute embeddings, clusters, trajectories, markers, scores, and graph metrics.
4. Use `plotting-reporting` after the relevant annotations exist; plotting functions usually expect keys in `.obs`, `.var`, `.obsm`, `.uns`, `.raw`, or `.layers` created by earlier steps.
5. Use `external-integrations` whenever a method requires optional packages, Dask support, RAPIDS/GPU acceleration, or external wrappers.

## Shared Rules

- Keep raw counts before normalization, commonly in `adata.layers["counts"]`; use `.raw` deliberately for downstream marker plotting or differential expression.
- Prefer public APIs documented under `scanpy.pp`, `scanpy.tl`, `scanpy.pl`, `scanpy.get`, `scanpy.datasets`, `scanpy.queries`, `scanpy.metrics`, and `scanpy.external`.
- Check `inplace`, `copy`, `layer`, `use_raw`, `neighbors_key`, `key_added`, and output keys before debugging missing results.
- Avoid installing all optional extras. Choose narrow extras such as `leiden`, `louvain`, `skmisc`, `scrublet`, `scanorama`, `magic`, `dask`, or `plotting` only when the workflow needs them.
- For reproducible agent checks, run `scripts/run_scanpy_skill_smokes.py` or the nearest sub-skill smoke script instead of broad upstream test suites.

## References and Helpers

- `references/repo-provenance.md` records the source snapshot and evidence paths used to create this skill; read it before deciding whether a checkout needs refresh.
- `references/troubleshooting.md` covers shared install/import, optional dependency, AnnData state, and workflow-routing failures.
- `scripts/run_scanpy_skill_smokes.py` runs the safe bundled smoke scripts in the current Python environment.

Files in this skill

  • SKILL.md4.6 KB
  • references/repo-provenance.md2.2 KB
  • references/repo-routing-metadata.json494 B
  • references/troubleshooting.md3.5 KB
  • scripts/run_scanpy_skill_smokes.py2 KB
  • sub-skills/external-integrations/SKILL.md3.2 KB
  • sub-skills/external-integrations/references/dask-and-rapids.md5.2 KB
  • sub-skills/external-integrations/references/external-api-map.md8.7 KB
  • sub-skills/external-integrations/references/optional-dependencies.md5.6 KB
  • sub-skills/external-integrations/references/troubleshooting.md7 KB
  • sub-skills/external-integrations/scripts/check_scanpy_optional_deps.py8.3 KB
  • sub-skills/graph-embedding-analysis/SKILL.md3.8 KB
  • sub-skills/graph-embedding-analysis/references/troubleshooting.md8.5 KB
  • sub-skills/graph-embedding-analysis/references/workflows.md9.6 KB
  • sub-skills/graph-embedding-analysis/scripts/scanpy_analysis_smoke.py6.4 KB
  • sub-skills/io-data-access/SKILL.md3.2 KB
  • sub-skills/io-data-access/references/get-datasets-queries.md7 KB
  • sub-skills/io-data-access/references/io-formats.md6.8 KB
  • sub-skills/io-data-access/references/troubleshooting.md6.8 KB
  • sub-skills/io-data-access/scripts/scanpy_io_roundtrip.py4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.