The Cooler file format is a data model and Python library implementing a chunked, multidimensional array storage scheme based on HDF5, specifically designed for very large, sparse genomic interaction matrices such as Hi-C contact maps. It enables efficient, random access to arbitrary subsets of a matrix without loading the entire dataset into memory, a critical capability for deep learning pipelines that require on-the-fly sampling of genomic contacts.
Glossary
Cooler File Format

What is Cooler File Format?
A self-describing, chunked binary format for storing massive, sparse genomic interaction matrices, enabling performant random access and out-of-core computation.
By partitioning the genome into fixed-size bins and storing interaction counts in a sparse, hierarchical layout, Cooler supports out-of-core computation on datasets that far exceed available RAM. It enforces a strict, self-describing schema that includes genomic coordinate indexes, normalization vectors, and metadata, ensuring interoperability between tools like cooltools and HiGlass while serving as the canonical input format for training sequence-to-contact prediction models.
Key Features of the Cooler Format
Cooler is a chunked, sparse data format designed for storing massive genomic interaction matrices. It enables efficient random access and out-of-core computation, making it essential for deep learning pipelines that process Hi-C contact maps.
HDF5-Based Chunked Storage
Cooler stores sparse genomic interaction matrices in an HDF5 container using a chunked, columnar layout. This design allows for efficient random access to arbitrary sub-matrices without loading the entire dataset into memory. The chunking strategy partitions the genome into fixed-size bins, enabling out-of-core computation for datasets that exceed available RAM. Each chunk is independently compressed, balancing I/O throughput with storage efficiency.
Multi-Resolution Pixel Aggregation
Cooler supports multi-resolution contact matrices through a recursive pixel aggregation scheme. Starting from a base resolution (e.g., 1 kb), coarser resolutions are generated by summing contacts within larger bins. This hierarchical structure enables zoomable analysis, where users can query low-resolution genome-wide views or high-resolution locus-specific interactions. The aggregation preserves the sparse representation at each level, avoiding the storage explosion of dense matrices.
Range Queries and Strided Access
The format provides an API for range queries that retrieve contact frequencies between two genomic intervals. Using the matrix() method, users can extract sub-matrices by specifying chromosome coordinates and resolution. Strided access allows sampling every nth bin, useful for downsampling or generating training batches for deep learning models. The query engine leverages the chunk index to minimize disk reads, achieving sub-second retrieval for targeted regions.
Genome Assembly Anchoring
Cooler files are anchored to a reference genome assembly via an embedded chromosome table. This table maps chromosome names to their lengths and ordering, ensuring that matrix coordinates correspond to actual genomic positions. The anchoring enables cross-dataset comparisons by aligning contact maps from different experiments to the same coordinate system. It also supports assembly-aware normalization, where bin-level biases are stored alongside the interaction data.
Pixel Value Normalization Storage
Cooler stores both raw contact counts and normalized interaction frequencies in separate matrices within the same file. Normalization vectors, such as iterative correction weights or distance-expected values, are stored as 1D arrays alongside the 2D pixel data. This design allows users to toggle between raw and normalized views without recomputing corrections. The balanced matrix representation is critical for training deep learning models that require bias-corrected input features.
Streaming and Parallel I/O
The format supports streaming access for sequential processing of entire chromosomes, enabling memory-efficient training loops. Pixel data can be iterated in genomic order or matrix order, depending on the downstream algorithm. Cooler's HDF5 backend allows concurrent read access from multiple processes, facilitating parallel data loading in distributed training setups. Write operations are serialized to maintain data integrity during matrix construction.
Frequently Asked Questions
Clear answers to common technical questions about the Cooler file format for storing and querying massive genomic interaction matrices.
The Cooler file format is a self-describing, chunked, columnar binary storage specification designed for very large, sparse genomic interaction matrices such as Hi-C contact maps. It implements a hierarchical data structure built on top of HDF5, where the interaction matrix is partitioned into fixed-size square blocks (pixels) and stored in a B-tree index. This architecture enables O(log N) random access to any submatrix without loading the entire dataset into memory. The format stores both the interaction counts and associated bin tables (genomic coordinates) in a single .cool file, making it fully portable and self-contained. Cooler supports multi-resolution storage through its companion mcool format, which stacks multiple matrix resolutions within one HDF5 group hierarchy, allowing users to seamlessly switch between coarse and fine-grained views of chromatin interactions.
Cooler vs. Alternative Genomic Matrix Formats
Comparison of Cooler with alternative file formats for storing large, sparse genomic interaction matrices in deep learning pipelines.
| Feature | Cooler | HDF5/Hierarchical | Tabix-Indexed Text | Zarr |
|---|---|---|---|---|
Chunked random access | ||||
Native sparse storage | ||||
Multi-resolution support | ||||
Columnar compression | ||||
Genomic coordinate awareness | ||||
Out-of-core computation | ||||
Standardized schema for Hi-C | ||||
Typical storage footprint (10B contacts) | ~50 GB | ~200 GB | ~300 GB | ~60 GB |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Master the ecosystem of data structures, algorithms, and validation techniques that surround the Cooler file format in 3D genome analysis pipelines.
Hi-C Contact Map
The primary data payload stored within a Cooler file. A genome-wide matrix quantifying interaction frequencies between all pairs of genomic loci. Derived from chromosome conformation capture assays, this sparse matrix serves as the input for TAD calling, loop detection, and 3D reconstruction algorithms. Cooler's chunked layout is specifically optimized for the random access patterns required to query these matrices.
Stratum-Adjusted Correlation Coefficient (SCC)
The standard reproducibility metric for comparing Hi-C contact maps stored in Cooler format. Unlike generic correlation coefficients, SCC accounts for the distance-dependent signal decay unique to chromatin interaction data. It measures similarity between two contact maps by stratifying interactions by genomic distance, providing a robust benchmark for evaluating sequence-to-contact prediction models like Akita.
Hi-C Data Normalization
A critical preprocessing step applied before storing data in a Cooler file. Systematic biases—GC content, mappability, and restriction fragment length—are corrected using methods like Iterative Correction and Eigenvector decomposition (ICE) or matrix balancing. Cooler stores both raw and normalized counts, enabling reproducible downstream analysis without re-computation.
Genomic Distance Normalization
A statistical correction applied to Hi-C contact maps to account for the expected background contact frequency decay as a function of linear genomic distance. This normalization is essential for identifying true chromatin loops and TADs from the interaction matrices stored in Cooler files, separating biological signal from the polymer physics of proximity ligation.
Insulation Score
A quantitative metric calculated directly from Cooler-stored Hi-C data to identify TAD boundaries. It measures the degree to which a genomic locus is insulated from interactions with neighboring regions. A sharp drop in the insulation score indicates a boundary element, often bound by CTCF, that demarcates the transition between self-interacting domains.
Micro-C
A high-resolution variant of chromosome conformation capture that uses micrococcal nuclease to fragment chromatin to the nucleosome level. The resulting contact maps, often stored in Cooler format, provide finer detail of 3D genome folding than standard Hi-C, resolving interactions at the scale of individual enhancer-promoter loops and revealing the fine-grained structure of TADs.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us