cellxgene-census
Accesses large-scale single-cell transcriptomics data. It's useful for comparing genetic data across different tissues and diseases.
What it does
This agent allows you to programmatically access and analyze large amounts of single-cell and spatial transcriptomics data. It provides access to information about millions of cells, including metadata, gene expression, and spatial data, without needing to download everything.
When to use it
- ✓When you need information about millions of cells (like cell types, tissues, or diseases).
- ✓To train machine learning models using single-cell data.
- ✓To compare single-cell data across different organisms or diseases.
Example of what to ask your AI
“What are the cell types found in human brain tissue, according to the latest data?”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It works by connecting to a large database of transcriptomics data. You can ask specific questions to pull the data you need, such as filtering by cell type or disease, and the agent retrieves it for you.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add K-Dense-AI/scientific-agent-skills --skill cellxgene-censusOr download just the file:
curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/cellxgene-census/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
CZ CELLxGENE Census
Overview
The CZ CELLxGENE Census provides programmatic access to a comprehensive, versioned collection of standardized single-cell and spatial transcriptomics data from CZ CELLxGENE Discover. This skill enables efficient querying and analysis of public Census releases without downloading whole datasets first.
The Census includes:
- 217+ million total cells and 125+ million unique cells in the 2025-11-08 stable LTS release
- 1,845 datasets in the 2025-11-08 stable LTS release
- Human, mouse, marmoset, rhesus macaque, and chimpanzee data in the current schema
- Standardized metadata (cell types, tissues, diseases, donors)
- Raw gene expression matrices and source H5AD lookup/download helpers
- Pre-calculated summary counts, embeddings, and spatial data
- Integration with AnnData, Scanpy, TileDB-SOMA, TileDB-SOMA-ML, and other analysis tools
When to Use This Skill
This skill should be used when:
- Querying single-cell expression data by cell type, tissue, or disease
- Exploring available single-cell datasets and metadata
- Training machine learning models on single-cell data
- Performing large-scale cross-dataset analyses
- Integrating Census data with scanpy or other analysis frameworks
- Computing statistics across millions of cells
- Accessing pre-calculated embeddings or model predictions
Installation and Setup
Install the Census API:
uv pip install "cellxgene-census==1.18.0"
For spatial workflows:
uv pip install "cellxgene-census[spatial]==1.18.0"
For PyTorch model training, use TileDB-SOMA-ML. The old cellxgene_census.experimental.ml loaders are absent from 1.18.0:
uv pip install "cellxgene-census==1.18.0" tiledbsoma-ml
Core Workflow Patterns
Eight patterns, each with code, are in references/core_workflow_patterns.md:
- Opening the Census — always pin
census_versionso an analysis stays reproducible. - Exploring Census information — available datasets, cell counts, and summary tables.
- Querying expression data — small to medium scale into an
AnnData. - Large-scale queries — out-of-core processing when the slice will not fit in memory.
- Machine learning with PyTorch — TileDB-SOMA-ML data loaders.
- Spatial Census data — accessing spatial assays.
- Integration with Scanpy — handing a Census slice to a standard Scanpy workflow.
- Multi-dataset integration — combining datasets and handling batch effects.
Key Concepts and Best Practices
The examples pin the current LTS build 2025-11-08, verified through the live
release directory on 2026-09-30. The SDK and data release are separate versions.
Resolve stable once with get_census_version_description("stable")["release_build"]
and record that date; never silently switch builds midway through analysis.
Always Filter for Primary Data
Unless analyzing duplicates, always include is_primary_data == True in queries to avoid counting cells multiple times:
obs_value_filter="cell_type == 'B cell' and is_primary_data == True"
Specify Census Version for Reproducibility
Always specify the Census version in production analyses:
census = cellxgene_census.open_soma(census_version="2025-11-08")
Estimate Query Size Before Loading
For large queries, count the selected rows without loading every metadata column. Cell count alone is not a memory estimate: gene count, sparsity, dtype, layers, embeddings, and downstream dense copies also matter:
import tiledbsoma as soma
with census["census_data"]["homo_sapiens"].axis_query(
measurement_name="RNA",
obs_query=soma.AxisQuery(
value_filter="tissue_general == 'brain' and is_primary_data == True"
),
) as query:
print(f"Selected {query.n_obs:,} cells and {query.n_vars:,} genes")
# Query axes consume memory too; stream expression if the matrix will not fit.
Use tissue_general for Broader Groupings
The tissue_general field provides coarser categories than tissue, useful for cross-tissue analyses:
# Broader grouping
obs_value_filter="tissue_general == 'immune system'"
# Specific tissue
obs_value_filter="tissue == 'venous blood'"
Select Only Needed Columns
Minimize data transfer by specifying only required metadata columns:
obs_column_names=["cell_type", "tissue_general", "disease"] # Not all columns
…
FAQ
What is single-cell transcriptomics data?
It's data that shows which genes are active in individual cells. This helps scientists understand the function of different cell types.
What does 'programmatic access' mean?
It means you can use programming code to request and get data, rather than having to click through menus or download files manually.
Why is it important to specify the data version?
It ensures your analysis is reproducible. If the data is updated, your previous analysis will still work with the same data version you originally used.
Details
Original description by the author
Queries the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local singl
Popularity
- GitHub stars
- 51k
- Ranking position
- #1845
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
13c-metabolic-flux
Estimates metabolic fluxes using carbon-13 isotope tracing data. It is useful for analyzing cellular metabolism and biochemical pathways.
K-Dense-AI/scientific-agent-skills
adaptyv
Designs protein characterization experiments using the Adaptyv API. It helps estimate costs, submit sequences, and monitor lab results.
K-Dense-AI/scientific-agent-skills
aeon
Performs machine learning tasks on time series data. It is useful for classifying, forecasting, detecting anomalies, and finding patterns in sequential data.
K-Dense-AI/scientific-agent-skills
alphagenome
Looks up precomputed genomic effects for genetic variants. It provides scores and explanations to understand the impact of variants on the genome.
K-Dense-AI/scientific-agent-skills
Similar skills
data-throughput-accelerator
Makes your agent speed up the movement of large data volumes. It finds bottlenecks and ensures data is transferred quickly and correctly.
affaan-m/ECC
inventory-demand-planning
Helps your agent predict product demand in stores. It optimizes stock and plans when to run promotions to sell more.
affaan-m/ECC
market-research
Helps your agent conduct market research and competitive analysis. Provides summaries with source attribution.
affaan-m/ECC