chr3d API Reference
Chr3D is a Python framework for 3D chromatin interaction analysis. The package exposes a uniform top-level import — every pipeline, processing step, and utility is accessible from a single namespace.
import chr3d as c3dThis reference documents the stable public API of chr3d v3.2.0.
All classes and functions listed here are importable from chr3d or one of
its sub-packages (chr3d.hic, chr3d.peak_based, chr3d.utils).
Package layout
Pipelines at a glance
| Pipeline | Module | Input | Output |
|---|---|---|---|
| Bulk Hi-C | HiCPipeline | paired FASTQ | .cool, .mcool, TADs, loops, compartments |
| Single-nucleus Hi-C | SnHiCPipeline | list of per-cell FASTQs | per-cell .cool, pseudobulk .mcool |
| ChIA-PET | ChiaPetPipeline | paired FASTQ + linkers | peaks + significant loops |
| HiChIP | HiChIPPipeline | paired FASTQ + fragment BED | peaks + significant loops |
Low-level building blocks
Every pipeline is composed of standalone, modular step-classes that can be used independently when you need finer control than the orchestrators provide:
| Category | Classes |
|---|---|
| Alignment & SAM/BAM | HiCAligner, HiCSamProcessor, PETMapperV3 |
| Pairs / BEDPE | HiCPairsProcessor |
| Contact matrices | HiCMatrixGenerator |
| Linker filtering | LinkerFilterV3 |
| Peak calling | PeakCaller |
| Fragment digest / purification | RestrictionSiteGenerator, FragmentIndex, purify_bedpe |
| Loop calling (statistical) | classify_pets, extract_templates, BackgroundSamplingPhase1, calculate_pvalues, apply_fdr_corrections |
| Quality control | HiCQCAnalyzer |
| Data preparation | FastqSplitter |
| Visualisation export | loops_to_beddb |
| QC / detection | detect_restriction_enzyme |
Conventions used in this reference
- Every class signature is shown in the form
class chr3d.X(param1, param2=default, ...). - Every method signature is shown as
MethodName(param1, param2, ...) → ReturnType. - Parameters that accept
Noneare marked optional. - Default values shown match the source code exactly.
- All paths are strings; all thread/core counts are ints.
Entry points
| Import pattern | Example |
|---|---|
| Top-level | import chr3d as c3d; c3d.HiCPipeline(...) |
| Sub-package | from chr3d.hic import HiCPipeline |
| Utils function | from chr3d.utils import loops_to_beddb |
| Background model | from chr3d.peak_based.background_model import classify_pets |
For a CLI-based interface, see chr3d --help (entry point registered in
pyproject.toml).
Last updated on