uchrom.strc.loop

class uchrom.strc.loop.LoopCallerParams(cut_lo: float = 100000.0, cut_up: float = 1000000.0, inner_cut: float = 25000.0, outer_cut: float = 50000.0, fdr_cutoff: float = 0.1, pval_cutoff: float = 1e-05, gap: float = 50000.0, k_sigma: float = 4.0, frac: float = 0.1, min_cluster_size: int = 1)[source]

Bases: object

Runtime parameters for call_loops_axiswise_f().

Defaults mirror ArcFISH’s LoopCaller.

cut_lo: float = 100000.0
cut_up: float = 1000000.0
fdr_cutoff: float = 0.1
frac: float = 0.1
gap: float = 50000.0
inner_cut: float = 25000.0
k_sigma: float = 4.0
min_cluster_size: int = 1
outer_cut: float = 50000.0
pval_cutoff: float = 1e-05
uchrom.strc.loop.call_loops_axiswise_f(cd, *args, chrom=None, trace_ids=None, cells=None, params: LoopCallerParams | 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-style axis-wise F-test loop caller (chromatin tracing).

Parameters:
  • cd (uchrom.ChromData) – Tracing data. Must contain trace_id in spots.

  • chrom (str, sequence of str, or None) – Chromosome(s) — matched against cd.spots['chrom']. None (default) calls every chromosome and merges the tables.

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

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

  • params (LoopCallerParams, optional) – Override any default.

  • device (str) – 'auto' | 'cpu' | 'cuda' | 'mps' — passed to GPU-friendly preprocessing.

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

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

  • 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 called loop summit (BEDPE-style chrom1 … end2 plus score, pval, fdr, cluster_size, contact_freq, summit_i, summit_j; the summit indices are per-chromosome bin indices).

Return type:

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

Notes

Deprecated 1.x forms (positional chrom, store=, result_key=) still work with a DeprecationWarning and default to the 1.x key "loops".

class uchrom.strc.loop.axiswise_f.LoopCallerParams(cut_lo: float = 100000.0, cut_up: float = 1000000.0, inner_cut: float = 25000.0, outer_cut: float = 50000.0, fdr_cutoff: float = 0.1, pval_cutoff: float = 1e-05, gap: float = 50000.0, k_sigma: float = 4.0, frac: float = 0.1, min_cluster_size: int = 1)[source]

Bases: object

Runtime parameters for call_loops_axiswise_f().

Defaults mirror ArcFISH’s LoopCaller.

cut_lo: float = 100000.0
cut_up: float = 1000000.0
fdr_cutoff: float = 0.1
frac: float = 0.1
gap: float = 50000.0
inner_cut: float = 25000.0
k_sigma: float = 4.0
min_cluster_size: int = 1
outer_cut: float = 50000.0
pval_cutoff: float = 1e-05
uchrom.strc.loop.axiswise_f.call_loops_axiswise_f(cd, *args, chrom=None, trace_ids=None, cells=None, params: LoopCallerParams | 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-style axis-wise F-test loop caller (chromatin tracing).

Parameters:
  • cd (uchrom.ChromData) – Tracing data. Must contain trace_id in spots.

  • chrom (str, sequence of str, or None) – Chromosome(s) — matched against cd.spots['chrom']. None (default) calls every chromosome and merges the tables.

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

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

  • params (LoopCallerParams, optional) – Override any default.

  • device (str) – 'auto' | 'cpu' | 'cuda' | 'mps' — passed to GPU-friendly preprocessing.

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

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

  • 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 called loop summit (BEDPE-style chrom1 … end2 plus score, pval, fdr, cluster_size, contact_freq, summit_i, summit_j; the summit indices are per-chromosome bin indices).

Return type:

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

Notes

Deprecated 1.x forms (positional chrom, store=, result_key=) still work with a DeprecationWarning and default to the 1.x key "loops".