Installation¶
U-Chrom needs Python ≥ 3.11. The packages are not on PyPI yet; install them from the repository:
git clone https://github.com/Nanguage/U-Chrom.git
cd U-Chrom
pip install -e packages/chromdata -e packages/uchrom # the data model + the analysis library
pip install -e packages/uchrom-browser # + the web browser
pip install ./packages/uchrom-recon # + the native reconstruction engine (needs Rust)
With uv, uv pip install -e "packages/uchrom[web,recon]" resolves the
sibling packages from their folders by itself.
The packages¶
Package (import) |
Folder |
What it is |
Needs |
|---|---|---|---|
|
|
the data model and the |
numpy, pandas, zarr, pyarrow |
|
|
the analysis library |
chromdata, PyTorch, scipy, scikit-learn, cooler, … |
|
|
the web browser |
chromdata, FastAPI, uvicorn |
|
|
native engine: NucDynamics, EMber, IGM (Rust; CPU and GPU) |
numpy (Rust to build) |
chromdata alone reads and writes stores (local or over HTTP) without the analysis library; the web
browser needs only chromdata.
Optional dependencies¶
Extra |
Installs |
Needed for |
|---|---|---|
|
uchrom-browser |
the web browser |
|
uchrom-recon |
NucDynamics, EMber, IGM ( |
|
hic-straw |
reading |
|
umap-learn |
UMAP in |
|
FastHigashi (from GitHub; needs NumPy < 2) / Higashi |
|
|
PyVista |
|
|
cooler, h5py |
linked / embedded contact maps |
|
anndata, mudata |
linked AnnData / MuData ( |
|
fsspec, aiohttp, s3fs |
stores over HTTP / S3 |
|
shapely, geopandas, spatialdata |
cell outlines as geometries, SpatialData links |
|
astropy |
PyHiM ECSV traces ( |
|
all of chromdata’s extras |
GPU acceleration¶
The structure callers, the distance features and MDS run on PyTorch (device="auto" picks CUDA
(float64), Apple MPS (float32) or the CPU). The native engine runs NucDynamics, EMber and IGM on
all CPU cores, or on the GPU through wgpu (Metal on macOS, Vulkan on Linux); device="auto" uses the
GPU when there is one. Everything works on the CPU.
Check the installation¶
import uchrom, chromdata
print(uchrom.__version__, chromdata.__version__)
from uchrom.recon.sc.nucdyn import native_available, engine_info
print(native_available() and engine_info())
python -m uchrom_browser --help
To work on U-Chrom itself (tests, docs, the frontend), see development.