Install
$ agentstack add skill-holobiomicslab-asb-skill-collections-anndata-backed-object-manipulation ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
anndata-backed-object-manipulation
Summary
Manipulate fully backed AnnData objects to store and access single-cell omics fragment data and count matrices without loading entire datasets into memory. This skill enables scalable preprocessing and matrix operations on datasets exceeding 10 million cells by leveraging on-disk storage.
When to use
When working with large single-cell ATAC-seq or multi-omics datasets where in-memory storage is infeasible (>1M cells), and you need to iteratively add or modify count matrices (tile-based, peak-based, or gene-based) while preserving fragment-level data for reproducibility and re-analysis.
When NOT to use
- Input data is already a dense in-memory count matrix; use backed AnnData only to avoid reprocessing raw fragments.
- Workflow requires frequent random access to all cells × features values (backed mode has I/O latency); consider in-memory AnnData for small datasets (<1M cells).
- Fragment data is unavailable or lost; count matrices cannot be regenerated with alternative binning strategies without raw sequencing alignments.
Inputs
- backed AnnData object (.h5ad file on disk)
- fragment coordinate data stored in .obsm slots (paired-end or single-end fragment tuples)
- genomic interval definitions (tile coordinates, peak BED file, or gene GTF annotations)
Outputs
- count matrix (stored in .X or .obsm of the same backed AnnData object)
- updated backed AnnData object with added matrix layer
- metadata about matrix binning (tile size, peak list, gene annotations)
How to apply
Load or create a backed AnnData object using SnapATAC2's I/O functions, which stores dense arrays and sparse matrices on disk rather than in RAM. Store raw fragment coordinates in .obsm['fragmentpaired'] or .obsm['fragmentsingle'] slots. Apply matrix operations (pp.addtilematrix, pp.makepeakmatrix, pp.makegenematrix) to generate count matrices from fragments; each operation reads from and writes to disk without materializing the full dataset. Verify matrix shape (nobs × nvars) and sparsity after each operation to confirm the count matrix reflects the intended genomic binning or feature selection.
Related tools
- SnapATAC2 (Provides pp.addtilematrix, pp.makepeakmatrix, pp.makegenematrix functions for matrix operations on backed AnnData; handles fragment data I/O and count aggregation) — https://github.com/scverse/SnapATAC2
- precellar (Upstream preprocessing: converts raw FASTQ files to fragment files (.tsv.zst) and count matrices that are input to backed AnnData workflows) — https://github.com/regulatory-genomics/precellar
- Scanpy (Companion library for seamless integration with backed AnnData objects; provides embedding and clustering on top of SnapATAC2 matrices)
Examples
import snapatac2 as snap; adata = snap.read('data.h5ad', backed='r+'); snap.pp.add_tile_matrix(adata, counting_strategy='paired_insertion'); adata.write()
Evaluation signals
- Verify that the backed AnnData object file size on disk grows incrementally with each matrix operation; no explosion to in-memory size.
- Check that .X (or intended .obsm key) contains the expected count matrix shape: nobs = number of cells, nvars = number of tiles/peaks/genes.
- Confirm matrix is sparse (majority zeros) and contains non-zero entries distributed across cells and genomic coordinates; spot-check a few cell × feature pairs for plausible counts.
- Run pp.filtercells or pp.selectfeatures on the matrix output to verify that downstream filtering operations read and write correctly to the backed object.
- Profile disk I/O latency: operations should complete in reasonable time (seconds to minutes per matrix depending on dataset size); significant slowdown may indicate backing strategy issues.
Limitations
- Backed AnnData objects require consistent on-disk storage; file system failures or accidental deletion of .h5ad file causes data loss.
- Matrix operations are sequential and I/O-bound; random-access patterns (e.g., selecting arbitrary subsets of cells repeatedly) may be slower than in-memory alternatives.
- Fragment storage in .obsm as tuples or coordinate arrays can itself consume significant disk space for large datasets; compression (e.g., via precellar's .tsv.zst) is recommended upstream.
- Compatibility with older AnnData or SnapATAC2 versions may break if the backing format or .obsm schema changes.
Evidence
- [readme] Implementation of fully backed AnnData.: "Implementation of fully backed AnnData."
- [other] Matrix operation including pp.addtilematrix, pp.makepeakmatrix, pp.makegenematrix: "Matrix operation including pp.addtilematrix, pp.makepeakmatrix, pp.makegenematrix"
- [other] Load backed AnnData object containing fragment data (stored in .obsm['fragmentpaired'] or .obsm['fragmentsingle']). Invoke pp.addtilematrix with countingstrategy='pairedinsertion': "Load backed AnnData object containing fragment data (stored in .obsm['fragmentpaired'] or .obsm['fragmentsingle']). Invoke pp.addtilematrix with countingstrategy='pairedinsertion'"
- [readme] Scale to more than 10 million cells.: "Scale to more than 10 million cells."
- [readme] Blazingly fast preprocessing tools for BAM to fragment files conversion and count matrix generation.: "Blazingly fast preprocessing tools for BAM to fragment files conversion and count matrix generation."
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: HolobiomicsLab
- Source: HolobiomicsLab/asb-skill-collections
- License: Apache-2.0
- Homepage: https://holobiomicslab.cnrs.fr
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.