uchrom.tl / uchrom.pp

Flat, scanpy-style aliases over the domain modules.

uchrom.tl — flat, scanpy-style aliases for analysis tools.

Tools add annotations (structures, features, embeddings) to a ChromData. The implementations live in the domain modules (uchrom.strc, uchrom.fea, …); these aliases only dispatch on method= and forward every other keyword unchanged, so they follow the same calling convention (chrom=None, params=, key_added=, copy=):

import uchrom as uc
uc.tl.call_tads(cd, method="arcfish")        # strc.tad.call_tads_by_pval
uc.tl.call_loops(cd)                         # strc.loop.call_loops_axiswise_f
uc.tl.call_compartments(cd)                  # strc.comp.call_compartments_axes_pc
uc.tl.call_compartments(cd, method="eig", contacts="bulk")   # a linked Hi-C map: cis eigenvector
uc.tl.call_tads(cd, method="insulation", contacts="bulk")    # insulation-score boundaries
uc.tl.call_loops(cd, method="hiccups", contacts="bulk")      # local-enrichment loops (HiCCUPS)
uc.tl.call_loops(cd, method="mustache", contacts="bulk")     # scale-space loops
uc.tl.pileup(cd, "loops.hiccups", contacts="bulk")           # APA of known loops (too shallow to call)
uc.tl.pseudobulk(cd, "cell_type")            # fea.pseudobulk: per-cell maps summed per group, linked
uc.tl.single_cell_compartments(cd, track=fasta)  # scA/B per cell (Tan 2021), from the per-cell maps
uc.tl.call_loops(cd, method="snaphic")       # loops across single cells (SnapHiC), imputed per cell
uc.tl.single_cell_boundaries(cd)             # boundaries per cell + consensus, imputed per cell
uc.tl.reconstruct_sc("cell.pairs")           # recon.sc.reconstruct_ember (EMber)
uc.tl.reconstruct_bulk(cd, contacts="bulk")  # recon.bulk.mds.reconstruct_mds (a linked bulk map)
uc.tl.embed_cells(cd, source="rna")          # emb.embed_cells
uc.tl.embed_higashi(cd)                      # emb.embed_higashi (FastHigashi on linked contact maps)
uc.tl.embed_contacts(cd)                     # emb.embed_contacts (scHiCluster on linked contact maps)
uc.tl.cluster_cells(cd, use="rna_pca")       # emb.cluster_cells
uchrom.tl.call_compartments(cd, *, method: str = 'axes_pc', **kwargs)[source]

Call A/B compartments. method: "axes_pc" (3-D distances) → uchrom.strc.comp.call_compartments_axes_pc(); on a linked Hi-C map "eig" (the cis eigenvector) → uchrom.strc.comp.call_compartments_eig() and "hic_pc1" (PC1 of the O/E correlation on uneven loci) → uchrom.strc.comp.call_compartments_hic().

uchrom.tl.call_loops(cd, *, method: str = 'axiswise_f', **kwargs)[source]

Call loops. method: "axiswise_f" (3-D distances) → uchrom.strc.loop.call_loops_axiswise_f(); on a linked Hi-C map "hiccups" (local enrichment) → uchrom.strc.loop.call_loops_hiccups() and "mustache" (scale space) → uchrom.strc.loop.call_loops_mustache(); from linked per-cell maps, across cells "snaphic" → uchrom.strc.loop.call_loops_snaphic().

uchrom.tl.call_tads(cd, *, method: str = 'arcfish', **kwargs)[source]

Call TADs / domains.

method: "arcfish" (alias "pval") → uchrom.strc.tad.call_tads_by_pval(); "fishnet" → uchrom.strc.tad.call_domains_fishnet(); on linked Hi-C maps "insulation" → uchrom.strc.tad.call_tads_insulation() and "di" → uchrom.strc.tad.call_tads_di().

uchrom.tl.cluster_cells(cd, **kwargs)[source]

Leiden clusters of an embedding -> uchrom.emb.cluster_cells().

uchrom.tl.compartment_strength(cd, **kwargs)[source]

Compartment strength from a saddle plot of a linked Hi-C map -> uchrom.strc.comp.compartment_strength().

uchrom.tl.embed_cells(cd, **kwargs)[source]

Embed cells from a per-cell matrix (RNA, IF, ATAC, …) -> uchrom.emb.embed_cells().

uchrom.tl.embed_contacts(cd, **kwargs)[source]

Embed cells by their linked single-cell Hi-C maps (scHiCluster) -> uchrom.emb.embed_contacts().

uchrom.tl.embed_higashi(cd, **kwargs)[source]

Embed cells by their linked single-cell Hi-C maps with FastHigashi -> uchrom.emb.embed_higashi().

uchrom.tl.pileup(cd, features, **kwargs)[source]

Aggregate a linked Hi-C map around known loops / boundaries (APA) -> uchrom.fea.pileup().

uchrom.tl.pseudobulk(cd, groupby=None, **kwargs)[source]

Sum the linked per-cell contact maps per cell group into linked pseudo-bulk maps -> uchrom.fea.pseudobulk().

uchrom.tl.reconstruct_bulk(cd, *, method: str = 'mds', **kwargs)[source]

3-D structure of a bulk Hi-C map linked to cd (contacts=<key>) -> new ChromData. method: "mds" -> uchrom.recon.bulk.mds.reconstruct_mds(); "gem_fish" (with fish=<tracing ChromData>, chrom=) -> uchrom.recon.fish.reconstruct_gem_fish(). A population of structures (IGM): uchrom.recon.bulk.deconv.deconvolve().

uchrom.tl.reconstruct_sc(contacts, *, method: str = 'ember', **kwargs)[source]

Single-cell Hi-C 3-D reconstruction -> new ChromData. method: "ember" -> uchrom.recon.sc.reconstruct_ember(); "nucdyn" -> uchrom.recon.sc.reconstruct_nucdyn().

uchrom.tl.single_cell_boundaries(cd, **kwargs)[source]

Domain boundaries of single cells (insulation of each cell’s imputed map) and their consensus -> uchrom.strc.tad.single_cell_boundaries().

uchrom.tl.single_cell_compartments(cd, **kwargs)[source]

Per-cell compartment values (scA/B: the mean CpG of each bin’s contact partners) from the linked per-cell maps -> uchrom.strc.comp.single_cell_compartments().

uchrom.pp — flat, scanpy-style aliases for preprocessing.

Preprocessing changes coordinates / spots (impute, align, normalise, rebin). The implementations live in the domain modules; these aliases forward to them:

import uchrom as uc
cd_imputed = uc.pp.impute(cd, method="snapfish")   # im.impute.impute_coordinates
traced = uc.pp.align_spots(detections)             # im.trace.align_spots (jie)
merged = uc.pp.merge_duplicate_spots(cd)           # im.merge_duplicate_spots
uchrom.pp.align_spots(spots, **kwargs)[source]

Link detections into traces (the jie aligner) — uchrom.im.trace.align_spots().

uchrom.pp.impute(cd, *, method: str = 'linear', **kwargs)[source]

Impute missing coordinates — uchrom.im.impute.impute_coordinates().

method: "linear", "cubic" or "snapfish". Returns the imputed ChromData (the input is not modified).

uchrom.pp.merge_duplicate_spots(cd, **kwargs)[source]

One spot per (trace, locus) — uchrom.im.merge_duplicate_spots().