Changelog¶
Unreleased¶
Multi-way contacts:
ChromData.clusters(.chromdata.zarrformat 2.4). SPRITE barcode clusters, Pore-C reads, ChIA-Drop GEMs — sets of genomic fragments observed together — are stored as they are, not only as pairs:cd.set_clusters(key, fragments, cluster=, cell=)/chromdata.ClusterTable.from_framebuild a table in compressed sparse rows (clusters sorted by cell and first fragment), with per-cell (per-spot) or bulk clusters, optional per-fragment and per-cluster columns.region(chrom, start, end)returns the fragments of a window with their cluster’s context (size, fragments and span on the chromosome, cell): what a cluster track draws, read from a per-chromosome locus index in one contiguous range (a fence of chunk starts finds it), so it works over HTTP;get_cell,members,select_cells,to_frame. Stored asclusters/<key>/(sharded Zarr, the layout of the embedded contact pixels); backed reads keep the tables on disk;chromdata.clusters.add_clustersadds one to an existing store; the streaming writer carries them. Format 2.4 = 2.3 + this optional part: 2.3 readers read 2.4 stores with a warning and ignore the clusters. Layout inpackages/chromdata/spec.md(Clusters).The web browser opens on a start page when no dataset is open, instead of empty views: example datasets of the atlas as cards with their thumbnails (one click opens one), the whole atlas and, on a local server, the server’s folders in the Open dialog, and the datasets opened before. The examples are the catalog’s new
featuredlist, else one dataset of each kind of data;/api/atlasalso returnsfigures, where the thumbnails are (the catalog’s newfigures_url, for the public atlas its web page).build_catalogcopiesfeaturedandfigures_urlfrom the atlas config.scHiCluster features as the authors compute them (behaviour change).
uchrom.emb.hic(schicluster_impute,schicluster_features,scool_cell_features,embed_contacts) now followsimpute_cpu/hicluster_cpuof the authors’schicluster1.3.2 (github.com/zhoujt1994/scHiCluster): `log2(counts1)
with the diagonal counted twice, the mean filter rounded as their code, the random walk on the column-normalised map without self-loops (the diagonal set to 1 only in empty columns),Q ← (1 − rp) I + rp Q Puntil the Frobenius change is below 1e-6 (at most 30 steps), alln²entries ofQbinarised per cell, and per chromosome the authors'int(0.2 · min(cells, bins²)) − 1PCs (n_per_chrom=None, formerly 20). The former code added self-loops, row-normalised, skipped the log, symmetrisedQand used the upper triangle only. Checked against the authors' code on the 5,313 scHiCAR cortex cells (benchmarks/schicluster_parity/): the binarised features of every cell and chromosome are identical and the imputed maps equal bit for bit; the kNN purity of the cell types in the embedding is the authors' to all digits (0.2402; 0.2433 before). The maps are imputed one per thread with single-threaded BLAS (n_threads`, default every CPU the process may use), as the authors’ process pool runs them: the 5,313 cells with 20 PCs per chromosome take 325 s on 16 threads (the authors’ code 289-304 s on 8 processes; the former code 827-864 s). With the authors’ number of PCs the per-chromosome PCA dominates.
scA/B: scHiCluster’s empty bins.
ScABParams(empty="own"): a bin without contacts takes its own CpG ratio, as scHiCluster’s compartment score (default"nan", as before).UCHROM_MEMORY_BUDGETsetschromdata.settings.memory_budgetfrom the environment (e.g. inside a container that hides the scheduler’s variables).Fix: embedded AnnData with anndata < 0.13 (Python 3.11).
embed_anndatawrote the copy in anndata’s default Zarr format, v2 before anndata 0.13, which the readers (Zarr v3) did not find; it now writes Zarr v3 whatever the version.chromdata[anndata]needs anndata >= 0.11 (the first to write Zarr v3).Fix:
load_linked_spatialdata(cells=)under pandas 3 raised “output array is read-only” when the link names a region (the cell mask was a read-only view under copy-on-write).The ArcFISH callers now give the authors’ results (behaviour change).
call_tads_by_pval,call_loops_axiswise_f,call_compartments_axes_pcand their preprocessing (uchrom.fea.arc,arc_stream) were re-implemented from the published algorithm and checked against the authors’ package (github.com/hyuyu104/ArcFISH at a21d889) on their tutorial data (Takei 2021 mESC chr6, Su 2020 chr2 p-arm) and on Takei 2025, Bintu 2018 and Su 2020 chr21: the same per-locus statistics, test matrices and calls (benchmarks/arcfish_parity/). The former implementation differed in ways that changed the calls: half windows on each side, boundaries at the peaks of the combined p-value with the FDR over the peaks only (about twice the authors’ boundaries), a background ring rounded to bins, axis weights from per-trace variances, the lower median, the last of a repeated spot, and A named as the more compact compartment (the opposite of the authors’ rule). What changes for callers:TADCallerParams.window_bpis the distance on each side of a locus (the authors’window); the domain table ischrom, start, end, level, start1, end1, start2, end2, stat1, stat2with level 0 the finest partition and one merged domain per higher level (formerly level 1 the finest, up tomax_levels=4partitions;max_levelsnow defaults to all levels); newmin_tad_size,arcfish_boundary_stats(the per-locus table).LoopCallerParams: the background in bp (inner_cut25 kb as the authors),contact_sep(25 kb) for the contact-frequency filter; loop rows addstat;arcfish_loop_matricesreturns the test matrices.CompartmentCallerParams:min_compartment_bp(bp, default 0) replacesmin_bins(deprecated),n_init=1; A = the less compact cluster unlessa_track/a_clustersay otherwise; per-arm calls (centromeres=) use the whole chromosome’s normalised variances and put a locus on the p arm when it ends at or before the centromere; new columnseig_x/y/z. Results recorded with the former callers (benchmarkscd2_callers_validation,hic_structuresArcFISH sections,sc_structurestracing callers) are kept as they were run.
Proximity by genomic separation, from contacts or coordinates.
uchrom.fea.separation_profile: per cell, the contacts at short (1-2 Mb) over long (19-54 Mb) separations of the linked per-cell maps, or the median 3-D distance of locus pairs at long over short separations of the traces, separations midpoint to midpoint in both (log2_short_long, higher when the short range is relatively closer);SeparationParams(edges=...)stores the whole profile per cell (cd.cellm["separation.profile"]). On seven atlas stores (84,778 cells and spots) it gives the cross-assay pilot’s counts for every cell, and on the Takei 2021 and Tan 2021 structure sets its pair counts and medians to float32 precision (benchmarks/cross_assay, which adds Liu et al. 2025’s DNA-MERFISH).Copy number from contacts.
uchrom.fea.chromosome_dosage: per cell or spatial Hi-C spot, log2 of each chromosome’s share of the contact legs over the median cell’s (per section withgroupby=), and optionally the profiles’ principal components (cd.cellm["contacts.dosage.pcs"]), covariates foruchrom.spatial.spatially_variable. The melanoma benchmark’s copy-number profiles are unchanged with it (benchmarks/spatial_variable, stage cnv: largest difference 6e-15).Structure calling from single cells.
uc.tl.call_loops(cd, method="snaphic")(uchrom.strc.loop.call_loops_snaphic, Yu et al. 2021): loops across cells, each cell’s map imputed by a random walk with restart (uchrom.fea.impute_rwr);uc.tl.single_cell_boundaries(insulation of each imputed map, consensus);uc.tl.single_cell_compartments(scA/B, Tan et al. 2021); the tracing callers on reconstructed structures (uchrom.io.read_3dg_cells;ds.load("tan2018_gm12878")holds the Dip-C structures;call_compartments_axes_pc(centromeres=)). New loadernagano2017_dip_serum. On the paper’s 742 mES cells SnapHiC recalls 0.60 of the bulk loops (paper 0.60) at precision 0.60 (0.66); on the same cells and contacts it gives the authors’ 479 loops. Docs: calling structures from single cells, tutorialsc_structures.Structure calling on Hi-C maps, implemented in U-Chrom (no cooltools / Mustache dependency): compartments by the cis eigenvector + saddle strength (
method="eig"), insulation domains (method="insulation"), HiCCUPS and Mustache loops, pileups (APA), pseudo-bulk maps of cell groups (uc.tl.pseudobulk,sample_cells_by_depth), banded reads of large maps (uchrom.fea.band),thin_map, Juicer list readers. Identical to cooltools where it is the reference (eigenvectors to 1e-14, insulation boundaries, HiCCUPS enriched pixels). Docs: calling structures from a map.uchrom-maps: native kernels (Rust, rayon; extrau-chrom[maps]) for HiCCUPS scoring, the Mustache scan and the single-cell imputation;uchromimports it lazily and keeps the numpy code as reference and fallback (BACKEND = "auto" | "native" | "numpy").Data:
uchrom.datasets.fetch(<atlas id>)downloads an atlas store’s one-file copy (.cdz) for offline work, whichloadthen reads;list_atlas()gives study, organism, tissue, assembly and sizes. A docs chapter on datasets and the atlas and a tutorial gallery.Licence: MIT (
LICENSE;uchrom-reconstays LGPL-3.0-or-later).A monorepo, and no data in it. The packages live in
packages/(chromdata,u-chrom,uchrom-browser,uchrom-discoveryand the native engineuchrom-recon, formerlyu-chrom-nucdyn/uchrom_nucdyn), the deployments inapps/(the atlas, the hosted web browser). The Qt desktop browser, the Taichi NucDynamics port and GEM are removed (the web browser and the native engine replace them; PyVista tubes are theplot3dextra).example-data/is gone:uchrom.datasets.atlas(id)opens a store of the public atlas over HTTP;uchrom.datasets.fetch(name)/python -m uchrom.datasets fetchdownloads an original file from its source (4DN, GEO, Zenodo, GitHub, UCSC; md5-checked) into$UCHROM_DATA, else~/.cache/uchrom— some are built on first fetch (Rao 2014 Hi-C slices read from the GEO.hicover HTTP, the first cells of a Takei 2025 field of view streamed from Zenodo); the recipes that build the atlas stores are inapps/atlas/recipes/; unit tests read small fixtures inpackages/*/tests/fixtures/. The tutorials read the atlas or fetch.chromdata.embedded.export_scoolreads each chromosome once for all the cells (was cell by cell; 2,000 scHiCAR cells from the atlas over HTTP: 21 s, identical pixels) and takestrans=False(intra-chromosomal contacts only)..h5cdis no longer a ChromData format.ChromData.read/write(and every loader, CLI and the browser built on them) refuse the HDF5.h5cdcontainer of format 1.x / 2.0 with aValueErrorthat names the converter;python -m uchrom.io.upgrade old.h5cd/uchrom.io.upgrade_h5cdconvert a file once (targets:.chromdata.zarr,.cdz; the--compression/--level/--compress-floatsoptions and.h5cdtargets are gone). The reader lives on in the privateuchrom.io._h5cd_legacy(also used by the format benchmarks). The in-repo Sox2 FISH examples are nowmESC_Sox2_5cells_*.chromdata.zarr.load_seqfish_multiomics_linked(h5cd_path=)is renamedcd_path=(the old name warns).Cell spatial position is first-class (
.chromdata.zarrformat 2.3). Centroids arecellscolumnscentroid_x,centroid_y[,centroid_z] with a recorduns['cell_spatial'][key](unit, frame fov / tissue / global,region_col,in_coords_frame, status measured / inferred, source, optional voxel size):cd.set_cell_positions(),cd.cell_positions(key, physical=). Optional outlinescd.cell_shapes[key](cell_id+ WKB polygons) are stored as GeoParquet (tables/cell_shapes/<key>.parquet, readable bygeopandas.read_parquet);cd.set_cell_shapes()needs no geometry library,cd.cell_shapes_geodataframe()needs shapely + geopandas (new extrau-chrom[spatial]).cd.link_spatialdata()records an external SpatialData store and its cell map (region/instance_key↔cell_id), checked byvalidate_links();cd.load_linked_spatialdata(cells=),cd.to_spatialdata()(extrau-chrom[spatialdata]). Loaders:read_seqfish_multiomicswritescentroid_x/y/z(voxels, per FOV; wasx_centroid…) and afovcells column;from_fofct(cell_table=)registersCent_ROI_x/y[/z]orcell_center_x_global / _y_global;from_fofct(mapping_table=)/to_fofct(mapping_table=)read / write the Cell/ROI Mapping table (ROI_Boundaries, OME polygons).set_cell_spatial_coordinates()is deprecated and now writes the schema (centroid_x, wasspatial_x); older columns stay readable throughcell_positions(). Format 2.3 = the 2.2 layout + these additive parts: 2.2 readers read 2.3 stores with a warning; 2.0–2.2 stores read unchanged. Real data (benchmarks/cell_spatial_validation.py): Takei 2025 cerebellum 1,799 / 1,799 cells, Takei 2021 201 / 201, Liu 2025 MOp 14,733 / 14,733, all equal to the source tables..chromdata.zarrformat 2.2 — every spot value stored once. Coordinates + keys in a chromosome-partitioned table (tables/coords/chrom=<name>/), every other spot-aligned column in cell-sorted primary tables without key columns (tables/primary/), and spot columns that are a function of the bin / cell / trace (probe names, sample ids) once per key (tables/derived/; exact round trip). Float columns use Parquet dictionary pages; the lossless decimal codec (chromdata.floatcodec) is opt-in (float_encoding=). Parallel full reads. Takei 2025 (1e7 spots, 62 tracks): 1.81 GB (2.1: 2.58 GB; flat Parquet: 2.11 GB), full read 0.57 s (2.1: 0.81 s; Parquet 0.76 s),get_cell8.5 ms (2.1: 25 ms),get_chrom(columns="coords")15 ms; Liu 2025 MOp 255 MB (2.1: 272 MB). Regression:get_chromwith spot tracks 0.53 s at 1e7 (2.1: 39 ms). In-memory row order is now cell › trace › chromosome › bin (iter_traces/iter_cellsstill stream chromosome › cell › trace). 2.0 / 2.1 stores stay readable;python -m uchrom.io.upgraderewrites them (keeping the original row order); the streaming writer andbenchmarks/fig2/replicate_store.pywrite 2.2..chromdata.zarrformat 2.1 — spot tables partitioned by chromosome.tables/spots/chrom=<name>/part-0.parquet(and the same forspot_tracksandlayers/<key>), sorted cell › trace › bin inside a partition, 16,384-row row groups (was 65,536);index/gainspartition_offsets/partition_groups/partition_chrom/cell_partitionand onecell_offsetsentry per (chromosome, cell). Backedget_chromreads one partition (Takei 2025, 1e7 spots: 0.77 s → 0.04 s; 1e8: 8.9 s → 0.49 s);get_cellreads one row group per chromosome and is slower (8 → 23 ms at 1e7; 22 → 42 ms at 1e8; withcolumns="coords"4.4 / 22 ms). Stores with many per-spot tracks grow (Takei: +35 %, the per-spot z-scores compress worse once a cell’s chromosomes are apart; no Parquet option recovers it —benchmarks/fig2/spot_tracks_encoding.py); Liu 2025 MOp shrinks 3 %. Full reads: 0.98 → 1.11 s at 1e7. Stored row order is now chromosome › cell › trace › bin, also for in-memoryiter_traces/iter_cells. 2.0 stores stay readable (in memory and backed); 2.0 readers cannot read 2.1 stores —python -m uchrom.io.upgrade old.chromdata.zarr new.chromdata.zarrrewrites them.Column selection:
get_cell/get_trace/get_chrom,iter_traces/iter_cells,to_memoryandChromData.readtakecolumns=/tracks=(columns="coords": coordinates and key columns only); the web browser reads geometry withcolumns="coords".iter_traces(chrom=...);batch="auto".Streaming (roadmap step 7):
uchrom.settings.memory_budget;ChromData.writer(path)(chromdata.stream.ChromDataWriter: append chunks, spill per chromosome, merge each partition in pieces within the budget — the store equals the in-memory writer’s);ChromData.from_fofct(..., out=...)(chunked) andread_seqfish_multiomics(..., out=...)(FOV by FOV) return the store backed.uchrom.fea.distance_map: exact per-chromosome median / mean distance maps streamed over the traces (median per row band; bitwise equal to the densemean_distance_matrix).call_loops_axiswise_fandcall_tads_by_pvaltakestreaming=(default on backed data;uchrom.fea.arc_stream.axis_cube_streaming): memoryO(n_bins²)instead ofO(n_traces × n_bins²), same calls..chromdata.zarr— the format 2.0 container (Zarr v3 + Parquet, the SpatialData approach) is the new default:cd.write("x.chromdata.zarr")(orx.cdz, the same store in one zip file). Spots are stored sorted by (cell, trace, bin) with anindex/of row offsets, so a round trip keeps every spot but may change the row order (ChromData.read(path, original_order=True)restores it). Backed mode:ChromData.read(path, backed=True)loads the small tables only;get_cell/get_trace/get_chromread the rows they need;iter_traces(batch)/iter_cells(batch)stream chunks (also on in-memory objects);to_memory()loads all..h5cdfiles (1.x and 2.0) are still read; writing.h5cdis deprecated (it warns).python -m uchrom.io.upgrade old.h5cdconverts toold.chromdata.zarr. The web browser opens stores backed; the example-data builders, tutorials and CLIs write the new format. Requires Python ≥ 3.11 and the new core dependencieszarr>=3andpyarrow.FOF-CT writer:
cd.to_fofct(path, cell_table=None, rna_table=None)anduchrom.io.write_fofctwrite the 4DN FOF-CT core table (with its##/#header lines, fromuns['fofct_header']oruns) and optionally the cell and RNA-spot companion tables — the inverse offrom_fofct.from_fofctnow parses floats exactly (float_precision="round_trip"; the default parser could be 1 ulp off), so FOF-CT round trips are value-identical.cd.resultsis now aResultsStoreofResultRecords: every result carries its kind, producing function, parameters, inputs, uchrom version and timestamp. Unwritable values raiseTypeErrorat assignment..h5cdformat 1.4 stores the provenance as attrs; older files still read.One calling convention for the structure callers (
call_tads_by_pval,call_domains_fishnet,call_loops_axiswise_f,call_compartments_axes_pc, newcall_tads_di): keyword-onlychrom=None(all chromosomes, one merged table),trace_ids,cells,params,key_added="<what>.<method>",copy. Positionalchrom,store=,result_key=andstrc.call_*_multiare deprecated (they warn and keep the 1.x keys).uchrom.tl/uchrom.ppalias namespaces..h5cdformat 2.0 — thebinslocus axis (breaking on disk; 1.x files still read).cd.bins(indexbin_id), requiredspots.bin_id(derived fromchrom/start/endby every constructor and loader), bin-levelcd.bin_tracksvs per-spotcd.spot_tracks,cd.binm, typedcd.intervals(domain | pair | peak | segment, withto_bins). Structure callers also fillcd.intervals; compartments add segments and a per-binpc2track.fea/strcfeature writers project onto bins (fea.project_interval_features_to_bins; the spot version is deprecated).cd.tracksis a deprecated spot-aligned view.uchrom.io.upgrade_h5cdandpython -m uchrom.io.upgraderewrite 1.x files; the web browser lists bin- and spot-level tracks and typed intervals. Large integer / string datasets are chunked and gzip-4 compressed (write(compression=…, compress_floats=…)); strings are encoded / decoded vectorised.Fix:
from_fofctkept the last##columns=name intact when it ends in)(n_per_dist(um)was read asn_per_dist(um).seqFISH+ loader (Takei 2025):
tracesnow reportsallele,n_spots,n_loci,n_duplicate_lociand per-column allele majority / agreement instead of the first spot’sdbscan_*values; the docstring warns that the defaultallele_col="dbscan_ldp_nbr_allele"often merges homologs (default unchanged).
0.2.0 — 2026-04¶
Renamed package from
nucboxtouchrom/u-chrom.New core container
ChromDatawith HDF5 persistence (.h5cd) and format versioning (see Concepts — on-disk format).uchrom.io.save_particles/ extendedread_particles— all reconstruction modules now write.h5cdby default.Bulk MDS reconstruction (
uchrom.recon.bulk.mds) — PyTorch SMACOF with inter-chromosomal whole-genome support.Browser updates:
Trace-aware rendering (per
(chrom, trace_id)polymer).“Per Trace” colour mode.
Unified Chromosome / Region / Trace Management tab.
Trace Statistics panel (Distance Matrix / Contact Map / Rg Histogram / Split by Trace).
Click-to-identify trace overlay.
Draggable Layers / Properties divider.
macOS Dock icon + startup logo.
ArcFISH-style axis-wise F-test loop caller (
uchrom.strc.loop.call_loops_axiswise_f) — GPU-accelerated via PyTorch, CLI underpython -m uchrom.strc.loop.New population-aggregate modules:
uchrom.fea.distance(median distance matrix, contact frequency, radius of gyration)uchrom.fea.arc(axis variance cube, LOWESS filter+normalise, axis weights)uchrom.pl.trace_stats(matplotlib helpers)uchrom.utils.stats(Cauchy combination test, log-log LOWESS)
Version stamp on
.h5cdfiles with MAJOR/MINOR semantics and legacy-file handling.