Skip to Content
Python APIIntroduction

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 c3d

This 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

PipelineModuleInputOutput
Bulk Hi-CHiCPipelinepaired FASTQ.cool, .mcool, TADs, loops, compartments
Single-nucleus Hi-CSnHiCPipelinelist of per-cell FASTQsper-cell .cool, pseudobulk .mcool
ChIA-PETChiaPetPipelinepaired FASTQ + linkerspeaks + significant loops
HiChIPHiChIPPipelinepaired FASTQ + fragment BEDpeaks + 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:

CategoryClasses
Alignment & SAM/BAMHiCAligner, HiCSamProcessor, PETMapperV3
Pairs / BEDPEHiCPairsProcessor
Contact matricesHiCMatrixGenerator
Linker filteringLinkerFilterV3
Peak callingPeakCaller
Fragment digest / purificationRestrictionSiteGenerator, FragmentIndex, purify_bedpe
Loop calling (statistical)classify_pets, extract_templates, BackgroundSamplingPhase1, calculate_pvalues, apply_fdr_corrections
Quality controlHiCQCAnalyzer
Data preparationFastqSplitter
Visualisation exportloops_to_beddb
QC / detectiondetect_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 None are marked optional.
  • Default values shown match the source code exactly.
  • All paths are strings; all thread/core counts are ints.

Entry points

Import patternExample
Top-levelimport chr3d as c3d; c3d.HiCPipeline(...)
Sub-packagefrom chr3d.hic import HiCPipeline
Utils functionfrom chr3d.utils import loops_to_beddb
Background modelfrom 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