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:
objectRuntime parameters for
call_loops_axiswise_f().Defaults mirror ArcFISH’s
LoopCaller.
- 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 containtrace_idinspots.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.resultskey (default"loops.axiswise_f");Nonedoes 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, memoryO(n_bins²)instead ofO(n_traces × n_bins²)). Default:Truefor a backedChromData. 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 (defaultuchrom.settings.memory_budget).memory_budget – Traces per batch (
"auto") and working-memory budget of the streaming path (defaultuchrom.settings.memory_budget).
- Returns:
One row per called loop summit (BEDPE-style
chrom1 … end2plusscore, 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 aDeprecationWarningand 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:
objectRuntime parameters for
call_loops_axiswise_f().Defaults mirror ArcFISH’s
LoopCaller.
- 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 containtrace_idinspots.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.resultskey (default"loops.axiswise_f");Nonedoes 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, memoryO(n_bins²)instead ofO(n_traces × n_bins²)). Default:Truefor a backedChromData. 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 (defaultuchrom.settings.memory_budget).memory_budget – Traces per batch (
"auto") and working-memory budget of the streaming path (defaultuchrom.settings.memory_budget).
- Returns:
One row per called loop summit (BEDPE-style
chrom1 … end2plusscore, 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 aDeprecationWarningand default to the 1.x key"loops".