What problem does it solve?
AnnData is the shared data container for the scverse ecosystem (scanpy, scvi-tools, scvelo, cellrank, squidpy, muon). Understanding its structure is prerequisite knowledge for all single-cell Python work. Every tool in this skill library reads and writes AnnData objects.
Core Features & Use Cases
- AnnData Structure: The AnnData object stores cell metadata in .obs, gene metadata in .var, expression in .X, and unstructured data in .uns, with additional slots like .obsm, .varm, .obsp, and .layers for modular data representations.
- Memory and I/O: Supports backed mode for on-disk operations, multiple read/write formats (h5ad, zarr), and efficient subsetting without loading all data into memory.
- Common Operations: Reading/writing, subsetting, concatenation, and slot management across .X, .obs, .var, .uns, .obsm, .varm.
- Use Case: Debug shape/index mismatches during data integration and prepare data for downstream tools in scanpy/scvi-tools workflows.
Quick Start
Load an example AnnData object and inspect its .obs and .var to understand the data model.