Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jaechang-hits/anndata-data-structure
Annotated matrices for single-cell genomics. Stores X with obs/var metadata, layers, embeddings (obsm/varm), graphs (obsp/varp), uns.
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
and 1 more in the full report
2 fixed20 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
I have raw single-cell count matrices along with cell metadata (sample and cell type) and gene metadata that I need to bundle into an AnnData object in Python. Before performing log-normalization on the main expression matrix, I want to store the unmodified counts in a dedicated layer. Additionally, I want to optimize memory footprint by ensuring the count array uses a sparse format, converting string metadata columns to categorical data types, and writing the final dataset to a compressed disk file. Please write a Python script that accomplishes this.
| Checked | Without skill | With skill |
|---|---|---|
| Calls `strings_to_categoricals()` on the dataset object before saving. | Missed | Passed |
| Stores unmodified count values in a layer before applying log-normalization to `X`. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
.h5ad or .zarr files for single-cell experimentsscanpy insteadscvi-tools insteadanndata, scipy, pandas, numpyscanpy (analysis), zarr (cloud storage), h5py (HDF5 backend)pip install "anndata>=0.10"
# Full ecosystem
pip install anndata scanpy zarr
import anndata as ad
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
counts = csr_matrix(np.random.poisson(0.5, (500, 2000)).astype(np.float32))
obs = pd.DataFrame({"cell_type": np.random.choice(["T", "B", "NK"], 500)},
test cases passed, vs 20 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.