anndata-data-structure
Annotated matrices for single-cell genomics. Stores X with obs/var metadata, layers, embeddings (obsm/varm), graphs (obsp/varp), uns. Use for .h5ad/.zarr I/O, concatenation, scverse integration. For analysis use scanpy; for probabilistic models use scvi-tools.
npx skills add BioTender-max/awesome-bio-agent-skills --skill anndata-data-structure --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
AnnData — Annotated Data Matrices for Single-Cell Genomics describes a data structure that stores an observations-by-variables matrix X alongside cell metadata (obs), gene metadata (var), layers, embeddings (obsm/varm), graphs (obsp/varp), and unstructured metadata (uns). It also covers supported storage formats (H5AD, Zarr, 10X H5, Loom, CSV) and explains how to use it for reading/writing .h5ad or .zarr, backed mode for large files, and integration with Scanpy and scvi-tools.
How it works
The skill instructs building and manipulating AnnData objects through concrete steps:
- Object creation: construct AnnData with X, obs, var; set layers for raw/normalized data; generate basic prints of shapes and columns.
- I/O operations: read/write in H5AD, 10X formats, Zarr; enable backed mode read_h5ad(..., backed="r"); subset and load subsets with to_memory().
- Subsetting and views: perform boolean masks, index-based selections, and metadata-based filtering; note that subsetting returns a view and requires .copy() before modification.
- Layers, embeddings, and graphs: assign layers via adata.layers, add embeddings in adata.obsm, add loadings in adata.varm, graphs in adata.obsp, and unstructured metadata in adata.uns.
- Concatenation: concatenate multiple AnnData objects along observations or variables with join/merge strategies, including lazy and on-disk options.
- Data manipulation: type conversions, adding/removing metadata, renaming obs/var, and QC filtering with copies to avoid in-place warnings.
When to use it
Use AnnData when constructing annotated matrices from raw data, reading/writing .h5ad or .zarr, concatenating batches, or organizing multi-modal data with multiple representations. For single-cell analysis, use scanpy; for probabilistic models, use scvi-tools.
What it can touch
The skill references tools and files in the ecosystem: AnnData API (ad.read_h5ad, ad.concat, ad.AnnData, ad.write_h5ad, ad.read_zarr, ad.read_10x_h5, ad.read_h5ad with backed, etc.), numpy, pandas, scipy.sparse, and standard Python data structures for obs/var/DataFrames. It also mentions formats like H5AD, Zarr, 10X H5, Loom, and CSV.
Caveats
Requires BSD-3-Clause license for the skill; notes backed mode behavior and common warnings about views vs copies when subsetting. It emphasizes the need to .copy() before modification to avoid implicit modification warnings and discusses memory considerations with backed loading and lazy concatenation.
# AnnData — Annotated Data Matrices for Single-Cell Genomics ## Overview AnnData provides the standard data structure for single-cell genomics in the scverse ecosystem. It stores an observations-by-variables matrix (X) alongside cell metadata (obs), gene metadata (var), layers, embeddings (obsm/varm), graphs (obsp/varp), and unstructured metadata (uns). Supports sparse matrices, H5AD/Zarr storage, backed mode for large files, and integration with Scanpy, scvi-tools, and Muon. ## When to Use - Constructing annotated matrices from raw count data with cell/gene metadata - Reading/writing `.h5ad` or `.zarr` files for single-cell experiments - Subsetting cells by quality metrics, gene sets, or metadata conditions - Concatenating multiple experimental batches with consistent metadata - Storing multiple data layers (raw counts, normalized, scaled) in one object - Working with large datasets exceeding RAM (backed mode, lazy concatenation) - Preparing data for Scanpy or scvi-tools pipelines - For single-cell **analysis** (clustering, DE, visualization), use `scanpy` instead - For **probabilistic models**, use `scvi-tools` instead ## Prerequisites - **Python packages**: `anndata`, `scipy`, `
- Overview
- When to Use
- Prerequisites
- Quick Start
- Core API
- 1. Object Creation
- 2. I/O Operations
- 3. Subsetting and Views
- 4. Layers, Embeddings, and Graphs
- 5. Concatenation
- 6. Data Manipulation
- Key Concepts
- AnnData Object Architecture
- Views vs Copies
pip install "anndata>=0.10" Full ecosystem pip install anndata scanpy zarr
What does the anndata-data-structure skill do?
Annotated matrices for single-cell genomics. Stores X with obs/var metadata, layers, embeddings (obsm/varm), graphs (obsp/varp), uns. Use for .h5ad/.zarr I/O, concatenation, scverse integration. For analysis use scanpy; for probabilistic models use scvi-tools.
How do I install it?
Run `npx skills add BioTender-max/awesome-bio-agent-skills --skill anndata-data-structure --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From BioTender-max/awesome-bio-agent-skills, a repository with 135 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
