nested-TAD-detection

This skill detects hierarchical (nested) TAD structures from Hi-C contact maps (in .cool or mcool format) using OnTAD, starting from multi-resolution .mcool files. It extracts a user-specified chromosome and resolution, converts the data to a dense matrix, runs OnTAD, and organizes TAD calls and logs for downstream 3D genome analysis.

181 stars

Best use case

nested-TAD-detection is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

This skill detects hierarchical (nested) TAD structures from Hi-C contact maps (in .cool or mcool format) using OnTAD, starting from multi-resolution .mcool files. It extracts a user-specified chromosome and resolution, converts the data to a dense matrix, runs OnTAD, and organizes TAD calls and logs for downstream 3D genome analysis.

Teams using nested-TAD-detection should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/31-toolbased-nested-tad-detection/SKILL.md --create-dirs "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/31-toolbased-nested-tad-detection/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/31-toolbased-nested-tad-detection/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nested-TAD-detection Compares

Feature / Agentnested-TAD-detectionStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

This skill detects hierarchical (nested) TAD structures from Hi-C contact maps (in .cool or mcool format) using OnTAD, starting from multi-resolution .mcool files. It extracts a user-specified chromosome and resolution, converts the data to a dense matrix, runs OnTAD, and organizes TAD calls and logs for downstream 3D genome analysis.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Nested TAD Detection from .mcool Using OnTAD

## Overview

This skill performs nested TAD (hierarchical TAD/subTAD) detection from Hi-C data using **OnTAD**, starting from a .mcool, .cool or .hic file.

Main steps include:

- Refer to the **Inputs & Outputs** section to verify required files and output structure.
- Inspect the `.mcool` file to list available resolutions and alway remember to confirm the chromosome name and analysis resolution with the user.
- Extract a **balanced or raw dense Hi-C matrix** for a selected chromosome and resolution from the `.mcool` file.
- Ensure matrix quality (symmetry, no all-zero rows/columns, reasonable contact decay).
- Run **OnTAD** to call TADs and nested TAD structures.
- Parse and standardize OnTAD output into BED-like tables and hierarchical annotation files.

---

## When to use this skill

Use this skill when you want to **identify TADs and nested sub-TADs** from high- or mid-resolution Hi-C data, especially when your contact maps are stored as **Cooler multi-resolution files (.mcool)** and you need **chromosome- and resolution-specific** OnTAD calls.

Typical biological questions / use-cases:

- Comparing **TAD hierarchy** between cell types (e.g., GM12878 vs K562) or conditions (control vs treated).
- Investigating whether **inner subTADs** are enriched for active regulatory elements, specific histone marks, or gene expression.
- Studying **boundary usage**, **boundary sharing**, or **hierarchical TAD levels** around key loci (e.g., HOX clusters, oncogenes).
- Integrating nested TAD structure with **ChIP-seq**, **ATAC-seq**, or **WGBS** to understand spatial regulatory architecture.

Data quality & replication assumptions:

- Hi-C experiments should have **sufficient depth** for the target resolution (e.g., ≥5–10 kb typically requires deep sequencing).
- Preferably, use **biological replicates** per condition and call TADs on either:
  - individual replicate matrices (and then merge/consensus), or  
  - replicate-merged matrices (if justified).
- The `.mcool` should be **properly normalized or at least QC’d** (ICE/balanced weights available if using `--balanced`).

---

## Inputs & Outputs

### Inputs

Required core inputs:

- **Hi-C matrix file**
  - Multi-resolution Cooler file (`.mcool`), e.g.:
    - `sample.mcool`
  - Or one-resolution Cooler file (`.cool`), e.g.:
    - `sample.cool`
  - Or Hi-C file (`.hic`), e.g.:
    - `sample.hic`
- **User-supplied parameters (must come from user feedback)**
  - Chromosome name: e.g., `chr1`, `chr2`, `chrX`
  - Resolution of interest: e.g., `10000`, `25000`, `40000` (in bp)
  - Chromosome length: e.g., 133275309
- **Software and environment**
  - `cooler` command-line utilities (or Python `cooler` module) available in `$PATH` or environment.
  - `OnTAD` installed and callable (e.g., `OnTAD` or `OnTAD_linux` command).
  - `python` (3.x) and basic scientific Python stack if using Python-based extraction.

Optional entry point:

- **Precomputed dense Hi-C matrix (OnTAD-ready)**
  - Plain text dense square matrix (no header), e.g. `proj_dir/matrices/chr17_25kb_dense.matrix`.  
  - If this is already present, you may **skip the `.mcool` → dense matrix conversion** and jump directly to OnTAD.

Operational rules for missing inputs:

- If `.mcool` or `.cool` or `.hic` file is missing:  
  `"sample.mcool not available, provide required files or skip and proceed ?"`
- If chromosome list not specified:  
  Ask the user explicitly rather than assuming default.
- If OnTAD executable is not found:  
  Ask user to install/locate OnTAD before proceeding.

---

### Outputs

Default output directory structure:

```bash
${sample}_nested_TAD_detection/
    matrices/
        ${chromosome}_${resolution}_dense.txt
        ${chromosome}_${resolution}_dense.log
    nested_TADs/
        ${chromosome}_${resolution}_OnTAD.tad
        ${chromosome}_${resolution}_OnTAD.bed
        ${chromosome}_${resolution}_OnTAD.log
```

---


## Allowed Tools

When using this skill, you should restrict yourself to the following MCP tools from server `cooler-tools`, `cooltools-tools`, `plot-hic-tools`, `project-init-tools`:
- `mcp__project-init-tools__project_init`
- `mcp__cooler-tools__list_mcool_resolutions`
- `mcp__cooler-tools__harmonize_chrom_names`
- `mcp__cooler-tools__dump_chroms`
- `mcp__cooler-tools__dump_dense_matrix`
- `mcp__OnTAD-tools__run_ontad`


Do NOT fall back to:

- raw shell commands (`OnTAD`, etc.)
- ad-hoc Python snippets (e.g. importing `cooler`, `bioframe`, `matplotlib` manually in the reply).

---


## Decision Tree

### Step 0 — Gather Required Information from the User

Before calling any tool, ask the user:

1. Sample name (`sample`): used as prefix and for the output directory `${sample}_nested_TAD_detection`.

2. Genome assembly (`genome`): e.g. `hg38`, `mm10`, `danRer11`.  
   - **Never** guess or auto-detect.

3. Hi-C matrix path/URI (`mcool_uri`):
   - `path/to/sample.mcool::/resolutions/25000` (.mcool file with resolution specified)
   - or `.cool` file path
   - or `.hic` file path

4. Resolution (`resolution`): default `25000` (100 kb).  
   - If user does not specify, use `25000` as default.
   - Must be the same as the resolution used for `${mcool_uri}`

---


### Step 1 — Initialize Project

1. Make director for this project:

Call:

- `mcp__project-init-tools__project_init`

with:

- `sample`: the user-provided sample name
- `task`: hic_matrix_qc

The tool will:

- Create `${sample}_nested_TAD_detection` directory.
- Return the full path of the `${sample}_nested_TAD_detection` directory, which will be used as `${proj_dir}`.

---

2. If the user provides a `.hic` file, convert it to `.mcool` file using `mcp__HiCExplorer-tools__hic_to_mcool` tool:

Call:
- `mcp__HiCExplorer-tools__hic_to_mcool`

with:
- `input_hic`: the user-provided path (e.g. `input.hic`)
- `sample`: the user-provided sample name
- `proj_dir`: directory to save the view file. In this skill, it is the full path of the `${sample}_nested_TAD_detection` directory returned by `mcp__project-init-tools__project_init`.

The tool will:
- Convert the `.hic` file to `.mcool` file.
- Return the path of the `.mcool` file.

If the conversion is successful, update `${mcool_uri}` to the path of the `.mcool` file.

---


### Step 2: List Available Resolutions in the .mcool file & Modify the Chromosome Names if Necessary

1. Check the resolutions in `mcool_uri`:

Call:

- `mcp__cooler-tools__list_mcool_resolutions`

with:

- `mcool_path`: the user-provided path (e.g. `input.mcool`) without resolution specified.

The tool will:

- List all resolutions in the .mcool file.
- Return the resolutions as a list.

If the user defined or default `${resolution}` is not found in the list, ask the user to specify the resolution again.
Else, use `${resolution}` for the following steps.

---

2. Check if the chromosome names in the .mcool file are started with "chr", and if not, modify them to start with "chr":

Call:

- `mcp__cooler-tools__harmonize_chrom_names`

with:
- `sample`: the user-provided sample name
- `proj_dir`: directory to save the expected-cis and eigs-cis files. In this skill, it is the full path of the `${sample}_Compartments_calling` directory returned by `mcp__project-init-tools__project_init`
- `mcool_uri`: cooler URI with resolution specified, e.g. `input.mcool::/resolutions/${resolution}`
- `resolution`: `${resolution}` must be the same as the resolution used for `${mcool_uri}` and must be an integer

The tool will:
- Check if the chromosome names in the .mcool file.
- If not, harmonize the chromosome names in the .mcool file.
- If the chromosome names are modified, return the path of the modified .mcool file under `${proj_dir}/` directory

---


### Step 3: Check chromosome length

Call:

- `mcp__cooler-tools__dump_chroms`

with:

- `mcool_uri`: cooler URI with resolution specified, e.g. `input.mcool::/resolutions/${resolution}`
- `resolution`: `${resolution}` must be the same as the resolution used for `${mcool_uri}` and must be an integer

The tool will:

- Return the chromosome name and length as a table.

---


### Step 4: Extract dense matrix from `.mcool`

Call:

- `mcp__cooler-tools__dump_dense_matrix`

with:

- `sample`: the user-provided sample name
- `proj_dir`: directory to save the view file. In this skill, it is the full path of the `${sample}_nested_TAD_detection` directory returned by `mcp__project-init-tools__project_init`.
- `mcool_uri`: cooler URI with resolution specified, e.g. `input.mcool::/resolutions/${resolution}`
- `resolution`: `${resolution}` must be the same as the resolution used for `${mcool_uri}` and must be an integer
- `chrom`: the user-provided chromosome name (e.g. `chr17`)
- `balanced`: whether to use balanced matrix (default: True)

The tool will:

- Extract the dense matrix from the .mcool file.
- Return the path of the dense matrix file.

---

### Step 5: Run OnTAD

Call:

- `mcp__OnTAD-tools__run_ontad`

with:

- `sample`: the user-provided sample name
- `proj_dir`: directory to save the view file. In this skill, it is the full path of the `${sample}_nested_TAD_detection` directory returned by `mcp__project-init-tools__project_init`.
- `dense_matrix`: the path to the dense matrix file (e.g. `${proj_dir}/matrices/chr17_25kb_dense.matrix`)
- `chrom`: the user-provided chromosome name (e.g. `chr17`)
- `chrom_length`: the corresponding chromosome length (e.g. 83257441) returned by `mcp__cooler-tools__dump_chroms` tool.
- `resolution`: the user-provided resolution (e.g. 25000)
- `penalty`: the penalty parameter for OnTAD (e.g. 0.1)
- `maxsz`: the maximum TAD size (in bins) (e.g. 200)

The tool will:
- Run OnTAD to call TADs and nested TAD structures.
- Return the path of the OnTAD output file (.tad, .bed, .log).

Related Skills

adb-screen-detection

181
from majiayu000/claude-skill-registry

Screen understanding with OCR and template matching for Android device automation

UMR-LMR-PMD-detection

181
from majiayu000/claude-skill-registry

This pipeline performs genome-wide segmentation of CpG methylation profiles to identify Unmethylated Regions (UMRs), Low-Methylated Regions (LMRs), and Partially Methylated Domains (PMDs) using whole-genome bisulfite sequencing (WGBS) methylation calls. The pipeline provides high-resolution enhancer-like LMRs, promoter-associated UMRs, and large-scale PMDs characteristic of reprogramming, aging, or cancer methylomes, enabling integration with chromatin accessibility, TF binding, and genome architecture analyses.

chrome-debug

159
from majiayu000/claude-skill-registry

This skill empowers AI agents to debug web applications and inspect browser behavior using the Chrome DevTools Protocol (CDP), offering both collaborative (headful) and automated (headless) modes.

Coding & DevelopmentClaude

ux

159
from majiayu000/claude-skill-registry

This AI agent skill provides comprehensive guidance for creating professional and insightful User Experience (UX) designs, covering user research, information architecture, interaction design, visual guidance, and usability evaluation. It aims to produce actionable, user-centered solutions that avoid generic AI aesthetics.

UX Design & StrategyClaude

thor-skills

159
from majiayu000/claude-skill-registry

An entry point and router for AI agents to manage various THOR-related cybersecurity tasks, including running scans, analyzing logs, troubleshooting, and maintenance.

SecurityClaude

ontopo

159
from majiayu000/claude-skill-registry

An AI agent skill to search for Israeli restaurants, check table availability, view menus, and retrieve booking links via the Ontopo platform, acting as an unofficial interface to its data.

General Utilities

whisper-transcribe

159
from majiayu000/claude-skill-registry

Transcribes audio and video files to text using OpenAI's Whisper CLI, enhanced with contextual grounding from local markdown files for improved accuracy.

Media Processing

lets-go-rss

159
from majiayu000/claude-skill-registry

A lightweight, full-platform RSS subscription manager that aggregates content from YouTube, Vimeo, Behance, Twitter/X, and Chinese platforms like Bilibili, Weibo, and Douyin, featuring deduplication and AI smart classification.

Content & Documentation

grail-miner

159
from majiayu000/claude-skill-registry

This skill assists in setting up, managing, and optimizing Grail miners on Bittensor Subnet 81, handling tasks like environment configuration, R2 storage, model checkpoint management, and performance tuning.

DevOps & Infrastructure

vly-money

159
from majiayu000/claude-skill-registry

Generate crypto payment links for supported tokens and networks, manage access to X402 payment-protected content, and provide direct access to the vly.money wallet interface.

Fintech & CryptoClaude

modal-deployment

159
from majiayu000/claude-skill-registry

Run Python code in the cloud with serverless containers, GPUs, and autoscaling using Modal. This skill enables agents to generate code for deploying ML models, running batch jobs, serving APIs, and scaling compute-intensive workloads.

DevOps & Infrastructure

tech-blog

159
from majiayu000/claude-skill-registry

Generates comprehensive technical blog posts, offering detailed explanations of system internals, architecture, and implementation, either through source code analysis or document-driven research.

Content & DocumentationClaude