This skill renders Hi-C contact data into honest, reproducible figures. The central decision is the colorscale: the same matrix under raw, ICE-balanced, or observed-over-expected (O/E) tells three different biological stories, and a reviewer-grade figure states its normalization, its color scale (LogNorm vs symmetric-diverging) with limits or clip percentile, and its bin resolution. It covers square and rotated-triangle matrix maps, virtual 4C profiles, APA/saddle/on-diagonal pileups, two-condition comparisons, NaN/white-stripe handling, and when to use interactive exploration (HiGlass) versus scripted-static publication tools (matplotlib/cooltools, pyGenomeTracks, FAN-C, CoolBox, plotgardener).
pip install cooler cooltools bioframe matplotlib
conda install -c bioconda hicexplorer pygenometracks
# Optional: pip install fanc coolbox coolpuppy # alternative plotting tools
A cooler must be balanced (cooler balance matrix.cool) before matrix(balance=True) returns anything but NaN. For interactive HiGlass, build a multiresolution tileset first (cooler zoomify --balance base.cool).
Tell your AI agent what you want to do: - "Plot my balanced Hi-C matrix for chr1:50-60Mb" - "Make an observed/expected map so compartments and loops are visible" - "Pile up my loop calls and report the APA score" - "Compare treatment vs control as a log2-ratio map" - "Build a virtual 4C profile from a viewpoint"
"I have a balanced .mcool. Plot chr2:30-40Mb at 10kb resolution with a fall colormap and LogNorm, set vmax to the 99th off-diagonal percentile, and render masked bins in light gray instead of white."
"Compartments don't show up on my balanced map. Compute the cis expected, plot log2(observed/expected) with coolwarm and symmetric limits, and tell me what resolution to use for the checkerboard."
"Make a rotated-triangle Hi-C panel with genes, a CTCF ChIP bigWig, and the insulation score stacked beneath it on a shared x-axis for chr1:50-60Mb. Pick a depth that covers a 2 Mb TAD."
"Pile up my 8,000 loop calls as an observed/expected APA, average over the loops, plot log2 with symmetric limits, and compute the center-to-corner APA score."
"Make a saddle plot to show compartment strength; remember to phase the eigenvector first."
"Compare KO vs WT Hi-C as a single log2-ratio map. Balance and depth-match both libraries first, use RdBu_r with white at no-change, and grey out the very-distal noisy bins."
"Extract a virtual 4C profile from chr1:55Mb on a log-y axis so the near-cis spike doesn't swamp the distal signal."
set_bad; never quantify on interpolated/imputed matrices.cooltools.pileup, average over axis=0, and report the APA/saddle score.vmin=-vmax) are mandatory on every divergent/ratio map, or zero drifts off white.depth silently truncates features larger than it.file.mcool::/resolutions/<bp> URI -- a bare .mcool gives empty or wrong-resolution output.