Skip to content

/hic-aggregation

Build comprehensive chromatin contact maps by aggregating Hi-C loop calls (BEDPE) across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "what regions are in 3D contact in my tissue?" by creating a union catalog of chromatin loops. Handles

From plugin
2994 skills7 agents10 commands
shell
$ npx -y skills add ammawla/encode-toolkit --skill hic-aggregation --agent claude-code

How 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/hic-aggregation
How auto-invocation works

Context preview

The summary Claude sees to decide when to auto-load this skill.

Build comprehensive chromatin contact maps by aggregating Hi-C loop calls (BEDPE) across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "what regions are in 3D contact in my tissue?" by creating a union catalog of chromatin loops. Handles

SKILL.md

hic-aggregation.SKILL.md
name: hic-aggregation
description: Build comprehensive chromatin contact maps by aggregating Hi-C loop calls (BEDPE) across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "what regions are in 3D contact in my tissue?" by creating a union catalog of chromatin loops. Handles resolution-aware anchor matching, cross-lab variation, and Hi-C-specific quality metrics.

Aggregate Hi-C Chromatin Contacts Across Studies

When to Use

  • User wants to build a comprehensive catalog of chromatin loops from multiple Hi-C experiments
  • User asks "what regions are in 3D contact in my tissue?" or "aggregate loop calls across donors"
  • User needs a union catalog of BEDPE loops with resolution-aware anchor matching
  • User wants to identify high-confidence loops supported by multiple experiments
  • Example queries: "aggregate Hi-C loops for K562", "combine chromatin contacts across labs", "find consensus TAD boundaries in liver"

Build a comprehensive catalog of chromatin loops for a tissue/cell type by merging BEDPE loop calls from multiple ENCODE Hi-C experiments.

Scientific Rationale

**The question**: "What regions are in 3D physical contact in my tissue?"

Like histone marks and accessibility, chromatin loops are a **detection question**. If a loop between Region A and Region B is detected in one donor but not another, the contact is still real — individual variation, sequencing depth, and computational resolution explain absence. We want the **union of all detected contacts**.

Key Concepts

**Hi-C data** measures pairwise chromatin interactions genome-wide. After processing:

  • **Contact matrix** (`.hic` file): Genome-wide interaction frequencies at multiple resolutions
  • **Loop calls** (BEDPE): Statistically significant point interactions (loops) identified by algorithms like HICCUPS or Juicer
  • **TAD boundaries**: Topologically associating domain boundaries
  • **Compartments**: A/B compartment assignments

**BEDPE format** (Paired-End BED):

chr1  start1  end1  chr2  start2  end2  name  score  strand1  strand2

Each row represents a contact between two genomic anchor regions.

Literature Support

  • **Loop Catalog** (Reyna et al. 2025, Nucleic Acids Research): Created a union catalog of 4.19M unique loops across 1,089 Hi-C datasets. Demonstrated that union approach captures tissue-specific and constitutive loops. Used resolution-aware merging at 5kb, 10kb, and 25kb bins.
  • **AQuA Tools** (Chakraborty et al. 2025): Toolkit for BEDPE intersection, union, and annotation. Handles paired-region arithmetic.
  • **mariner** (Flores et al. 2024, Bioinformatics): R/Bioconductor package for BEDPE manipulation including merging loops across experiments with configurable anchor tolerance.
  • **ENCODE Phase 3** (Gorkin et al. 2020, Nature, 301 citations): Integrated Hi-C data across tissues to define regulatory loops connecting enhancers to promoters.
  • **ENCODE Blacklist** (Amemiya et al. 2019, Scientific Reports, 1,372 citations): Problematic genomic regions to filter from loop anchors. [DOI](https://doi.org/10.1038/s41598-019-45839-z)
  • **Mustache** (Roayaei Ardakany et al. 2020, Genome Biology, 165 citations): Multi-scale loop caller that recovers more validated loops than HICCUPS. Different callers produce discordant loop sets.
  • **Wolff et al. 2022** (GigaScience): Benchmark showing loop callers intersect by **~50% at most** — critical context for why union approach is necessary.

Step 1: Find All Available Hi-C Data

encode_search_experiments(
    assay_title="Hi-C",
    organ="pancreas",           # user's tissue of interest
    biosample_type="tissue",
    limit=100
)

Present a summary to the user:

  • Total Hi-C experiments
  • Labs represented
  • Unique donors/biosamples
  • Resolution(s) available (check experiment metadata)

Use `encode_get_facets` to check availability:

encode_get_facets(assay_title="Hi-C", organ="pancreas")

**Note**: Hi-C data is computationally expensive to produce, so there are typically fewer experiments per tissue than ChIP-seq or ATAC-seq. Even 2-3 experiments can be valuable for union catalogs.

Step 2: Quality-Gate Each Experiment

encode_get_experiment(accession="ENCSR...")

Hi-C Quality Checks

  • Audit status: no ERROR flags
  • **Sequencing depth**: 400M+ valid read pairs for loop calling (ENCODE standard)
  • **Cis/trans ratio**: >60% cis contacts expected (low cis suggests noisy library)
  • **Hi-C-specific QC**: Library complexity, PCR duplicate rate
  • Has loop calls (BEDPE output) — not all Hi-C experiments have called loops
  • Resolution: at least 5-10kb resolution for loop detection

Include if:

  • Has BEDPE loop calls at consistent resolution
  • Passes ENCODE audit (no ERROR flags)
  • Adequate sequencing depth for loop resolution

Exclude if:

  • ERROR audit flags
  • Only contact matrices without loop calls
  • Very low sequencing depth (<200M valid pairs — insufficient for loop calling)

Track all included experiments:

encode_track_experiment(accession="ENCSR...")

Step 3: Download Loop Call Files

For each experiment, get BEDPE loop calls:

# Search for loop/interaction files
encode_list_files(
    experiment_accession="ENCSR...",
    file_format="bedpe",
    assembly="GRCh38"
)

# Also check for BED-formatted loop files
encode_list_files(
    experiment_accession="ENCSR...",
    output_type="chromatin interactions",
    assembly="GRCh38"
)

# Or contact domains
encode_list_files(
    experiment_accession="ENCSR...",
    output_type="contact domains",
    assembly="GRCh38"
)

**File selection priority:** 1. **Chromatin interactions** (loop calls from HICCUPS or similar) 2. **Contact domains** (TADs — different analysis, handle separately) 3. **Replicated loops** (if available)

Prefer `preferred_default=True` files when available.

encode_download_files(
    file_accessions=["ENCFF...", ...],
    download_dir="/path/to/data/hic_loops",
    organize_by="flat"
)
``
Read more
Read it on GitHub ↗

Showing the first part of this file.

Ships withencode-toolkit

Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.

Get the whole plugin, auto-invoked
Stats
29
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
AGPL-3.0
License
8d ago
Last commit
4mo ago
Created

Repo: ammawla/encode-toolkit

Other skills on encode-toolkit.