Anndata

From VectorSpaceLab/AREX-Skill · View interactive version

Anndata is an AI agent skill from the GitHub repository VectorSpaceLab/AREX-Skill. Use AnnData to build, inspect, combine, store, lazily read, and extend annotated data matrices in memory and on disk.

How to use this skill

Skill file

AnnData Repo Skill

Use this repo skill when a task involves anndata, AnnData, annotated data matrices, .h5ad, .zarr, backed mode, lazy reads, anndata.concat, AnnCollection, anndata.acc, or AnnData extension namespaces. AnnData is a Python package for annotated data matrices with aligned observations, variables, multidimensional annotations, pairwise arrays, layers, unstructured metadata, and native HDF5/Zarr storage.

First Checks

python - <<'PY'
import anndata as ad
from anndata import AnnData
print(ad.__name__, AnnData)
PY

Route Map

Common Workflows

  1. For a new object, start with data-model: confirm X.shape == (len(obs), len(var)), choose stable obs_names and var_names, add aligned arrays only when their leading axes match, then run the bundled structure inspector when shape problems are likely.
  2. For persistence, move to storage-io: choose .h5ad for single-file exchange or Zarr for directory/object-store workflows, validate round-trips with a tiny fixture, and use backed/lazy reads only when their access constraints fit the task.
  3. For multi-dataset integration, use combining-data: decide axis, join, merge, uns_merge, label, keys, index_unique, fill_value, and whether memory pressure requires AnnCollection or concat_on_disk.
  4. For reusable library code, use accessors-extensions: represent fields with A.obs[...], A.obsm[...][:, i], or A.layers[...], validate references before indexing, and keep extension namespaces small and explicitly typed.

Shared References And Scripts

Decision Points

Troubleshooting Priority

  1. Verify the import, installed version, and optional extras relevant to the task.
  2. Reproduce with a tiny AnnData object before scaling to large files or many batches.
  3. Check shapes and names on every aligned slot.
  4. Isolate storage problems with a fresh tiny H5AD or Zarr round-trip.
  5. For concat surprises, print shape, obs_names, var_names, label categories, .uns.keys(), and relevant .obsm/.varm/.obsp keys.
  6. For accessor or extension errors, validate references and namespace signatures before optional plotting, storage, or downstream package imports.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.