uchrom.strc.tad

class uchrom.strc.tad.DICallerParams(window: int = 50, smoothing_param: float = 0.1, min_size_frac: float = 0.05)[source]

Bases: object

Knobs of call_tads_di() (defaults = get_domains()).

min_size_frac: float = 0.05
smoothing_param: float = 0.1
window: int = 50
class uchrom.strc.tad.FISHnetParams(thresholds: ndarray | None = None, threshold_step: float | None = None, threshold_min: float | None = None, threshold_max: float | None = None, plateau_size: int = 4, window_size: int = 2, size_exclusion: int = 3, merge_tol: int = 3, n_louvain_runs: int = 20, resolution: float = 1.0, min_coverage: float = 0.6, max_thresholds: int = 200, impute: bool = True)[source]

Bases: object

Runtime parameters for call_domains_fishnet_trace().

Defaults follow Patel et al. 2025.

impute: bool = True
max_thresholds: int = 200
merge_tol: int = 3
min_coverage: float = 0.6
n_louvain_runs: int = 20
plateau_size: int = 4
resolution: float = 1.0
size_exclusion: int = 3
threshold_max: float | None = None
threshold_min: float | None = None
threshold_step: float | None = None
thresholds: ndarray | None = None
window_size: int = 2
class uchrom.strc.tad.InsulationParams(window_bp: int | None = None, ignore_diags: int | None = None, statistic: str = 'mean', min_frac_valid_pixels: float = 0.66, min_dist_bad_bin: int = 0, threshold: str | float = 'li', balance: bool = True)[source]

Bases: object

Knobs of insulation_score() and call_tads_insulation() (defaults: cooltools insulation).

Variables:
  • window_bp (int, optional) – Side of the diamond, bp (a multiple of the bin size). None: 100 kb in whole bins, at least 3 (20 bins at 5 kb, 10 at 10 kb, 4 at 25 kb, 3 at 50 kb) — the scale whose boundaries match the Rao 2014 Arrowhead domain edges best. On a map of variable-size bins the window is round(window_bp / median bin size) bins.

  • ignore_diags (int, optional) – Pixels closer to the diagonal than this (in bins) are left out. None: the ignore_diags the map was balanced with (bins/weight attributes), else 2.

  • statistic ({"mean", "sum"}) – "mean": sum over the valid pixels / n_valid_pixels (cooltools, Crane et al. 2015); "sum": the sum alone (masked pixels then lower the score).

  • min_frac_valid_pixels (float) – Bins whose diamond has fewer valid pixels than this fraction of a full diamond get no boundary strength (cooltools: 0.66).

  • min_dist_bad_bin (int) – Bins closer than this (in bins) to a masked bin get no score (0: keep all).

  • threshold ("li", "otsu" or float) – Rule for the boundary-strength cut, applied to all chromosomes of a call together: Li’s minimum cross-entropy threshold (default; as cooltools), Otsu’s threshold, or a fixed strength. The strengths are a long right tail of strong boundaries over many shallow noise minima, not two balanced classes: Otsu cuts high, Li lower — on Rao 2014 IMR90 / GM12878 (5-25 kb, 100 kb window) Li recovers 0.11-0.20 more of the Arrowhead domain edges at 0.01-0.12 less precision (higher F1 in every case).

  • balance (bool) – Use the balanced map (the cooler weight column); False / an unbalanced map: raw counts.

balance: bool = True
ignore_diags: int | None = None
min_dist_bad_bin: int = 0
min_frac_valid_pixels: float = 0.66
statistic: str = 'mean'
threshold: str | float = 'li'
window_bp: int | None = None
class uchrom.strc.tad.SingleCellBoundaryParams(rp: float = 0.05, window: int | str | None = 'auto', insulation_window: int | None = None, ignore_diags: int = 2, threshold: str | float = 'li', normalize: bool = False, consensus: str = 'insulation')[source]

Bases: object

Knobs of single_cell_boundaries().

Variables:
  • rp (float) – Restart probability of the imputation (SnapHiC’s 0.05).

  • window (int, "auto" or None) – Sliding window of the imputation, bp ("auto": SnapHiC2’s rule; None: whole chromosomes).

  • insulation_window (int, optional) – Side of the insulation diamond, bp; default that of InsulationParams (100 kb, at least 3 bins).

  • ignore_diags (int) – Diagonals left out of the diamond (2).

  • threshold ("li", "otsu" or float) – Boundary-strength cut per cell, and of the consensus.

  • normalize (bool) – Insulation of the per-diagonal z-scores (SnapHiC’s normalisation) instead of the RWR values.

  • consensus ({"insulation", "frequency"}) – Consensus boundaries from the minima of the cells’ mean insulation, or from the peaks of the boundary frequency.

consensus: str = 'insulation'
ignore_diags: int = 2
insulation_window: int | None = None
normalize: bool = False
rp: float = 0.05
threshold: str | float = 'li'
window: int | str | None = 'auto'
class uchrom.strc.tad.TADCallerParams(window_bp: float = 100000.0, fdr_cutoff: float = 0.1, method: str = 'pval', hierarchical: bool = True, min_tad_size: float = 0.0, max_levels: int | None = None, prominence: float | None = None, distance: int | None = None, k_sigma: float = 4.0, frac: float = 0.1)[source]

Bases: object

Runtime parameters for call_tads_by_pval() (ArcFISH’s TADCaller(method="pval") defaults).

method: "pval" (the arc p-value test) or "insulation" (Su et al. 2020; module docstring). window_bp (ArcFISH window): the loci within this distance on each side of a locus form its left and right segments; loci closer than window_bp / 2 to either end of the chromosome are not tested. hierarchical (ArcFISH tree), min_tad_size in bp. max_levels (U-Chrom): keep levels 0 .. max_levels - 1 only (None: all). prominence / distance: passed to find_peaks (the authors’ parameters of the insulation method; also applied to "pval", where the authors use none). k_sigma / frac: the outlier filter and LOWESS span of uchrom.fea.arc.filter_normalize().

Before U-Chrom 0.3 (2026-10) window_bp was the whole window (half on each side), level 1 was the finest partition with up to max_levels=4 partitions, boundaries were peaks of the combined p-value and the FDR was computed over the peaks only; results differ from the authors’ (docs/source/reference/changelog.md).

distance: int | None = None
fdr_cutoff: float = 0.1
frac: float = 0.1
hierarchical: bool = True
k_sigma: float = 4.0
max_levels: int | None = None
method: str = 'pval'
min_tad_size: float = 0.0
prominence: float | None = None
window_bp: float = 100000.0
uchrom.strc.tad.boundary_frequency(cd, domains: str | DataFrame = 'tads.fishnet') → DataFrame[source]

Per locus, the fraction of traces (alleles) with a domain boundary there — single-allele domain tables such as FISHnet’s.

Parameters:
  • cd (ChromData)

  • domains (str or DataFrame) – A key of cd.results (default "tads.fishnet") or a table with chrom, trace_id, start, end.

Returns:

One row per locus of the chromosomes in the table: bin_id, chrom, start, end, bin_index, n_traces (traces with domains on the chromosome) and frequency.

Return type:

DataFrame

uchrom.strc.tad.calc_directionality_index(contact_mat, window=50, device='auto')[source]

Calculate Directionality Index for each genomic bin.

uchrom.strc.tad.call_domains_fishnet(cd, *args, chrom=None, trace_ids=None, cells=None, params: FISHnetParams | None = None, key_added: str | None = UNSET, ensemble_key: str | None = UNSET, copy: bool = False, verbose: bool = False, max_traces: int | None = None, store=UNSET, result_key=UNSET)[source]

Run FISHnet on every trace of the selected chromosome(s).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – None (default) runs every chromosome and merges the tables.

  • trace_ids (sequence, optional) – Restrict to these traces / cells.

  • cells (sequence, optional) – Restrict to these traces / cells.

  • params (FISHnetParams, optional)

  • key_added (str or None) – cd.results key of the per-trace domain table (default "tads.fishnet"); None does not store.

  • ensemble_key (str, optional) – cd.results key of the ensemble domain mask (default f"{key_added}.ensemble"). Stored as a mapping {chrom: {"mask": (n_bins, n_bins) int64, "bin_ids": (n_bins, 2) int64 [start, end], "n_traces": int}}.

  • copy (bool) – True → return a new ChromData holding the results.

  • max_traces (int, optional) – Cap on the number of traces processed per chromosome (useful for previews — FISHnet is O(n_bins² · n_thresholds) per trace).

Notes

Each trace’s Louvain runs are seeded by trace_seed() (its id), so its domains do not depend on the row order or on the other traces selected.

Returns:

One row per (trace, domain): chrom, trace_id, domain_idx, start, end, start_bin, end_bin.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Notes

Deprecated 1.x forms (positional chrom, store=, result_key=) still work with a DeprecationWarning; they keep the 1.x keys "fishnet_domains" / "fishnet_ensemble" and the 1.x single-chromosome ensemble layout {"chrom", "mask", "bin_ids", "n_traces"}.

uchrom.strc.tad.call_domains_fishnet_trace(dist, params: FISHnetParams | None = None, seed_base: int | None = None, *, trace_id=None, chrom: str | None = None) → dict[source]

Run FISHnet on one allele: a pairwise distance matrix, or a trace of a ChromData.

Parameters:
  • dist (ndarray (n_bins, n_bins) or ChromData) – Symmetric pairwise distance matrix, NaN for missing spots; or a ChromData together with trace_id: the matrix is then built over every locus of the trace’s chromosome (cd.bins; NaN for loci the trace did not detect, a locus seen twice keeps its last spot).

  • params (FISHnetParams, optional) – Hyperparameters. Use defaults if None.

  • seed_base (int, optional) – Base seed of the Louvain runs (reproducibility). Default: 0 for a matrix; trace_seed() of the trace for a ChromData — the seed call_domains_fishnet() uses, so the result equals that trace’s rows there (when every locus of the chromosome was detected in the traces called there).

  • trace_id (optional) – The trace (with a ChromData).

  • chrom (str, optional) – Its chromosome, when the trace spans several.

Returns:

domains: list of (start, end_exclusive) bin indices per plateau; boundaries: sorted list of canonical boundary bin indices; domain_mask: (n_bins, n_bins) int — count of plateaus in which bins i and j fall in the same domain (0 if never); n_plateaus: number of plateaus detected; coverage: fraction of bins with ≥1 non-NaN distance. With a ChromData also distances (the matrix), loci (bin_id, chrom, start, end of its rows) and trace_id.

Return type:

dict

uchrom.strc.tad.call_tads_by_pval(cd, *args, chrom=None, trace_ids=None, cells=None, params: TADCallerParams | None = None, device: str = 'auto', key_added: str | None = UNSET, copy: bool = False, verbose: bool = False, streaming: bool | None = None, batch='auto', memory_budget=None, store=UNSET, result_key=UNSET)[source]

ArcFISH’s TAD caller (chromatin tracing; module docstring).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – Chromosome(s) to call. None (default) calls every chromosome with spots and merges the per-chromosome tables.

  • trace_ids (sequence, optional) – Restrict the population to these traces / cells.

  • cells (sequence, optional) – Restrict the population to these traces / cells.

  • params (TADCallerParams, optional)

  • device ('auto' | 'cpu' | 'cuda' | 'mps')

  • key_added (str or None) – cd.results key for the merged table (default "tads.arcfish"); None does not store.

  • copy (bool) – True → return a new ChromData with the result; cd is not modified.

  • streaming (bool, optional) – Compute the axis-variance cube by streaming over the traces (uchrom.fea.arc_stream.axis_cube_streaming(): exact medians per row band, memory O(n_bins²) instead of O(n_traces × n_bins²)). Default: True for a backed ChromData. Results equal the in-memory path up to floating-point rounding of the variance sums.

  • batch – Traces per batch ("auto") and working-memory budget of the streaming path (default uchrom.settings.memory_budget).

  • memory_budget – Traces per batch ("auto") and working-memory budget of the streaming path (default uchrom.settings.memory_budget).

Returns:

One row per domain (module docstring): chrom, start, end, level, start1, end1, start2, end2, stat1, stat2. Level 0 is the finest partition (every boundary); with params.hierarchical each further level is the domain merged by removing the next weakest boundary.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Notes

Deprecated 1.x forms still work with a DeprecationWarning: positional chrom, store= and result_key=. When any of them is used and key_added is not given, the result is stored under the 1.x key "tads".

uchrom.strc.tad.call_tads_di(cd, *, contacts='default', resolution: int | None = None, balance: bool = True, chrom=None, params: DICallerParams | None = None, device: str = 'auto', key_added: str | None = 'tads.di', copy: bool = False)[source]

Directionality-index TADs on a linked Hi-C contact matrix.

Parameters:
  • cd (ChromData) – Holds the link (cd.link_cool(path, key=...)) and receives the result.

  • contacts (str) – Key of cd.uns['linked_cool'] (default "default") or a path to a .cool / .mcool.

  • resolution (int, optional) – Required for .mcool; checked against a .cool’s bin size.

  • balance (bool) – Use the cooler weight column (falls back to raw counts, with a warning, when the file is not balanced).

  • chrom (str, sequence of str, or None) – None → the chromosomes of cd.spots that the cooler has, or every cooler chromosome when cd has no spots on any of them (e.g. Hi-C-only data).

  • params (DICallerParams, optional)

  • key_added (str or None) – cd.results key (default "tads.di"); None does not store.

  • copy (bool) – True → return a new ChromData holding the result.

Returns:

chrom, start, end, start_bin, end_bin — bin indices are per-chromosome, end_bin exclusive, exactly as returned by get_domains(). (The kernel’s last domain stops one bin short of the chromosome end; this is kept as is.)

Return type:

DataFrame (copy=False) or ChromData (copy=True)

uchrom.strc.tad.call_tads_insulation(cd, *, contacts=None, chrom=None, resolution: int | None = None, params: InsulationParams | None = None, key_added: str | None = 'tads.insulation', copy: bool = False)[source]

TAD boundaries and domains of a Hi-C map by the diamond insulation score.

Boundaries are the minima of the insulation score (Crane et al. 2015) whose boundary strength (the prominence of the minimum) passes Li’s minimum cross-entropy threshold, as cooltools insulation (Open2C et al. 2024) calls them; see insulation_score(). Domains are the stretches between consecutive boundaries (and from the first / to the last scored bin of a chromosome); a domain never spans window or more consecutive bins without a score (masked regions such as centromeres), so the boundaries of the domain table (uchrom.strc.tad.tad_boundaries()) are exactly the called ones.

Parameters:
  • cd (ChromData, path or cooler.Cooler) – Holds the map (cd.link_cool) and receives the result (a path / cooler: the domains are returned).

  • contacts (str, optional) – Key of the linked map (None: the only one) or the path of a map.

  • chrom (str, sequence of str, or None) – None: the chromosomes of cd’s spots that the map has, else every chromosome of the map.

  • resolution (int, optional) – The level of an .mcool.

  • params (InsulationParams, optional) – window_bp (default 100 kb in whole bins, at least 3), threshold (default "li"), …

  • key_added (str or None) – cd.results / cd.intervals key of the domains (default "tads.insulation"; None: not stored). Also stored: f"{key_added}.boundaries" (results + a peak interval table) and the per-bin track f"{key_added}.score" (insulation_score() columns of the window).

  • copy (bool) – True: return a copy of cd holding the result.

Returns:

The domains: chrom, start, end, start_bin, end_bin (map bins within the chromosome, end_bin exclusive; start is the start of the boundary bin, end the start of the next boundary bin) — the columns of call_tads_di(). The boundaries table has chrom, start, end (the boundary bin), bin_index, log2_insulation_score and boundary_strength.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

uchrom.strc.tad.compare_boundaries(cd, query: str | DataFrame, reference: str | DataFrame, *, tol: int = 1, level: int | None = None, contacts: str | None = None, resolution: int | None = None) → Dict[str, float][source]

How often the boundaries of query fall within tol loci of a boundary of reference, against what random loci would give.

Parameters:
  • cd (ChromData) – Its bins are the loci both tables are placed on (tad_boundaries()).

  • query (str or DataFrame) – Population domain tables (keys of cd.results or tables), e.g. DI TADs on Hi-C and ArcFISH TADs on the imaging of the same loci, or insulation TADs and a published domain list.

  • reference (str or DataFrame) – Population domain tables (keys of cd.results or tables), e.g. DI TADs on Hi-C and ArcFISH TADs on the imaging of the same loci, or insulation TADs and a published domain list.

  • tol (int) – Largest distance in loci (default 1: the same or a neighbouring locus).

  • level (int, optional) – Level of hierarchical tables (default the finest).

  • contacts (optional) – Place the boundaries on the bins of this linked contact map instead of cd.bins (tad_boundaries()); tol then counts map bins.

  • resolution (optional) – Place the boundaries on the bins of this linked contact map instead of cd.bins (tad_boundaries()); tol then counts map bins.

Returns:

n_query, n_reference (boundaries), fraction_near (of the query boundaries within tol loci of a reference boundary on the same chromosome), chance (the same fraction for every locus of the chromosomes with query boundaries) and enrichment (= fraction_near / chance).

Return type:

dict

uchrom.strc.tad.detect_tad_boundaries(di, min_size_frac=0.05)[source]

Detect TAD boundaries from sign changes (negative -> positive).

uchrom.strc.tad.get_domains(contact_mat, smoothing_param=0.1, min_size_frac=0.05, window=50, device='auto')[source]

Identify TADs: DI calculation -> smoothing -> boundary detection.

uchrom.strc.tad.insulation_score(cd, *, contacts=None, chrom=None, resolution: int | None = None, windows=None, params: InsulationParams | None = None, key_added: str | None = 'insulation', copy: bool = False)[source]

Diamond insulation score of a Hi-C map, with the boundary strength of its minima.

The insulation of Crane et al. (2015) as computed by cooltools insulation (Open2C et al. 2024): the mean balanced contact in the w x w diamond on the diagonal at each bin, over the diamond’s valid pixels (n_valid_pixels: both bins unmasked, separation >= ignore_diags), normalised by the chromosome median, log2. Every local minimum gets a boundary strength (its prominence; bins whose diamond is less than min_frac_valid_pixels valid are left out) and is_boundary marks the minima above the threshold (Li by default), computed over all chromosomes of the call.

Parameters:
  • cd (ChromData, path or cooler.Cooler) – Holds the map (cd.link_cool(path, key=...)) and receives the result; or the path of a .cool / .mcool, or an open cooler.Cooler (nothing is stored then).

  • contacts (str, optional) – Key of the linked map (None: the only one) or the path of a map.

  • chrom (str, sequence of str, or None) – None: the chromosomes of cd’s spots that the map has, else every chromosome of the map.

  • resolution (int, optional) – The level of an .mcool.

  • windows (int or sequence of int, optional) – Diamond sides in bp (multiples of the bin size); default (params.window_bp,) (100 kb in whole bins, at least 3).

  • params (InsulationParams, optional)

  • key_added (str or None) – cd.results key (default "insulation"; None: not stored). When stored, the log2 score of each window is also written on the loci of cd (the map bin holding each locus’ midpoint) as cd.bin_tracks[f"{key_added}.log2_{window}"], if cd has loci on these chromosomes.

  • copy (bool) – True: return a copy of cd holding the result.

Returns:

One row per bin of the map: chrom, start, end, bin_index (within the chromosome), is_bad_bin (masked by balancing) and per window W (bp) log2_insulation_score_W, n_valid_pixels_W, boundary_strength_W (NaN off the minima) and is_boundary_W — the columns of cooltools insulation.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

uchrom.strc.tad.load_tad_from_bed(bed_path)[source]

Load TAD regions from BED file.

uchrom.strc.tad.single_cell_boundaries(cd, *, contacts: str = 'per_cell', cells: Sequence | None = None, chrom: None | str | Sequence[str] = None, params: SingleCellBoundaryParams | None = None, per_cell: bool = False, key_added: str | None = 'tads.single_cell', copy: bool = False, backend: str | None = None, n_threads: int = 0, timing: dict | None = None)[source]

Domain boundaries of every cell from its imputed map (insulation), and their frequency across cells.

Parameters:
  • cd (ChromData) – With per-cell maps linked (cd.link_scool) or embedded in its atlas store.

  • contacts (str) – Key of the per-cell maps (or a .scool named by cell id).

  • cells (sequence, optional) – Cells (default: every cell of cd.cells).

  • chrom (str or sequence, optional) – Chromosomes (default: the autosomes of the maps).

  • params (SingleCellBoundaryParams, optional)

  • per_cell (bool) – Also store every cell’s boundaries (cd.results[key_added + ".cells"]: cell_id, chrom, start, end, strength).

  • key_added (str or None) – The per-bin table goes to cd.results[key_added], the consensus domains to cd.intervals[key_added + ".domains"] (None: nothing stored).

  • copy (bool) – Return a new ChromData holding the results.

  • backend – Of the imputation (uchrom.fea.impute_rwr.rwr_band()).

  • n_threads – Of the imputation (uchrom.fea.impute_rwr.rwr_band()).

  • timing (dict, optional) – Seconds per step.

Returns:

One row per bin: chrom, start, end, n_cells (cells scored), frequency (share of them with a boundary at the bin), insulation (mean log2 insulation score), strength (mean strength where a cell has a boundary), consensus_strength (prominence of the mean insulation’s minimum, or of the frequency’s peak) and consensus (above the threshold).

Return type:

DataFrame (copy=False) or ChromData (copy=True)

uchrom.strc.tad.tad_boundaries(cd, domains: str | DataFrame = 'tads.arcfish', *, level: int | None = None, contacts: str | None = None, resolution: int | None = None) → DataFrame[source]

The boundaries of a domain table, as loci of cd.

Parameters:
  • cd (ChromData) – Its bins are the loci the boundaries are placed on (or the bins of contacts).

  • domains (str or DataFrame) – A key of cd.results (default "tads.arcfish") or a table with chrom, start, end; with a trace_id column (FISHnet), boundaries per trace.

  • level (int, optional) – For hierarchical tables (a level column): the level to use; default the lowest (the finest: level 0 of uchrom.strc.tad.call_tads_by_pval()).

  • contacts (optional) – Key of a contact map linked to cd (and the level of an .mcool): its bins are the loci — for a ChromData that holds only Hi-C maps (bin_id is then the map’s bin index).

  • resolution (optional) – Key of a contact map linked to cd (and the level of an .mcool): its bins are the loci — for a ChromData that holds only Hi-C maps (bin_id is then the map’s bin index).

Returns:

One row per boundary: chrom, [trace_id], bin_index (the locus after the boundary, counted within the chromosome from 0), bin_id (cd.bins index) and start (its start, bp).

Return type:

DataFrame

uchrom.strc.tad.trace_seed(trace_id) → int[source]

Base seed of the Louvain runs of one trace: the CRC-32 of its id, so that an allele’s domains do not depend on the row order of the data or on which other alleles are called with it.

FISHnet (per-allele, graph-theory)

class uchrom.strc.tad.fishnet.FISHnetParams(thresholds: ndarray | None = None, threshold_step: float | None = None, threshold_min: float | None = None, threshold_max: float | None = None, plateau_size: int = 4, window_size: int = 2, size_exclusion: int = 3, merge_tol: int = 3, n_louvain_runs: int = 20, resolution: float = 1.0, min_coverage: float = 0.6, max_thresholds: int = 200, impute: bool = True)[source]

Bases: object

Runtime parameters for call_domains_fishnet_trace().

Defaults follow Patel et al. 2025.

impute: bool = True
max_thresholds: int = 200
merge_tol: int = 3
min_coverage: float = 0.6
n_louvain_runs: int = 20
plateau_size: int = 4
resolution: float = 1.0
size_exclusion: int = 3
threshold_max: float | None = None
threshold_min: float | None = None
threshold_step: float | None = None
thresholds: ndarray | None = None
window_size: int = 2
uchrom.strc.tad.fishnet.call_domains_fishnet(cd, *args, chrom=None, trace_ids=None, cells=None, params: FISHnetParams | None = None, key_added: str | None = UNSET, ensemble_key: str | None = UNSET, copy: bool = False, verbose: bool = False, max_traces: int | None = None, store=UNSET, result_key=UNSET)[source]

Run FISHnet on every trace of the selected chromosome(s).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – None (default) runs every chromosome and merges the tables.

  • trace_ids (sequence, optional) – Restrict to these traces / cells.

  • cells (sequence, optional) – Restrict to these traces / cells.

  • params (FISHnetParams, optional)

  • key_added (str or None) – cd.results key of the per-trace domain table (default "tads.fishnet"); None does not store.

  • ensemble_key (str, optional) – cd.results key of the ensemble domain mask (default f"{key_added}.ensemble"). Stored as a mapping {chrom: {"mask": (n_bins, n_bins) int64, "bin_ids": (n_bins, 2) int64 [start, end], "n_traces": int}}.

  • copy (bool) – True → return a new ChromData holding the results.

  • max_traces (int, optional) – Cap on the number of traces processed per chromosome (useful for previews — FISHnet is O(n_bins² · n_thresholds) per trace).

Notes

Each trace’s Louvain runs are seeded by trace_seed() (its id), so its domains do not depend on the row order or on the other traces selected.

Returns:

One row per (trace, domain): chrom, trace_id, domain_idx, start, end, start_bin, end_bin.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Notes

Deprecated 1.x forms (positional chrom, store=, result_key=) still work with a DeprecationWarning; they keep the 1.x keys "fishnet_domains" / "fishnet_ensemble" and the 1.x single-chromosome ensemble layout {"chrom", "mask", "bin_ids", "n_traces"}.

uchrom.strc.tad.fishnet.call_domains_fishnet_trace(dist, params: FISHnetParams | None = None, seed_base: int | None = None, *, trace_id=None, chrom: str | None = None) → dict[source]

Run FISHnet on one allele: a pairwise distance matrix, or a trace of a ChromData.

Parameters:
  • dist (ndarray (n_bins, n_bins) or ChromData) – Symmetric pairwise distance matrix, NaN for missing spots; or a ChromData together with trace_id: the matrix is then built over every locus of the trace’s chromosome (cd.bins; NaN for loci the trace did not detect, a locus seen twice keeps its last spot).

  • params (FISHnetParams, optional) – Hyperparameters. Use defaults if None.

  • seed_base (int, optional) – Base seed of the Louvain runs (reproducibility). Default: 0 for a matrix; trace_seed() of the trace for a ChromData — the seed call_domains_fishnet() uses, so the result equals that trace’s rows there (when every locus of the chromosome was detected in the traces called there).

  • trace_id (optional) – The trace (with a ChromData).

  • chrom (str, optional) – Its chromosome, when the trace spans several.

Returns:

domains: list of (start, end_exclusive) bin indices per plateau; boundaries: sorted list of canonical boundary bin indices; domain_mask: (n_bins, n_bins) int — count of plateaus in which bins i and j fall in the same domain (0 if never); n_plateaus: number of plateaus detected; coverage: fraction of bins with ≥1 non-NaN distance. With a ChromData also distances (the matrix), loci (bin_id, chrom, start, end of its rows) and trace_id.

Return type:

dict

F-test caller

class uchrom.strc.tad.arc_pval.TADCallerParams(window_bp: float = 100000.0, fdr_cutoff: float = 0.1, method: str = 'pval', hierarchical: bool = True, min_tad_size: float = 0.0, max_levels: int | None = None, prominence: float | None = None, distance: int | None = None, k_sigma: float = 4.0, frac: float = 0.1)[source]

Bases: object

Runtime parameters for call_tads_by_pval() (ArcFISH’s TADCaller(method="pval") defaults).

method: "pval" (the arc p-value test) or "insulation" (Su et al. 2020; module docstring). window_bp (ArcFISH window): the loci within this distance on each side of a locus form its left and right segments; loci closer than window_bp / 2 to either end of the chromosome are not tested. hierarchical (ArcFISH tree), min_tad_size in bp. max_levels (U-Chrom): keep levels 0 .. max_levels - 1 only (None: all). prominence / distance: passed to find_peaks (the authors’ parameters of the insulation method; also applied to "pval", where the authors use none). k_sigma / frac: the outlier filter and LOWESS span of uchrom.fea.arc.filter_normalize().

Before U-Chrom 0.3 (2026-10) window_bp was the whole window (half on each side), level 1 was the finest partition with up to max_levels=4 partitions, boundaries were peaks of the combined p-value and the FDR was computed over the peaks only; results differ from the authors’ (docs/source/reference/changelog.md).

distance: int | None = None
fdr_cutoff: float = 0.1
frac: float = 0.1
hierarchical: bool = True
k_sigma: float = 4.0
max_levels: int | None = None
method: str = 'pval'
min_tad_size: float = 0.0
prominence: float | None = None
window_bp: float = 100000.0
uchrom.strc.tad.arc_pval.call_tads_by_pval(cd, *args, chrom=None, trace_ids=None, cells=None, params: TADCallerParams | None = None, device: str = 'auto', key_added: str | None = UNSET, copy: bool = False, verbose: bool = False, streaming: bool | None = None, batch='auto', memory_budget=None, store=UNSET, result_key=UNSET)[source]

ArcFISH’s TAD caller (chromatin tracing; module docstring).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – Chromosome(s) to call. None (default) calls every chromosome with spots and merges the per-chromosome tables.

  • trace_ids (sequence, optional) – Restrict the population to these traces / cells.

  • cells (sequence, optional) – Restrict the population to these traces / cells.

  • params (TADCallerParams, optional)

  • device ('auto' | 'cpu' | 'cuda' | 'mps')

  • key_added (str or None) – cd.results key for the merged table (default "tads.arcfish"); None does not store.

  • copy (bool) – True → return a new ChromData with the result; cd is not modified.

  • streaming (bool, optional) – Compute the axis-variance cube by streaming over the traces (uchrom.fea.arc_stream.axis_cube_streaming(): exact medians per row band, memory O(n_bins²) instead of O(n_traces × n_bins²)). Default: True for a backed ChromData. Results equal the in-memory path up to floating-point rounding of the variance sums.

  • batch – Traces per batch ("auto") and working-memory budget of the streaming path (default uchrom.settings.memory_budget).

  • memory_budget – Traces per batch ("auto") and working-memory budget of the streaming path (default uchrom.settings.memory_budget).

Returns:

One row per domain (module docstring): chrom, start, end, level, start1, end1, start2, end2, stat1, stat2. Level 0 is the finest partition (every boundary); with params.hierarchical each further level is the domain merged by removing the next weakest boundary.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Notes

Deprecated 1.x forms still work with a DeprecationWarning: positional chrom, store= and result_key=. When any of them is used and key_added is not given, the result is stored under the 1.x key "tads".

Insulation score (Hi-C maps)

Boundaries and domains of a linked contact map by the diamond insulation score (Crane et al. 2015, in cooltools’ formulation).

class uchrom.strc.tad.insulation.InsulationParams(window_bp: int | None = None, ignore_diags: int | None = None, statistic: str = 'mean', min_frac_valid_pixels: float = 0.66, min_dist_bad_bin: int = 0, threshold: str | float = 'li', balance: bool = True)[source]

Bases: object

Knobs of insulation_score() and call_tads_insulation() (defaults: cooltools insulation).

Variables:
  • window_bp (int, optional) – Side of the diamond, bp (a multiple of the bin size). None: 100 kb in whole bins, at least 3 (20 bins at 5 kb, 10 at 10 kb, 4 at 25 kb, 3 at 50 kb) — the scale whose boundaries match the Rao 2014 Arrowhead domain edges best. On a map of variable-size bins the window is round(window_bp / median bin size) bins.

  • ignore_diags (int, optional) – Pixels closer to the diagonal than this (in bins) are left out. None: the ignore_diags the map was balanced with (bins/weight attributes), else 2.

  • statistic ({"mean", "sum"}) – "mean": sum over the valid pixels / n_valid_pixels (cooltools, Crane et al. 2015); "sum": the sum alone (masked pixels then lower the score).

  • min_frac_valid_pixels (float) – Bins whose diamond has fewer valid pixels than this fraction of a full diamond get no boundary strength (cooltools: 0.66).

  • min_dist_bad_bin (int) – Bins closer than this (in bins) to a masked bin get no score (0: keep all).

  • threshold ("li", "otsu" or float) – Rule for the boundary-strength cut, applied to all chromosomes of a call together: Li’s minimum cross-entropy threshold (default; as cooltools), Otsu’s threshold, or a fixed strength. The strengths are a long right tail of strong boundaries over many shallow noise minima, not two balanced classes: Otsu cuts high, Li lower — on Rao 2014 IMR90 / GM12878 (5-25 kb, 100 kb window) Li recovers 0.11-0.20 more of the Arrowhead domain edges at 0.01-0.12 less precision (higher F1 in every case).

  • balance (bool) – Use the balanced map (the cooler weight column); False / an unbalanced map: raw counts.

balance: bool = True
ignore_diags: int | None = None
min_dist_bad_bin: int = 0
min_frac_valid_pixels: float = 0.66
statistic: str = 'mean'
threshold: str | float = 'li'
window_bp: int | None = None
uchrom.strc.tad.insulation.call_tads_insulation(cd, *, contacts=None, chrom=None, resolution: int | None = None, params: InsulationParams | None = None, key_added: str | None = 'tads.insulation', copy: bool = False)[source]

TAD boundaries and domains of a Hi-C map by the diamond insulation score.

Boundaries are the minima of the insulation score (Crane et al. 2015) whose boundary strength (the prominence of the minimum) passes Li’s minimum cross-entropy threshold, as cooltools insulation (Open2C et al. 2024) calls them; see insulation_score(). Domains are the stretches between consecutive boundaries (and from the first / to the last scored bin of a chromosome); a domain never spans window or more consecutive bins without a score (masked regions such as centromeres), so the boundaries of the domain table (uchrom.strc.tad.tad_boundaries()) are exactly the called ones.

Parameters:
  • cd (ChromData, path or cooler.Cooler) – Holds the map (cd.link_cool) and receives the result (a path / cooler: the domains are returned).

  • contacts (str, optional) – Key of the linked map (None: the only one) or the path of a map.

  • chrom (str, sequence of str, or None) – None: the chromosomes of cd’s spots that the map has, else every chromosome of the map.

  • resolution (int, optional) – The level of an .mcool.

  • params (InsulationParams, optional) – window_bp (default 100 kb in whole bins, at least 3), threshold (default "li"), …

  • key_added (str or None) – cd.results / cd.intervals key of the domains (default "tads.insulation"; None: not stored). Also stored: f"{key_added}.boundaries" (results + a peak interval table) and the per-bin track f"{key_added}.score" (insulation_score() columns of the window).

  • copy (bool) – True: return a copy of cd holding the result.

Returns:

The domains: chrom, start, end, start_bin, end_bin (map bins within the chromosome, end_bin exclusive; start is the start of the boundary bin, end the start of the next boundary bin) — the columns of call_tads_di(). The boundaries table has chrom, start, end (the boundary bin), bin_index, log2_insulation_score and boundary_strength.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

uchrom.strc.tad.insulation.insulation_score(cd, *, contacts=None, chrom=None, resolution: int | None = None, windows=None, params: InsulationParams | None = None, key_added: str | None = 'insulation', copy: bool = False)[source]

Diamond insulation score of a Hi-C map, with the boundary strength of its minima.

The insulation of Crane et al. (2015) as computed by cooltools insulation (Open2C et al. 2024): the mean balanced contact in the w x w diamond on the diagonal at each bin, over the diamond’s valid pixels (n_valid_pixels: both bins unmasked, separation >= ignore_diags), normalised by the chromosome median, log2. Every local minimum gets a boundary strength (its prominence; bins whose diamond is less than min_frac_valid_pixels valid are left out) and is_boundary marks the minima above the threshold (Li by default), computed over all chromosomes of the call.

Parameters:
  • cd (ChromData, path or cooler.Cooler) – Holds the map (cd.link_cool(path, key=...)) and receives the result; or the path of a .cool / .mcool, or an open cooler.Cooler (nothing is stored then).

  • contacts (str, optional) – Key of the linked map (None: the only one) or the path of a map.

  • chrom (str, sequence of str, or None) – None: the chromosomes of cd’s spots that the map has, else every chromosome of the map.

  • resolution (int, optional) – The level of an .mcool.

  • windows (int or sequence of int, optional) – Diamond sides in bp (multiples of the bin size); default (params.window_bp,) (100 kb in whole bins, at least 3).

  • params (InsulationParams, optional)

  • key_added (str or None) – cd.results key (default "insulation"; None: not stored). When stored, the log2 score of each window is also written on the loci of cd (the map bin holding each locus’ midpoint) as cd.bin_tracks[f"{key_added}.log2_{window}"], if cd has loci on these chromosomes.

  • copy (bool) – True: return a copy of cd holding the result.

Returns:

One row per bin of the map: chrom, start, end, bin_index (within the chromosome), is_bad_bin (masked by balancing) and per window W (bp) log2_insulation_score_W, n_valid_pixels_W, boundary_strength_W (NaN off the minima) and is_boundary_W — the columns of cooltools insulation.

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Low-level kernels:

uchrom.strc.tad.insulation.diamond_sums(i: ndarray, j: ndarray, values: ndarray, n: int, window: int, ignore_diags: int = 0, chunk: int = 2000000) → Tuple[ndarray, ndarray][source]

Sum of values over the diamond of every bin, and the number of finite pixels in it.

Pixel (i, j) (i <= j) lies in the diamond of bins max(i, j - w + 1) .. min(j, i + w - 1) (a run when j - i <= 2 (w - 1)), so each pixel adds its value at the first bin of its run and removes it after the last one; a cumulative sum gives the diamond sums. Pixels with a non-finite value or separation < ignore_diags are left out.

Returns:

  • sums (ndarray (n,) float64) – 0 exactly where no pixel contributes.

  • nnz (ndarray (n,) int64) – The pixels that contribute (stored, finite) per diamond.

uchrom.strc.tad.insulation.n_valid_pixels(valid: ndarray, window: int, ignore_diags: int = 0) → ndarray[source]

The number of valid pixels in the window x window diamond of every bin.

The diamond of bin k holds the pixels (k - a, k + b), 0 <= a, b < window, inside the chromosome and with a + b >= ignore_diags; a pixel is valid when both its bins are. Counted as (valid bins in [k - w + 1, k]) * (valid bins in [k, k + w - 1]) minus the pairs closer than ignore_diags, so O(n * ignore_diags**2).

uchrom.strc.tad.insulation.full_diamond(window: int, ignore_diags: int = 0) → int[source]

Pixels of a diamond with every bin valid (window**2 minus the pairs closer than ignore_diags).

uchrom.strc.tad.insulation.boundary_strength(track: ndarray) → ndarray[source]

Prominence of every local minimum of track (NaN elsewhere), as cooltools find_boundaries.

NaN bins are skipped (a minimum is lower than its nearest finite neighbours). The prominence of a minimum is its depth below the higher of the two highest points between it and the nearest lower point on each side; a side with no lower point does not count; the deepest minimum is measured against the highest local maximum. (Topographic prominence of -track; the sides via scipy.signal.peak_prominences().)

uchrom.strc.tad.insulation.threshold_li(values: ndarray) → float[source]

Li’s iterative minimum cross-entropy threshold (Li & Tam 1998) of the finite values.

The threshold t is iterated as (m_b - m_f) / (ln m_b - ln m_f) from the mean, where m_b / m_f are the means below / above t (values shifted to start at 0), until it moves by less than half the smallest gap between distinct values — the float branch of skimage.filters.threshold_li.

uchrom.strc.tad.insulation.threshold_otsu(values: ndarray, nbins: int = 256) → float[source]

Otsu’s threshold (1979, IEEE Trans. Syst. Man Cybern. 9:62) of the finite values: the centre of the histogram bin (nbins over the range) that maximises the between-class variance.

Single cells: boundaries of imputed maps

The insulation score of each cell’s imputed map (random walk with restart), its boundaries and the consensus over the cells.

class uchrom.strc.tad.single_cell.SingleCellBoundaryParams(rp: float = 0.05, window: int | str | None = 'auto', insulation_window: int | None = None, ignore_diags: int = 2, threshold: str | float = 'li', normalize: bool = False, consensus: str = 'insulation')[source]

Bases: object

Knobs of single_cell_boundaries().

Variables:
  • rp (float) – Restart probability of the imputation (SnapHiC’s 0.05).

  • window (int, "auto" or None) – Sliding window of the imputation, bp ("auto": SnapHiC2’s rule; None: whole chromosomes).

  • insulation_window (int, optional) – Side of the insulation diamond, bp; default that of InsulationParams (100 kb, at least 3 bins).

  • ignore_diags (int) – Diagonals left out of the diamond (2).

  • threshold ("li", "otsu" or float) – Boundary-strength cut per cell, and of the consensus.

  • normalize (bool) – Insulation of the per-diagonal z-scores (SnapHiC’s normalisation) instead of the RWR values.

  • consensus ({"insulation", "frequency"}) – Consensus boundaries from the minima of the cells’ mean insulation, or from the peaks of the boundary frequency.

consensus: str = 'insulation'
ignore_diags: int = 2
insulation_window: int | None = None
normalize: bool = False
rp: float = 0.05
threshold: str | float = 'li'
window: int | str | None = 'auto'
uchrom.strc.tad.single_cell.single_cell_boundaries(cd, *, contacts: str = 'per_cell', cells: Sequence | None = None, chrom: None | str | Sequence[str] = None, params: SingleCellBoundaryParams | None = None, per_cell: bool = False, key_added: str | None = 'tads.single_cell', copy: bool = False, backend: str | None = None, n_threads: int = 0, timing: dict | None = None)[source]

Domain boundaries of every cell from its imputed map (insulation), and their frequency across cells.

Parameters:
  • cd (ChromData) – With per-cell maps linked (cd.link_scool) or embedded in its atlas store.

  • contacts (str) – Key of the per-cell maps (or a .scool named by cell id).

  • cells (sequence, optional) – Cells (default: every cell of cd.cells).

  • chrom (str or sequence, optional) – Chromosomes (default: the autosomes of the maps).

  • params (SingleCellBoundaryParams, optional)

  • per_cell (bool) – Also store every cell’s boundaries (cd.results[key_added + ".cells"]: cell_id, chrom, start, end, strength).

  • key_added (str or None) – The per-bin table goes to cd.results[key_added], the consensus domains to cd.intervals[key_added + ".domains"] (None: nothing stored).

  • copy (bool) – Return a new ChromData holding the results.

  • backend – Of the imputation (uchrom.fea.impute_rwr.rwr_band()).

  • n_threads – Of the imputation (uchrom.fea.impute_rwr.rwr_band()).

  • timing (dict, optional) – Seconds per step.

Returns:

One row per bin: chrom, start, end, n_cells (cells scored), frequency (share of them with a boundary at the bin), insulation (mean log2 insulation score), strength (mean strength where a cell has a boundary), consensus_strength (prominence of the mean insulation’s minimum, or of the frequency’s peak) and consensus (above the threshold).

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Directionality index

class uchrom.strc.tad.di_caller.DICallerParams(window: int = 50, smoothing_param: float = 0.1, min_size_frac: float = 0.05)[source]

Bases: object

Knobs of call_tads_di() (defaults = get_domains()).

min_size_frac: float = 0.05
smoothing_param: float = 0.1
window: int = 50
uchrom.strc.tad.di_caller.call_tads_di(cd, *, contacts='default', resolution: int | None = None, balance: bool = True, chrom=None, params: DICallerParams | None = None, device: str = 'auto', key_added: str | None = 'tads.di', copy: bool = False)[source]

Directionality-index TADs on a linked Hi-C contact matrix.

Parameters:
  • cd (ChromData) – Holds the link (cd.link_cool(path, key=...)) and receives the result.

  • contacts (str) – Key of cd.uns['linked_cool'] (default "default") or a path to a .cool / .mcool.

  • resolution (int, optional) – Required for .mcool; checked against a .cool’s bin size.

  • balance (bool) – Use the cooler weight column (falls back to raw counts, with a warning, when the file is not balanced).

  • chrom (str, sequence of str, or None) – None → the chromosomes of cd.spots that the cooler has, or every cooler chromosome when cd has no spots on any of them (e.g. Hi-C-only data).

  • params (DICallerParams, optional)

  • key_added (str or None) – cd.results key (default "tads.di"); None does not store.

  • copy (bool) – True → return a new ChromData holding the result.

Returns:

chrom, start, end, start_bin, end_bin — bin indices are per-chromosome, end_bin exclusive, exactly as returned by get_domains(). (The kernel’s last domain stops one bin short of the chromosome end; this is kept as is.)

Return type:

DataFrame (copy=False) or ChromData (copy=True)

Low-level kernels:

uchrom.strc.tad.di.calc_directionality_index(contact_mat, window=50, device='auto')[source]

Calculate Directionality Index for each genomic bin.

uchrom.strc.tad.di.detect_tad_boundaries(di, min_size_frac=0.05)[source]

Detect TAD boundaries from sign changes (negative -> positive).

uchrom.strc.tad.di.get_device(device='auto')[source]

Get appropriate torch device.

uchrom.strc.tad.di.get_domains(contact_mat, smoothing_param=0.1, min_size_frac=0.05, window=50, device='auto')[source]

Identify TADs: DI calculation -> smoothing -> boundary detection.

uchrom.strc.tad.di.get_dtype(device)[source]

MPS only supports float32.

uchrom.strc.tad.di.smooth_with_moving_average(signal, window_size)[source]

Apply moving average smoothing via 1D convolution.

uchrom.strc.tad.utils.load_tad_from_bed(bed_path)[source]

Load TAD regions from BED file.

uchrom.strc.tad.utils.tad_regions_to_bin_indices(regions, bins_df, chrom=None)[source]

Convert TAD genomic regions to bin indices.

Comparing boundaries

uchrom.strc.tad.compare.tad_boundaries(cd, domains: str | DataFrame = 'tads.arcfish', *, level: int | None = None, contacts: str | None = None, resolution: int | None = None) → DataFrame[source]

The boundaries of a domain table, as loci of cd.

Parameters:
  • cd (ChromData) – Its bins are the loci the boundaries are placed on (or the bins of contacts).

  • domains (str or DataFrame) – A key of cd.results (default "tads.arcfish") or a table with chrom, start, end; with a trace_id column (FISHnet), boundaries per trace.

  • level (int, optional) – For hierarchical tables (a level column): the level to use; default the lowest (the finest: level 0 of uchrom.strc.tad.call_tads_by_pval()).

  • contacts (optional) – Key of a contact map linked to cd (and the level of an .mcool): its bins are the loci — for a ChromData that holds only Hi-C maps (bin_id is then the map’s bin index).

  • resolution (optional) – Key of a contact map linked to cd (and the level of an .mcool): its bins are the loci — for a ChromData that holds only Hi-C maps (bin_id is then the map’s bin index).

Returns:

One row per boundary: chrom, [trace_id], bin_index (the locus after the boundary, counted within the chromosome from 0), bin_id (cd.bins index) and start (its start, bp).

Return type:

DataFrame

uchrom.strc.tad.compare.compare_boundaries(cd, query: str | DataFrame, reference: str | DataFrame, *, tol: int = 1, level: int | None = None, contacts: str | None = None, resolution: int | None = None) → Dict[str, float][source]

How often the boundaries of query fall within tol loci of a boundary of reference, against what random loci would give.

Parameters:
  • cd (ChromData) – Its bins are the loci both tables are placed on (tad_boundaries()).

  • query (str or DataFrame) – Population domain tables (keys of cd.results or tables), e.g. DI TADs on Hi-C and ArcFISH TADs on the imaging of the same loci, or insulation TADs and a published domain list.

  • reference (str or DataFrame) – Population domain tables (keys of cd.results or tables), e.g. DI TADs on Hi-C and ArcFISH TADs on the imaging of the same loci, or insulation TADs and a published domain list.

  • tol (int) – Largest distance in loci (default 1: the same or a neighbouring locus).

  • level (int, optional) – Level of hierarchical tables (default the finest).

  • contacts (optional) – Place the boundaries on the bins of this linked contact map instead of cd.bins (tad_boundaries()); tol then counts map bins.

  • resolution (optional) – Place the boundaries on the bins of this linked contact map instead of cd.bins (tad_boundaries()); tol then counts map bins.

Returns:

n_query, n_reference (boundaries), fraction_near (of the query boundaries within tol loci of a reference boundary on the same chromosome), chance (the same fraction for every locus of the chromosomes with query boundaries) and enrichment (= fraction_near / chance).

Return type:

dict

uchrom.strc.tad.compare.boundary_frequency(cd, domains: str | DataFrame = 'tads.fishnet') → DataFrame[source]

Per locus, the fraction of traces (alleles) with a domain boundary there — single-allele domain tables such as FISHnet’s.

Parameters:
  • cd (ChromData)

  • domains (str or DataFrame) – A key of cd.results (default "tads.fishnet") or a table with chrom, trace_id, start, end.

Returns:

One row per locus of the chromosomes in the table: bin_id, chrom, start, end, bin_index, n_traces (traces with domains on the chromosome) and frequency.

Return type:

DataFrame