scanpy

scanpy is a skill for Claude Code from ualberta-rcg/drac-agent-skills. It costs 73 tokens per session (1,389 once invoked), scanned A, original, MIT.

A Python toolkit for analysing single-cell RNA sequencing data, which measures gene activity in individual cells. It supports quality checks, normalization, dimension reduction, grouping similar cells, comparing samples, and preparing statistical tests.

In plain words
What is it for?
Use it to remove poor-quality cells, find variable genes, create PCA and UMAP views, cluster cells, identify marker genes, combine batches, and prepare pseudobulk comparisons.
Why use it?
It provides a structured workflow for turning raw single-cell measurements into cell groups and gene-level results. It also helps preserve raw counts and avoid treating cell-group marker results as valid comparisons between biological conditions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the community-science plugin — 10 skills shipped together

Good fit Use it to remove poor-quality cells, find variable genes, create PCA and UMAP views, cluster cells, identify marker genes, combine batches, and prepare pseudobulk comparisons.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ualberta-rcg/drac-agent-skills/scanpy
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ualberta-rcg/drac-agent-skills --skill scanpy
Clone the repo
git clone --depth 1 https://github.com/ualberta-rcg/drac-agent-skills

Made for: Claude Code.

Or install community-science, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for scanpy

README.md
[![agentmods](https://agentmods.dev/badge/skills/ualberta-rcg/drac-agent-skills/scanpy/github.svg)](https://agentmods.dev/skills/ualberta-rcg/drac-agent-skills/scanpy)
Your own site
<a href="https://agentmods.dev/skills/ualberta-rcg/drac-agent-skills/scanpy"><img src="https://agentmods.dev/badge/skills/ualberta-rcg/drac-agent-skills/scanpy/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for scanpy

Your own site · 80×15
<a href="https://agentmods.dev/skills/ualberta-rcg/drac-agent-skills/scanpy"><img src="https://agentmods.dev/badge/skills/ualberta-rcg/drac-agent-skills/scanpy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,389 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.01389
Opus 5.5 $0.00029 $0.00556
Sonnet 5.5 $0.00015 $0.00278
Haiku 4.5 $0.00007 $0.00139

Measured 6d ago against content hash 2703adb990b4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

scanpy scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

community-skills/skills/scanpy/SKILL.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Scanpy: Single-Cell RNA-seq Analysis (AnnData)

Target Scanpy 1.12+ (sc.tl.louvain and per-plot save= are deprecated — use sc.tl.leiden(..., flavor="igraph", n_iterations=2) and sc.settings.figdir / sc.settings.autosave).

Non-Negotiable AnnData Representation Rules

  1. Preserve raw integer UMI counts before normalizing: Save adata.layers["counts"] = adata.X.copy() before sc.pp.normalize_total and sc.pp.log1p. Never guess count provenance from integer-looking floats.
  2. Distinguish layers["counts"] from .raw: Snapshot adata.raw = adata.copy() after log1p (and before subsetting to HVGs) so rank_genes_groups and marker dotplots have full-transcriptome log-normalized expression, while layers["counts"] retains raw counts for pseudobulk DE (pydeseq2) or scvi-tools.
  3. Never treat cluster rank_genes_groups p-values as condition DE: Clustering and testing on the same cells inflates false positives; for multi-sample condition comparisons, aggregate raw counts per (sample, cell_type) biological replicate into pseudobulk matrices and test with PyDESeq2 / edgeR.

Standard End-to-End Scanpy Workflow

import scanpy as sc

sc.settings.figdir = "/scratch/$USER/sc_figures"
sc.settings.autosave = True

# 1. Load & preserve raw counts
adata = sc.read_10x_h5("/scratch/$USER/filtered_feature_bc_matrix.h5")
adata.var_names_make_unique()
adata.layers["counts"] = adata.X.copy()

# 2. Quality control (inspect violin/scatter distributions before choosing cutoffs!)
adata.var["mt"] = adata.var_names.str.startswith(("MT-", "mt-"))
sc.pp.calculate_qc_metrics(adata, qc_vars=["mt"], inplace=True)
adata = adata[
    (adata.obs["n_genes_by_counts"] >= 200)
    & (adata.obs["pct_counts_mt"] < 15.0),
    :,
].copy()
sc.pp.filter_genes(adata, min_cells=3)
sc.pp.scrublet(adata, batch_key="sample")  # Optional doublet scoring on raw counts

# 3. Normalize, log1p, snapshot full-gene .raw, then select HVGs
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
adata.raw = adata.copy()  # Full-gene log1p expression for marker visualization

sc.pp.highly_variable_genes(adata, n_top_genes=2000, batch_key="sample")
adata_hvg = adata[:, adata.var["highly_variable"]].copy()

# 4. PCA, neighbor graph, UMAP & Leiden clustering (igraph backend)
sc.tl.pca(adata_hvg, n_comps=40)
sc.pp.neighbors(adata_hvg, n_neighbors=15, n_pcs=30)
sc.tl.umap(adata_hvg)
for res in (0.4, 0.6, 1.0):
    sc.tl.leiden(adata_hvg, resolution=res, key_added=f"leiden_{res}", flavor="igraph", n_iterations=2)

# 5. Exploratory marker ranking (against full-gene log1p .raw)
sc.tl.rank_genes_groups(adata_hvg, groupby="leiden_0.6", method="wilcoxon", use_raw=True)
markers = sc.get.rank_genes_groups_df(adata_hvg, group=None)
adata_hvg.write_h5ad("/scratch/$USER/processed.h5ad", compression="gzip")

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 80 lines · 73 tokens per session scan A 2703adb990b4

Subscribe to this mod's changes

scanpy is a skill published in the GitHub repository ualberta-rcg/drac-agent-skills (2 stars, last pushed 7d ago), licensed MIT. It adds 73 tokens to every session and 1,389 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-25.

Related

scanpy compared with skills from other repositories

scanpy next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
scanpyualberta-rcg/drac-agent-skillsSkill27d agoMITA73Claude Code
jupyter-notebookNousResearch/hermes-agentSkill267ktodayMITA18Claude Code, Codex
matlabK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA44Claude Code
pennylaneK-Dense-AI/scientific-agent-skillsSkill59kyesterdayMITA74Claude Code
cuequivariance-torchNVIDIA/skillsSkill4.2ktodayApache-2.0A37Claude Code, Codex
cuequivariance-jaxNVIDIA/skillsSkill4.2ktodayApache-2.0A38Claude Code, Codex
cuopt-numerical-optimization-apiNVIDIA/skillsSkill4.2ktodayApache-2.0A51Claude Code, Codex