uchrom.strc.comp

A/B compartment detection from chromatin-tracing data.

class uchrom.strc.comp.CompartmentCallerParams(n_clusters: 'int' = 2, min_bins: 'int' = 2, k_sigma: 'float' = 4.0, frac: 'float' = 0.1, random_state: 'int' = 0, a_cluster: 'Optional[int]' = None)[source]

Bases: object

a_cluster: int | None = None
frac: float = 0.1
k_sigma: float = 4.0
min_bins: int = 2
n_clusters: int = 2
random_state: int = 0
uchrom.strc.comp.call_compartments_axes_pc(cd, *args, chrom=None, trace_ids=None, cells=None, params: CompartmentCallerParams | None = None, device: str = 'auto', key_added: str | None = UNSET, copy: bool = False, verbose: bool = False, store=UNSET, result_key=UNSET)[source]

Call A/B compartments (ArcFISH axes-PC; chromatin tracing).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – 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 (CompartmentCallerParams, optional)

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

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

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

Returns:

One row per bin: chrom, start, end, bin_index, cluster, compartment, pc2 (bin_index counts within the chromosome).

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 "compartments".

class uchrom.strc.comp.axes_pc.CompartmentCallerParams(n_clusters: 'int' = 2, min_bins: 'int' = 2, k_sigma: 'float' = 4.0, frac: 'float' = 0.1, random_state: 'int' = 0, a_cluster: 'Optional[int]' = None)[source]

Bases: object

a_cluster: int | None = None
frac: float = 0.1
k_sigma: float = 4.0
min_bins: int = 2
n_clusters: int = 2
random_state: int = 0
uchrom.strc.comp.axes_pc.call_compartments_axes_pc(cd, *args, chrom=None, trace_ids=None, cells=None, params: CompartmentCallerParams | None = None, device: str = 'auto', key_added: str | None = UNSET, copy: bool = False, verbose: bool = False, store=UNSET, result_key=UNSET)[source]

Call A/B compartments (ArcFISH axes-PC; chromatin tracing).

Parameters:
  • cd (ChromData)

  • chrom (str, sequence of str, or None) – 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 (CompartmentCallerParams, optional)

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

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

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

Returns:

One row per bin: chrom, start, end, bin_index, cluster, compartment, pc2 (bin_index counts within the chromosome).

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 "compartments".