Contact maps per cell¶
A cell’s contacts become a contact map — a sparse matrix of contact counts between genomic bins. The maps of
all cells are kept in one .scool (one cooler per cell), linked to the ChromData of the cells, not
copied into it; a pseudo-bulk map (all cells, or one cell type: pseudo-bulk maps) is a linked
.cool / .mcool. The ChromData then has cells (with their metadata and embeddings) and, until a
structure is computed, no spots.
import uchrom.datasets as ds
cd = ds.load("kim2020_scihic") # sci-Hi-C: 1,931 cells, cell types, per-cell 500 kb maps
cd.uns["linked_scool"]["per_cell"] # the link: path (relative to the store), bin size, assembly
one = cd.load_linked_scool(key="per_cell", cell=cd.cells.index[0]) # one cell's map, a cooler
path = cd.linked_scool_path("per_cell") # the .scool itself, for tools that read files
Task |
API |
|---|---|
read contact pairs: |
|
link per-cell maps / a pseudo-bulk map to the cells |
|
read them back |
|
link RNA / ATAC measured in the same cells |
|
ship a dataset as one store (atlas) |
|
spots of a section in the tissue (spatial Hi-C) |
|
In an atlas store the maps are embedded rather than linked; the same calls read them over HTTP, and
linked_scool_path(key, cells=...) exports the cells asked for once, one read per chromosome. Analyses
take the ChromData and the key of its maps — FastHigashi, the scHiCluster features, the
directionality index — rather than file paths. Linking, embedding and reading maps on a real store: the
.chromdata.zarr store tutorial.