Claude Skill MartBrowse skillsQuick linesLearn by videoTerminal guideWhat is a Skill?
Back to list

AnnData Data Structure Skill

Teaches Claude the correct, up-to-date patterns for creating, reading, writing, concatenating and subsetting AnnData (.h5ad/zarr) objects in single-cell workflows.

Data & AnalyticsIntermediate46,1344,181AI score 8/10Last updated: Sep 21, 2026

What it does

  • Guides creation, reading and writing of AnnData objects across .h5ad, .zarr, CSV, MTX and Loom using current APIs (anndata.io).
  • Explains the object layout (X, obs, var, layers, obsm/varm, obsp/varp, uns, raw) and the view-vs-copy trap.
  • Provides concrete patterns for ad.concat batch merging (inner/outer joins, label/keys), backed mode and chunked processing for huge files, and memory optimization via sparse matrices and categoricals.
  • Steers away from deprecated APIs (ad.read, AnnData.concatenate(), __version__) and flags anndata.experimental as unstable.
  • Includes scverse ecosystem integration snippets for scanpy, muon and PyTorch (AnnLoader).

Who it's for

  • Bioinformaticians and grad students analyzing single-cell RNA-seq data in Python.
  • Anyone building scanpy/scvi-tools pipelines who keeps hitting data-format friction.
  • Users handling tens-to-hundreds of GB h5ad files under memory constraints.

Example uses

  1. "Merge batch1–batch3.h5ad with batch labels, keeping only shared genes" → generates ad.concat(..., label='batch', keys=[...], join='inner').
  2. "Extract cells with quality_score > 0.8 from a 100GB h5ad" → backed-mode read, filter, to_memory(), then write_h5ad(compression='gzip').
  3. "I keep running out of memory" → checklist of csr_matrix conversion, strings_to_categoricals(), and when to snapshot raw.

· · · Install guide · · ·

Try it now, no install

Paste this into Claude to use the skill without installing anything.

Read the instructions in this file and follow them to help me:
https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/HEAD/skills/anndata/SKILL.md

What I want: (describe your task here)

If Claude can't open the link, open it yourself and paste the contents instead.

If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.

Install in the Claude app (no terminal)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download ZIP
Install in Claude Code

Let Claude do it — paste this into Claude Code

Install the skill I found on Claude Skill Mart.
Copy the skills/anndata folder from the GitHub repo K-Dense-AI/scientific-agent-skills into my ~/.claude/skills/anndata/.
When it's done, tell me in one line what this skill can do.

Install with a command instead

git clone https://github.com/K-Dense-AI/scientific-agent-skills.git /tmp/sas && mkdir -p ~/.claude/skills && cp -r /tmp/sas/skills/anndata ~/.claude/skills/

This is a third-party skill. Check the source repository before installing.

  1. Open a terminal and clone the repo: git clone https://github.com/K-Dense-AI/scientific-agent-skills.git
  2. Create the skills directory: mkdir -p ~/.claude/skills
  3. Copy just this skill: cp -r scientific-agent-skills/skills/anndata ~/.claude/skills/
  4. Verify the bundled references/ markdown files came along: ls ~/.claude/skills/anndata
  5. Prepare a Python 3.11+ environment: uv pip install "anndata==0.12.16" (add scanpy if you need 10x readers).
  6. Restart Claude Code and try a prompt like "concatenate these h5ad files by batch" to confirm the skill triggers.