k-dense-ai/scientific-agent-skills/anndata
- community
Checking that the SKILL.md file is still in the repository.
Handles annotated matrices in single-cell analysis, .h5ad and Zarr files, and integration with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Install
npx vskill@latest install k-dense-ai/scientific-agent-skills/anndataSKILL.md
AnnData
Overview
AnnData is a Python package for handling annotated data matrices, storing experimental measurements (X) alongside observation metadata (obs), variable metadata (var), and multi-dimensional annotations (obsm, varm, obsp, varp, uns). Originally designed for single-cell genomics through Scanpy, it now serves as a general-purpose framework for any annotated data requiring efficient storage, manipulation, and analysis.
When to Use This Skill
Use this skill when:
- Creating, reading, or writing AnnData objects
- Working with h5ad, zarr, or other genomics data formats
- Performing single-cell RNA-seq analysis
- Managing large datasets with sparse matrices or backed mode
- Concatenating multiple datasets or experimental batches
- Subsetting, filtering, or transforming annotated data
- Integrating with scanpy, scvi-tools, or other scverse ecosystem tools
Installation
Targets AnnData 0.13.4 (current PyPI release reviewed 2026-09-30), requiring Python 3.12+. Small synthetic checks cover dense/sparse matrices, native I/O, metadata, concatenation, and lazy reads. File paths, biological analysis, remote stores, and third-party integration examples are illustrative unless stated otherwise.
Use unpinned installs only when intentionally tracking the latest compatible release.
Current API notes:
- Use
anndata.iofor non-nativeread_*andwrite_*helpers. Top-levelanndata.read_h5adandanndata.read_zarrremain supported. - Use
ad.concat;AnnData.concatenate()was removed in 0.13. Avoid oldad.read, deprecatedAnnData.*_keys()helpers andanndata.__version__; prefer explicit readers, mapping.keys(), andimportlib.metadata.version("anndata"). - In 0.13,
.Xis alsolayers[None]; layer iteration includesNone. Usekey is not Nonewhen selecting named layers. View.Xwrites now use copy-on-write. - Zarr v3 and automatic sharding are the defaults; the Python dependency is Zarr >=3. Dense H5AD
Xremains writable withbacked="r+", but backed sparse item assignment is unsupported in 0.13. AnnLoaderand Loom reading/writing are deprecated.AnnCollectionand other experimental APIs need the caveats in the references.
These changes are documented in the official release notes. The live docs header still displayed 0.13.3.post0 at review; behavior below was also checked against installed 0.13.4 source.
Quick Start
Creating an AnnData object
Reading data
Writing data
Basic operations
Core Capabilities
1. Data Structure
Understand the AnnData object structure including X, obs, var, layers, obsm, varm, obsp, varp, uns, and raw components.
See: references/data_structure.md for comprehensive information on:
- Core components (X, obs, var, layers, obsm, varm, obsp, varp, uns, raw)
- Creating AnnData objects from various sources
- Accessing and manipulating data components
- Memory-efficient practices
2. Input/Output Operations
Read and write data in various formats with support for compression, backed mode, and cloud storage.
See: references/io_operations.md for details on:
- Native formats (h5ad, zarr)
- Alternative formats (CSV, MTX, Loom, 10X, Excel)
- Backed mode for large datasets
- Remote data access
- Format conversion
- Performance optimization
Common commands:
3. Concatenation
Combine multiple AnnData objects along observations or variables with flexible join strategies.
See: references/concatenation.md for comprehensive coverage of:
- Basic concatenation (axis=0 for observations, axis=1 for variables)
- Join types (inner, outer)
- Merge strategies (same, unique, first, only)
- Tracking data sources with labels
- Lazy concatenation (AnnCollection)
- On-disk concatenation for large datasets
Common commands:
4. Data Manipulation
Transform, subset, filter, and reorganize data efficiently.
See: references/manipulation.md for detailed guidance on:
- Subsetting (by indices, names, boolean masks, metadata conditions)
- Transposition
- Copying (full copies vs views)
- Renaming (observations, variables, categories)
- Type conversions (strings to categoricals, sparse/dense)
- Adding/removing data components
- Reordering
- Quality control filtering
Common commands:
5. Best Practices
Follow recommended patterns for memory efficiency, performance, and reproducibility.
See: references/best_practices.md for guidelines on:
- Memory management (sparse matrices, categoricals, backed mode)
- Views vs copies
- Data storage optimization
- Performance optimization
- Working with raw data
- Metadata management
- Reproducibility
- Error handling
- Integration with other tools
- Common pitfalls and solutions
Key recommendations:
Integration with Scverse Ecosystem
AnnData serves as the foundational data structure for the scverse ecosystem:
Scanpy (Single-cell analysis)
Illustrative analysis; requires Scanpy and its selected clustering backend. Choose QC thresholds and representations for the assay, and keep count provenance.
Muon (Multimodal data)
PyTorch integration
anndata.experimental.AnnLoader is deprecated since 0.12.17. Follow the official annbatch migration tutorial for annbatch.Loader; no training run or GPU compatibility is claimed here.
Third-party storage compatibility
AnnData 0.13.4 exposes (None, X) in layers.items(). TileDB-SOMA 2.3.0 from_anndata can fail when treating that key as a URI name. Do not claim this version pair ingests successfully or delete layers[None] as a workaround (that removes X). Use an independently tested compatible environment and verify values, identifiers, named layers, and provenance after any conversion.
Common Workflows
Single-cell RNA-seq analysis
Combining batches
Working with large datasets
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/anndata/SKILL.md
Popularity
- Repository stars
- 32,196
- Repository forks
- 3,191
- 7-day trend score
- 52
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Jul 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/k-dense-ai/scientific-agent-skills/anndata)