/cellxgene-context
Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger
$ npx -y skills add ammawla/encode-toolkit --skill cellxgene-context --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/cellxgene-context
Context preview
The summary Claude sees to decide when to auto-load this skill.
Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger
SKILL.md
cellxgene-context.SKILL.mdname: cellxgene-context
description: "Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger on: CellxGene, single-cell atlas, cell type expression, Census, cell type specificity, single-cell context, scRNA-seq atlas."
Integrating CellxGene Census Single-Cell Data with ENCODE Bulk Experiments
Bridge bulk ENCODE functional genomics data with cell-type-specific expression from the CellxGene Census, the largest unified single-cell RNA-seq atlas, to resolve cell-type contributions to regulatory element activity.
Scientific Rationale
**The question**: "Which specific cell types within my tissue drive the regulatory signals I see in bulk ENCODE data?"
ENCODE provides deeply sequenced bulk functional genomics (ChIP-seq, ATAC-seq, Hi-C) across hundreds of biosamples. But bulk data from a tissue like "pancreas" is a mixture of acinar cells (~80%), duct cells (~10%), endocrine cells (~5%), and others. An H3K27ac peak in bulk pancreas could be driven by any of these cell types. CellxGene Census provides cell-type-resolved expression data from 50M+ single-cell observations across thousands of datasets, enabling deconvolution of bulk ENCODE signals.
The Bulk-to-Single-Cell Bridge
| Bulk ENCODE Signal | Single-Cell Question | CellxGene Answer | |-------------------|---------------------|-----------------| | H3K27ac peak near INS gene in pancreas | Which cell type expresses INS? | Beta cells (>500 TPM), not acinar (<1 TPM) | | ATAC-seq peak in liver near ALB | Is this hepatocyte-specific? | Yes — ALB expressed only in hepatocytes | | Enhancer active in brain cortex | Neurons or glia? | CellxGene resolves excitatory neurons vs. astrocytes vs. oligodendrocytes | | Broad H3K27ac domain in blood | Which immune cell type? | Can distinguish T cells, B cells, monocytes, NK cells |
What CellxGene Census Provides
- **50M+ single-cell observations** from thousands of published datasets
- **Standardized cell ontology** (Cell Ontology terms) across all datasets
- **Unified gene expression** in a consistent format
- **Metadata**: tissue, disease status, sex, ethnicity, developmental stage
- **API access** via Python (`cellxgene-census`) or R (`cellxgene.census`)
- **No authentication required** for public data
Key Literature
- **Megill et al. 2021** "cellxgene: a performant, scalable exploration platform for high dimensional sparse matrices" (bioRxiv preprint). Describes the CellxGene platform architecture and exploration capabilities. [DOI: 10.1101/2021.04.05.438318](https://doi.org/10.1101/2021.04.05.438318)
- **CZ CELLxGENE Discover** (Chan Zuckerberg Initiative, 2023). CellxGene Census provides programmatic access to the entire CellxGene data corpus as a single unified dataset. [https://cellxgene.cziscience.com/](https://cellxgene.cziscience.com/)
- **Regev et al. 2017** "The Human Cell Atlas" (eLife, ~1,500 citations). The vision paper for comprehensive single-cell reference maps of all human cells. CellxGene Census is the largest realization of this vision. [DOI: 10.7554/eLife.27041](https://doi.org/10.7554/eLife.27041)
- **Tabula Sapiens Consortium 2022** "The Tabula Sapiens: A multiple-organ, single-cell transcriptomic atlas of humans" (Science, ~800 citations). Multi-organ human cell atlas contributing to CellxGene Census. [DOI: 10.1126/science.abl4896](https://doi.org/10.1126/science.abl4896)
- **ENCODE Project Consortium 2020** (Nature, ~1,656 citations). The bulk regulatory element catalog that CellxGene single-cell data contextualizes. [DOI: 10.1038/s41586-020-2493-4](https://doi.org/10.1038/s41586-020-2493-4)
When to Use This Skill
| Scenario | How CellxGene Helps | |---------|-------------------| | Bulk ENCODE peak near a gene — which cell type? | Query gene expression by cell type in matching tissue | | ENCODE enhancer active in tissue X — cell-type-specific? | Check if enhancer target gene is restricted to one cell type | | Choosing ENCODE cell line as proxy | Verify which primary cell type the cell line best represents | | Interpreting differential peaks between tissues | Determine if difference is due to cell-type composition | | Validating ENCODE scATAC-seq findings | Cross-reference with CellxGene scRNA-seq for same cell types | | Designing follow-up experiments | Identify which cell types to isolate for validation |
Python API Reference
Installation
pip install cellxgene-census
Requires Python 3.8+. The package uses TileDB-SOMA for efficient data access.
Core API Pattern
import cellxgene_census
# Open the Census (reads metadata, does not download all data)
with cellxgene_census.open_soma() as census:
# Access human data
human = census["census_data"]["homo_sapiens"]
# Query specific genes in specific tissues/cell types
# This is where filtering happens — be specific to control memoryStep 1: Identify the ENCODE Target Gene
Start from an ENCODE finding — a regulatory element near a gene of interest:
# Find enhancers in pancreas
encode_search_experiments(
assay_title="Histone ChIP-seq",
target="H3K27ac",
organ="pancreas",
biosample_type="tissue"
)
# Get peaks
encode_list_files(
experiment_accession="ENCSR...",
file_format="bed",
output_type="IDR thresholded peaks",
assembly="GRCh38"
)From peaks, identify the nearest gene(s). You need the gene symbol or Ensembl ID.
Step 2: Query CellxGene Census for Cell-Type Expression
Basic Gene Expression Query
import cellxgene_census
import pandas as pd
gene_symbol = "INS" # Insulin — example for pancreas
with cellxgene_census.open_soma() as census:
human = census["census_data"]["homo_sapiens"]
# Get expression for INS in pancreas tissue
# Use obs_value_filtRead more
name: cellxgene-context description: "Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger on: CellxGene, single-cell atlas, cell type expression, Census, cell type specificity, single-cell context, scRNA-seq atlas."
Integrating CellxGene Census Single-Cell Data with ENCODE Bulk Experiments
Bridge bulk ENCODE functional genomics data with cell-type-specific expression from the CellxGene Census, the largest unified single-cell RNA-seq atlas, to resolve cell-type contributions to regulatory element activity.
Scientific Rationale
**The question**: "Which specific cell types within my tissue drive the regulatory signals I see in bulk ENCODE data?"
ENCODE provides deeply sequenced bulk functional genomics (ChIP-seq, ATAC-seq, Hi-C) across hundreds of biosamples. But bulk data from a tissue like "pancreas" is a mixture of acinar cells (~80%), duct cells (~10%), endocrine cells (~5%), and others. An H3K27ac peak in bulk pancreas could be driven by any of these cell types. CellxGene Census provides cell-type-resolved expression data from 50M+ single-cell observations across thousands of datasets, enabling deconvolution of bulk ENCODE signals.
The Bulk-to-Single-Cell Bridge
| Bulk ENCODE Signal | Single-Cell Question | CellxGene Answer | |-------------------|---------------------|-----------------| | H3K27ac peak near INS gene in pancreas | Which cell type expresses INS? | Beta cells (>500 TPM), not acinar (<1 TPM) | | ATAC-seq peak in liver near ALB | Is this hepatocyte-specific? | Yes — ALB expressed only in hepatocytes | | Enhancer active in brain cortex | Neurons or glia? | CellxGene resolves excitatory neurons vs. astrocytes vs. oligodendrocytes | | Broad H3K27ac domain in blood | Which immune cell type? | Can distinguish T cells, B cells, monocytes, NK cells |
What CellxGene Census Provides
- **50M+ single-cell observations** from thousands of published datasets
- **Standardized cell ontology** (Cell Ontology terms) across all datasets
- **Unified gene expression** in a consistent format
- **Metadata**: tissue, disease status, sex, ethnicity, developmental stage
- **API access** via Python (`cellxgene-census`) or R (`cellxgene.census`)
- **No authentication required** for public data
Key Literature
- **Megill et al. 2021** "cellxgene: a performant, scalable exploration platform for high dimensional sparse matrices" (bioRxiv preprint). Describes the CellxGene platform architecture and exploration capabilities. [DOI: 10.1101/2021.04.05.438318](https://doi.org/10.1101/2021.04.05.438318)
- **CZ CELLxGENE Discover** (Chan Zuckerberg Initiative, 2023). CellxGene Census provides programmatic access to the entire CellxGene data corpus as a single unified dataset. [https://cellxgene.cziscience.com/](https://cellxgene.cziscience.com/)
- **Regev et al. 2017** "The Human Cell Atlas" (eLife, ~1,500 citations). The vision paper for comprehensive single-cell reference maps of all human cells. CellxGene Census is the largest realization of this vision. [DOI: 10.7554/eLife.27041](https://doi.org/10.7554/eLife.27041)
- **Tabula Sapiens Consortium 2022** "The Tabula Sapiens: A multiple-organ, single-cell transcriptomic atlas of humans" (Science, ~800 citations). Multi-organ human cell atlas contributing to CellxGene Census. [DOI: 10.1126/science.abl4896](https://doi.org/10.1126/science.abl4896)
- **ENCODE Project Consortium 2020** (Nature, ~1,656 citations). The bulk regulatory element catalog that CellxGene single-cell data contextualizes. [DOI: 10.1038/s41586-020-2493-4](https://doi.org/10.1038/s41586-020-2493-4)
When to Use This Skill
| Scenario | How CellxGene Helps | |---------|-------------------| | Bulk ENCODE peak near a gene — which cell type? | Query gene expression by cell type in matching tissue | | ENCODE enhancer active in tissue X — cell-type-specific? | Check if enhancer target gene is restricted to one cell type | | Choosing ENCODE cell line as proxy | Verify which primary cell type the cell line best represents | | Interpreting differential peaks between tissues | Determine if difference is due to cell-type composition | | Validating ENCODE scATAC-seq findings | Cross-reference with CellxGene scRNA-seq for same cell types | | Designing follow-up experiments | Identify which cell types to isolate for validation |
Python API Reference
Installation
pip install cellxgene-census
Requires Python 3.8+. The package uses TileDB-SOMA for efficient data access.
Core API Pattern
import cellxgene_census
# Open the Census (reads metadata, does not download all data)
with cellxgene_census.open_soma() as census:
# Access human data
human = census["census_data"]["homo_sapiens"]
# Query specific genes in specific tissues/cell types
# This is where filtering happens — be specific to control memoryStep 1: Identify the ENCODE Target Gene
Start from an ENCODE finding — a regulatory element near a gene of interest:
# Find enhancers in pancreas
encode_search_experiments(
assay_title="Histone ChIP-seq",
target="H3K27ac",
organ="pancreas",
biosample_type="tissue"
)
# Get peaks
encode_list_files(
experiment_accession="ENCSR...",
file_format="bed",
output_type="IDR thresholded peaks",
assembly="GRCh38"
)From peaks, identify the nearest gene(s). You need the gene symbol or Ensembl ID.
Step 2: Query CellxGene Census for Cell-Type Expression
Basic Gene Expression Query
import cellxgene_census
import pandas as pd
gene_symbol = "INS" # Insulin — example for pancreas
with cellxgene_census.open_soma() as census:
human = census["census_data"]["homo_sapiens"]
# Get expression for INS in pancreas tissue
# Use obs_value_filtShowing the first part of this file.
Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.
Repo: ammawla/encode-toolkit
Other skills on encode-toolkit.
- /accessibility-aggregation
Build comprehensive chromatin accessibility maps by aggregating ATAC-seq and DNase-seq narrowPeak data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is chromatin accessible in my tissue?" by combining peak calls into a union peak
Open skill - /batch-analysis
Guide for multi-experiment batch operations: QC screening, batch download, comparison, and report generation across many ENCODE experiments simultaneously. Use when users need to process 5+ experiments together, create experiment comparison tables, perform batch quality checks,
Open skill - /bioinformatics-installer
Install bioinformatics tools for ENCODE data analysis. Covers CLI tools (BWA, STAR, samtools, MACS2), R/Bioconductor packages (DESeq2, Seurat, ChIPseeker), Python packages (Scanpy, deeptools), and Nextflow pipeline infrastructure. Generates conda environments, R install scripts,
Open skill - /cite-encode
Generate proper ENCODE citations for publications, grants, and presentations. Use when the user needs to cite ENCODE data, create bibliography entries, write acknowledgment sections, or ensure compliance with ENCODE data use policy.
Open skill - /clinvar-annotation
Guide for annotating ENCODE regulatory variants with ClinVar clinical significance. Use when users need to check if variants in ENCODE peaks have clinical associations, find pathogenic variants in regulatory regions, or assess variant clinical impact. Trigger on: ClinVar,
Open skill - /compare-biosamples
Compare ENCODE experiments across different biosamples, tissues, or cell lines to identify tissue-specific regulatory patterns. Use when the user wants cross-tissue comparison, cell-type comparison, tissue-specific elements, differential chromatin, biosample matching, disease vs
Open skill

