Agent skill

Anndata

by aipoch in aipoch/medical-research-skills

Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem.

MITAuto-check passedResearch & Science

Install Anndata

skills CLI
$ npx skills add aipoch/medical-research-skills --skill anndata -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install aipoch/medical-research-skills anndata --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/aipoch/medical-research-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/'scientific-skills/Data Analysis/anndata' .claude/skills/anndata && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
anndata
GitHub stars
2k
Token cost
~1.7k tokens
SKILL.md length
460 words
Files
7 (incl. references)
Skills in repo
567
Repo updated
First seen
Licence
MIT

At a glance

Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem.

  • Reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem
  • SKILL.md covers When to Use, Key Features, Dependencies and Example Usage, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Bioinformatics

What it does

Anndata is an agent skill from aipoch/medical-research-skills. Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `anndata_audit_result_v1.json`, `references/best_practices.md` and `references/concatenation.md`).

It sits in Research & Science, covering Bioinformatics. It works with AnnData, Zarr and NumPy. The repository describes itself as: Hundreds of agent skills for medical research, including protocol design, data analysis, evidence insights, and academic writing. The licence is MIT.

When your agent uses it

  • Reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem
  • Tasks that involve Bioinformatics

Example prompts

  • “/anndata”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 686e09d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Anndata loads about 1.7k tokens when it runs, and up to ~15k if it reads all its reference files. Until then it costs about 40 tokens; SKILL.md has 460 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~40
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~15k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from aipoch/medical-research-skills at commit 686e09d, republished under its MIT licence (© aipoch). 460 words, ~1,688 tokens.

Download SKILL.mdSave it as .claude/skills/anndata/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
anndata
description
Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem.
license
MIT
author
AIPOCH

Source: https://github.com/aipoch/medical-research-skills

When to Use

Use AnnData when you need to:

  • Load, inspect, or export annotated single-cell datasets stored as .h5ad (or zarr) for downstream tools.
  • Keep a matrix (cells × features) tightly coupled with observation/feature metadata (e.g., cell types, batches, gene annotations).
  • Work efficiently with large, sparse count matrices (e.g., scRNA-seq) and avoid loading everything into memory (backed mode).
  • Combine multiple experiments/batches/modalities into a unified object while tracking provenance.
  • Subset/filter/transform data while preserving alignment between the matrix and metadata.

Key Features

  • Unified container: X (data matrix) plus aligned annotations: obs, var, uns, and multi-dimensional slots (obsm, varm, obsp, varp), plus layers and optional raw.
  • Interoperable I/O: Native .h5ad and zarr, plus common genomics formats (e.g., 10x, loom, mtx, csv).
  • Scalable workflows: Sparse matrices and backed mode (backed="r") for large datasets.
  • Safe subsetting: Slicing preserves alignment across matrix and annotations; supports views vs copies.
  • Concatenation utilities: ad.concat(...) with join/merge strategies and batch labeling; experimental lazy collections.

Reference notes: the original material mentions additional guides under references/ (e.g., references/data_structure.md, references/io_operations.md, references/concatenation.md, references/manipulation.md, references/best_practices.md) for deeper explanations of each topic.

Dependencies

  • anndata (latest compatible with your environment; install via pip/uv)
  • numpy
  • pandas
  • scipy (recommended for sparse matrices)
  • Optional ecosystem tools (only if needed):
    • scanpy
    • muon
    • torch (for deep learning) and anndata experimental loader utilities

Example Usage

A complete runnable example that creates an AnnData object, writes/reads .h5ad, subsets, concatenates batches, and demonstrates backed mode.

python
import numpy as np
import pandas as pd
import anndata as ad
from scipy.sparse import csr_matrix

# ----------------------------
# 1) Create an AnnData object
# ----------------------------
rng = np.random.default_rng(0)

n_cells, n_genes = 100, 500
X = rng.poisson(1.0, size=(n_cells, n_genes)).astype(np.float32)

obs = pd.DataFrame(
    {
        "cell_type": (["T cell", "B cell"] * (n_cells // 2)),
        "sample": (["A", "B"] * (n_cells // 2)),
        "quality_score": rng.random(n_cells),
    },
    index=[f"cell_{i}" for i in range(n_cells)],
)

var = pd.DataFrame(
    {"gene_name": [f"Gene_{j}" for j in range(n_genes)]},
    index=[f"ENSG{j:05d}" for j in range(n_genes)],
)

adata = ad.AnnData(X=X, obs=obs, var=var)

# Use sparse storage for typical count-like matrices
adata.X = csr_matrix(adata.X)

# Convert string columns to categoricals to reduce memory and speed up ops
adata.strings_to_categoricals()

print(f"Created: {adata.n_obs} obs × {adata.n_vars} vars")

# ----------------------------
# 2) Write and read .h5ad
# ----------------------------
adata.write_h5ad("example.h5ad", compression="gzip")

adata2 = ad.read_h5ad("example.h5ad")
print(f"Reloaded: {adata2.n_obs} obs × {adata2.n_vars} vars")

# ----------------------------
# 3) Subset (keeps alignment)
# ----------------------------
t_cells = adata2[adata2.obs["cell_type"] == "T cell", :]
high_quality = adata2[adata2.obs["quality_score"] > 0.8, :]

print(f"T cells: {t_cells.n_obs}")
print(f"High quality: {high_quality.n_obs}")

# ----------------------------
# 4) Concatenate batches
# ----------------------------
adata_a = adata2[adata2.obs["sample"] == "A", :].copy()
adata_b = adata2[adata2.obs["sample"] == "B", :].copy()

combined = ad.concat(
    [adata_a, adata_b],
    axis=0,                 # concatenate observations (cells)
    join="inner",           # keep shared variables
    label="batch",          # add a column in .obs
    keys=["A", "B"],        # batch labels
)

print(combined.obs["batch"].value_counts().to_dict())

# ----------------------------
# 5) Backed mode for large files
# ----------------------------
adata_backed = ad.read_h5ad("example.h5ad", backed="r")
# Slicing in backed mode is metadata-friendly; load to memory when needed:
subset_mem = adata_backed[:10, :50].to_memory()
print(f"Backed subset loaded: {subset_mem.shape}")

Implementation Details

Data model (core slots)
  • X: primary data matrix (dense numpy.ndarray or sparse scipy.sparse), shape (n_obs, n_vars).
  • obs: per-observation metadata (pandas.DataFrame), indexed by obs_names (e.g., cell IDs).
  • var: per-variable metadata (pandas.DataFrame), indexed by var_names (e.g., gene IDs).
  • layers: named alternative matrices aligned to X (e.g., "counts", "log1p").
  • obsm / varm: multi-dimensional embeddings aligned to obs/var (e.g., PCA, UMAP coordinates).
  • obsp / varp: pairwise graphs/matrices (e.g., kNN graph in obsp["connectivities"]).
  • uns: unstructured metadata (dict-like), often used for parameters and plotting configs.
  • raw (optional): snapshot of unfiltered/untransformed data for reproducibility.
Show full SKILL.md (142 more words)Show less
Views vs copies
  • Slicing like adata_subset = adata[mask, :] typically returns a view (lightweight reference).
  • Use .copy() when you need an independent object (e.g., before in-place modifications).
Backed mode (large datasets)
  • ad.read_h5ad(path, backed="r") keeps the matrix on disk and loads data lazily.
  • Convert a slice to memory with .to_memory() when you need in-memory computation.
  • Backed mode is best for filtering by metadata, chunked processing, and avoiding OOM.
Concatenation behavior
  • ad.concat([...], axis=0) stacks observations; axis=1 stacks variables.
  • join="inner" keeps intersection of variables; join="outer" unions variables (may introduce missing values).
  • label + keys records dataset/batch provenance in .obs[label].
  • Merge strategies control how conflicting .uns and annotation columns are handled (choose based on your data governance needs).
Practical performance parameters
  • Prefer sparse matrices (csr_matrix) for count-like data.
  • Convert repeated strings to categoricals (adata.strings_to_categoricals()).
  • Use compression when writing .h5ad (e.g., compression="gzip") to reduce storage; consider zarr for chunked/cloud-friendly access.

© aipoch, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (references) in scientific-skills/Data Analysis/anndata of aipoch/medical-research-skills.

  • SKILL.md
  • anndata_audit_result_v1.json
  • references/best_practices.md
  • references/concatenation.md
  • references/data_structure.md
  • references/io_operations.md
  • references/manipulation.md

Open the folder on GitHubat commit 686e09d

Compare with similar skills

Anndata next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Anndata compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Anndata this skillaipoch/medical-research-skills2k—~1.7kAutomated safety check: PassMIT
Spatial AteraQING1105/ezST101—~576Automated safety check: PassMIT
Anndata Data Structurejaechang-hits/SciAgent-Skills3702 repos~5.8kAutomated safety check: PassBSD-3-Clause
AnndataK-Dense-AI/scientific-agent-skills48k1 repos~3.9kAutomated safety check: NotesBSD-3-Clause
Bio Single Cell Data IoGPTomics/bioSkills1.2k1 repos~3.3kAutomated safety check: PassMIT
Lamindb Data Managementjaechang-hits/SciAgent-Skills3702 repos~4kAutomated safety check: PassApache-2.0

Similar skills

  • Spatial Atera

    QING1105/ezST

    Atera platform branch of the spatial transcriptomics workflow — load and validate Atera cell-level output (AnnData + Zarr segmentation) for downstream analysis.

    101 GitHub stars~576 tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Anndata Data Structure

    jaechang-hits/SciAgent-Skills

    Annotated matrices for single-cell genomics. An agent skill from jaechang-hits/SciAgent-Skills.

    370 GitHub starsUsed in 2 repos~5.8k tokens
    Research & ScienceAuto-check passed
  • Anndata

    K-Dense-AI/scientific-agent-skills

    Handles annotated matrices in single-cell analysis, .h5ad and Zarr files, and integration with the scverse ecosystem.

    48k GitHub starsUsed in 1 repo~3.9k tokens
    Research & ScienceAuto-check: notes
  • Bio Single Cell Data Io

    GPTomics/bioSkills

    Read, write, create, and convert single-cell objects across AnnData (Python), Seurat (R), and SingleCellExperiment (R).

    1.2k GitHub starsUsed in 1 repo~3.3k tokens
    Research & ScienceAuto-check passed
  • Lamindb Data Management

    jaechang-hits/SciAgent-Skills

    Open-source FAIR biology data framework. An agent skill from jaechang-hits/SciAgent-Skills.

    370 GitHub starsUsed in 2 repos~4k tokens
    Research & ScienceAuto-check passed
  • Stores and operates on sparse expression matrices for single-cell and large bulk RNA-seq, covering dgCMatrix/dgRMatrix/dgTMatrix when-each-is-fast, the dgCMatrix (CSC, R) <- CSR (Python) implicit…

    1.2k GitHub starsUsed in 1 repo~5.6k tokens
    Research & ScienceAuto-check passed

More from aipoch/medical-research-skills

All 567 skills in this repo
  • Academic Poster Generator

    aipoch/medical-research-skills

    Complete workflow for generating academic research posters from PDF literature; use when you need to extract paper content from PDFs and produce a LaTeX-based poster…

    2k GitHub stars~2.2k tokensUpdated 21 days ago
    Auto-check passed
  • Diagnostic Study Quality Assessment Quadas

    aipoch/medical-research-skills

    Analyzes clinical diagnostic accuracy studies for bias using the QUADAS-2 tool.

    2k GitHub stars~1.4k tokensUpdated 21 days ago
    Auto-check passed
  • Exploratory Data Analysis

    aipoch/medical-research-skills

    Perform comprehensive exploratory data analysis on scientific data files across 200+ file formats.

    2k GitHub stars~3.7k tokensUpdated 21 days ago
    Auto-check passed
  • Iso Certification

    aipoch/medical-research-skills

    A toolkit for preparing ISO 13485:2016 certification documentation for medical device QMS.

    2k GitHub stars~1.8k tokensUpdated 21 days ago
    Auto-check passed
  • Journal Skills

    aipoch/medical-research-skills

    Recommends target journals for manuscript submission by analyzing the paper topic/abstract and the journal distribution of similar PubMed literature; use when users ask for journal…

    2k GitHub stars~1.7k tokensUpdated 21 days ago
    Auto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 21 days ago
    Auto-check passed

Questions about Anndata

What does Anndata do?

Data structure for annotated matrices in single-cell analysis; use when reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem. Anndata is an agent skill from aipoch/medical-research-skills.h5ad (or zarr) and exchanging data with the scverse ecosystem.

When should I use Anndata?

Anndata fits situations like: reading/writing .h5ad (or zarr) and exchanging data with the scverse ecosystem; tasks that involve Bioinformatics.

How do I install Anndata in Claude Code?

Run `npx skills add aipoch/medical-research-skills --skill anndata -a claude-code`. Or copy the skill folder (scientific-skills/Data Analysis/anndata in aipoch/medical-research-skills) into .claude/skills/anndata in your project. Claude Code loads it when a task matches its description.

How do I install Anndata in Codex?

Run `npx skills add aipoch/medical-research-skills --skill anndata -a codex`. Or copy the skill folder (scientific-skills/Data Analysis/anndata in aipoch/medical-research-skills) into .agents/skills/anndata in your project. Codex loads it when a task matches its description.

Can I use Anndata in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add aipoch/medical-research-skills --skill anndata -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/anndata, .gemini/skills/anndata, .github/skills/anndata and .opencode/skills/anndata in your project.

What does Anndata need to run?

SKILL.md names no scripts, command-line tools or credentials: Anndata is instructions for the agent only. Our summary lists: Python 3.

Does Anndata access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Anndata safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Anndata use?

Anndata is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Anndata use?

About 1.7k tokens (SKILL.md is roughly 6.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.

What are the alternatives to Anndata?

Skills that share tags, products or a category with Anndata: Spatial Atera (QING1105/ezST, 101 stars), Anndata Data Structure (jaechang-hits/SciAgent-Skills, 370 stars), Anndata (K-Dense-AI/scientific-agent-skills, 48k stars) and Bio Single Cell Data Io (GPTomics/bioSkills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Anndata?

aipoch (a GitHub organization) maintains it in aipoch/medical-research-skills, which has 1,974 GitHub stars. The repository holds 567 skills in this directory. The repository was last updated on September 17, 2026.

Source: aipoch/medical-research-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.