Pure NumPy · No GPU required · No external Hi-C tools

3D Genome
Analysis Engine

Hi-C chromatin 3D organization analysis in pure NumPy/SciPy — TAD detection, A/B compartments, loop calling, and differential analysis. No cooler, no Juicer, no HiCExplorer.

5
analysis modules
0
external Hi-C tools
6
demo TADs
100%
Python / NumPy
01 · Modules

What can it do

Five analysis modules, each implemented from first principles in pure NumPy/SciPy.

⚖️

ICE Normalization

Iterative Correction and Eigenvector decomposition — removes GC content, mappability, and restriction site biases. Converges in ~20 iterations.

🧱

TAD Detection

Insulation score (Crane et al. 2015) + Directionality Index (Dixon et al. 2012). TAD boundaries = local minima of insulation score.

🧬

A/B Compartments

PC1 of O/E contact matrix via sklearn PCA. GC content-guided eigenvector orientation. Saddle plot for compartment interactions.

🔁

Loop Detection

HICCUPS-inspired: distance-decay background, donut neighborhood enrichment, Poisson p-value peak calling. Detects focal contact enrichments.

Differential TAD

Compare two Hi-C matrices (WT vs. KO, cell type A vs. B). Gained/lost boundaries, permutation significance testing, differential contact scores.

📊

Interactive Plots

6-panel Plotly visualization: Hi-C heatmap with TAD/loop overlays, insulation track, compartment track, distance-decay, saddle plot, summary table.

02 · Demo Results

Synthetic Hi-C · chr17 · 25kb bins

Demo run on 200 synthetic bins with 6 TADs, 4 loops, and A/B compartment structure. All algorithms from first principles — no external Hi-C libraries.

Insulation Score & TAD Boundaries
Z-scored · low = boundary · blue dashes = detected boundaries
A/B Compartment Eigenvector (PC1)
Red = A (active) · Blue = B (inactive) · chr17 25kb bins
Distance-Decay · Contact Frequency
Power law α ≈ −1.2 · mean contacts vs genomic distance
TAD Size Distribution
6 synthetic TADs · boundary strength overlay
03 · Pipeline

How it works

From raw Hi-C matrix to 3D genome organization in five stages.

1Load .cool / synthetic
2ICE Normalization
3TAD Detection
4A/B + Loops
5Visualize
# Full pipeline — one function call from hic_analysis import run_hic_analysis summary = run_hic_analysis( cool_path="data.mcool", chrom="chr17", resolution=25000, insulation_window=10, ) # Outputs: hic_analysis.html, insulation_scores.csv, # tad_boundaries.csv, ab_compartments.csv, # loops.csv, summary.json
04 · Install

Get started

Python 3.9+. NumPy + SciPy core. Optional: cooler for .cool file I/O.

# Core dependencies pip install numpy scipy pandas plotly scikit-learn # Optional: read .cool files pip install cooler # Run demo python -m hic_analysis # Analyze real data from hic_analysis import run_hic_analysis run_hic_analysis(cool_path="sample.mcool", chrom="chr17")
Python 3.9+ NumPy only (core) No GPU required No HiC libraries