Linked Multi-Omics

U-Chrom keeps ChromData focused on chromatin structure while allowing external modality files to be linked explicitly.

Use this pattern when a dataset contains cell-level matrices, raw single-cell Hi-C contacts, or inferred spatial coordinates that should not be forced into coords / spots.

UChromProject
├── ChromData (.h5cd)       measured or reconstructed 3D structure
├── MuData (.h5mu)          multi-modal single-cell matrices
├── scool (.scool)          raw single-cell Hi-C contact matrices
└── provenance / links      mapping matrices and coordinate semantics

Store the Mapping Matrix

The Tangram mapping matrix is the core evidence for projecting scHiCAR data into MERFISH space. Store it in MuData, not only in notes or plots.

Recommended layout:

mdata["schicar_rna"]              scHiCAR cells x genes
mdata["schicar_hic_features"]     scHiCAR cells x Hi-C-derived features
mdata["merfish"]                  MERFISH cells x genes or cell metadata
mdata["tangram_mapping"].X        MERFISH cells x scHiCAR cells
mdata.uns["tangram_mapping"]      method, source files, normalization, axis names

With the orientation above, MERFISH-space projection is:

merfish_feature = mdata["tangram_mapping"].X @ schicar_feature

If your Tangram output uses the opposite orientation, record that explicitly in mdata.uns["tangram_mapping"] and transpose before projection.

Store Cell-Level Spatial Coordinates

Tangram maps cells to tissue-space positions. Those positions describe cells, not genomic bins, so store them in cells (columns <key>_centroid_x / _y) with a record under uns["cell_spatial"] (schema in uchrom/core/spec.md):

cd.set_cell_positions(
    xy,  # shape: n_cells x 2 (or x 3)
    key="tangram_merfish",
    cell_ids=schicar_cell_ids,
    unit="um",
    frame="tissue",
    status="inferred",                  # inferred positions need a source
    source="MERFISH centroid",
    method="Tangram map_cells_to_space",
)
cd.cell_positions("tangram_merfish")    # x, y indexed by cell_id

Use this only when cd.cells is on the same cell axis as cell_ids. If cd.cells contains MERFISH cells but xy contains scHiCAR cells, keep the scHiCAR coordinates in the linked MuData/AnnData object instead and record that link from ChromData. (set_cell_spatial_coordinates() is the deprecated form of this call.)

Project Wrapper

For workflows with several linked files, use UChromProject:

from uchrom import UChromProject

project = UChromProject.from_chromdata("data.linked.h5cd")
project.link_mudata("schicar_mop.h5mu", key="schicar_mop")
project.link_scool("GSE305439_DNA_1Mb.scool", key="schicar_contacts")
project.validate()
project.describe()

The wrapper does not duplicate data. It centralizes links and validation.

Coordinate Semantics

Tangram or similar mapping methods can give single-cell assays inferred tissue-space positions. Mark these as inferred:

Tangram-inferred spatial coordinate

Do not label them as measured spatial coordinates unless the assay directly measured the cell position.