This release is a pre-release and may not be stable for production use.
jukebox-hic
Lightweight Hi-C noise analysis toolkit for .hic (hicstraw) and cooler formats (.cool, .mcool, .scool).
Features
- Per-row noise estimates with optional subsampling simulations to gauge robustness.
- Configurable row filtering based on distance-normalized signal and window occupancy.
- Works with
.hic,.cool,.mcool, and.scoolinput matrices (SciPy-backed pipeline for cooler formats). - Whole-genome noise tracks at requested resolutions.
- Simple plotting helpers for comparing noise distributions (log-scaled histograms).
Installation
Default install — both backends (cooler + hicstraw):
pip install jukebox-hic
Single-backend profiles:
# cooler only (.cool / .mcool / .scool)
pip install "jukebox-hic[cooler]"
# hicstraw only (.hic)
pip install "jukebox-hic[straw]"
Windows users — known PyPI install error
hic-strawdoes not ship pre-built wheels for Windows on PyPI and may fail to compile from source. Ifpip install jukebox-hicerrors during the hicstraw build step, bypass the default install and use the cooler-only profile:pip install jukebox-hic --no-deps pip install numpy pandas statsmodels matplotlib scipy coolerTo process
.hicfiles on Windows, convert them first withhic2cooland use the cooler backend:pip install hic2cool hic2cool convert sample.hic sample.mcool --resolutions 10000 jukebox-hic sample-noise --hic sample.mcool --cooler_path /resolutions/10000 --res 10000 --out_dir outputs/
Command Line Usage
Sampled noise with subsampling summaries
jukebox-hic sample-noise \
--hic sample.cool \
--res 10000 \
--min_mean_score 0.9 \
--min_nonzero_frac 0.05 \
--subsample_ratios 1.0,0.75,0.5,0.25 \
--norm balance \
--out_dir outputs/10kb \
--seed 42 \
--profile outputs/10kb/profile.csv
Produces one <chrom>_<res>.bedgraph for the original map and a subsample_summary.tsv
table with mean/median/log noise, ACF, variability, and empty-bin ratios at each subsample.
Noise bedgraph (genome-wide)
jukebox-hic noise-bedgraph \
--hic sample.hic \
--res 5000,10000 \
--out_dir outputs/
# Add --cpu <N> to parallelize per (chrom, res) tasks
jukebox-hic noise-bedgraph \
--hic sample.hic \
--res 5000,10000 \
--out_dir outputs/ \
--cpu 4
# For .mcool/.scool inputs you can add: --cooler_path /resolutions/10000
Plotting
jukebox-hic plot \
--noise_bed outputs/chr1_10000_sampled.bedgraph \
--out_png noise_density.png
Build a blacklist from bedgraphs
jukebox-hic blacklist \
--input outputs/10kb/*.bedgraph \
--out blacklist.bed \
--top_quantile 0.95
This command removes any rows with NaN noise values and blacklists the top 5% most
noisy intervals by default. Provide --zscore_cutoff to supply an explicit z-score
threshold instead of using the percentile.
Python API
from jukebox_hic import noise_sampling
noise_sampling.compute_sampled_noise(
hic_path="sample.cool",
res=10_000,
sample_fraction=1.0,
min_mean_score=0.9,
min_nonzero_frac=0.05,
subsample_ratios=[1.0, 0.5, 0.25],
norm="balance",
out_dir="outputs",
seed=42,
)
Notes
- For
.mcool, the CLI selects the group matching--res(e.g./resolutions/10000). Provide--cooler_pathfor.scoolcell groups or custom URIs. --normacceptsnone,balance(cooler weights / KR for.hic), or a path to a bedgraph/vector defining custom bin weights.- All commands print a summary line with wall-clock time and memory usage; install the optional
profileextra for psutil-backed RSS reporting. --profilewrites per-chromosome runtime and memory metrics to a CSV for downstream plotting.--cpu <N>parallelizesnoise-bedgraphby(chromosome, resolution)tasks (default 1, capped at available cores).- Every CLI invocation now emits a
contacts_overview.tsvsummarizing per-chromosome totals at the coarsest resolution.
Backends
This project supports two I/O backends, both included in the default install:
| Install | Backend | Formats |
|---|---|---|
pip install jukebox-hic (default) |
cooler + hicstraw | .cool, .mcool, .scool, .hic |
pip install "jukebox-hic[cooler]" |
cooler only | .cool, .mcool, .scool |
pip install "jukebox-hic[straw]" |
hicstraw only | .hic |
Runtime guidance:
- If you pass a
.hicfile without hicstraw installed, the tool will suggestpip install "jukebox-hic[straw]". - If you pass a cooler-format file without
coolerinstalled, the tool will suggestpip install "jukebox-hic[cooler]". - The same
--cooler_pathargument selects resolution groups in.mcoolfiles and cell groups in.scoolfiles.
Changelog
v0.3.0
noise-bedgraphsubcommand — renamed fromfull-noisefor clarity. All existing flags are unchanged.- Region-filtered
--chrom_sizes— the chromosome sizes file now accepts optional region columns (cols 3+) instart:endorstart-endformat (0-based, half-open). When regions are present, only bins overlapping those regions are emitted. The noise window still extends up to--bindist_bpon each side of the region, with chromosome-end clamping applied as usual. A region smaller than one bin outputs the single overlapping bin. Regions that exceed the chromosome size produce a warning and are skipped; chromosomes with no valid regions are skipped entirely.# Example extended chrom_sizes file (TSV): # chrom size region1 region2 chr1 248956422 0:50000000 100000000:150000000 chr2 242193529 chrX 156040895 5000000-10000000 - Multi-mode blacklist output —
blacklistanddefault-runnow produce four output directories per run (density_only/,noise_only/,union/,intersection/) instead of a single file, enabling comparison of conservative and permissive thresholds. - Default transforms changed to
log1p— both--density_transformand--noise_transformnow default tolog1p(previouslynoneandsqrtrespectively).log1pis more robust to outlier bins (repeats, centromeres) that can skew elbow detection. - Both backends in default install —
pip install jukebox-hicnow includes bothcoolerandhic-straw. Single-backend profiles[cooler]and[straw]are available for constrained environments.
v0.2.4
- Initial public release.
Metadata
Release files for jukebox-hic 0.3.0b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jukebox_hic-0.3.0b0.tar.gz | 92.1 kB | Without provenance | Details for jukebox_hic-0.3.0b0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jukebox_hic-0.3.0b0-py3-none-any.whl | Python 3 | none | any | Details for jukebox_hic-0.3.0b0-py3-none-any.whl |
Total release size: 176.5 kB
Release files / jukebox_hic-0.3.0b0.tar.gz
| Download URL | jukebox_hic-0.3.0b0.tar.gz |
|---|---|
| Size | 92.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13c750d867e8aed59c3e2e12f3e7db503ece19b0e713451c839a9b4807b7aded
|
|
BLAKE2b-256 checksum How to use checksums |
5b395d5672e37ac5ee8fda7b1de98ac831e4d1a1f63ce0daf091894df39fcfe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / jukebox_hic-0.3.0b0-py3-none-any.whl
| Download URL | jukebox_hic-0.3.0b0-py3-none-any.whl |
|---|---|
| Size | 84.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ed765e402cd6f5a3f942b03af576d3d20c6e6fb234f1f49f3610685788aca44
|
|
BLAKE2b-256 checksum How to use checksums |
9fe0bd362189f5b0167e6fb01ff48dc3d2b7b48aff89e093c9daec478125341c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Security for jukebox-hic 0.3.0b0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.