rust-bandnorm
Rust port of BandNorm (Shen, Zheng, Keleș 2022) — single-cell Hi-C scGAD scoring and band-normalisation for cell-type discovery and downstream embedding.
This is a separate package that re-implements the algorithm in Rust; it is not a fork of the upstream R tree. The original R implementation continues to be available at https://github.com/sshen82/BandNorm.
What it computes
Two functions, mirroring BandNorm/R/scGAD.R and BandNorm/R/bandnorm.R:
import bandnorm_rs as bn
# scGAD: gene × cell matrix from contact pairs.
gad = bn.scgad(hic_df, genes, resolution=10_000, depth_norm=True)
# BandNorm: per (chrom, diagonal, cell) depth-normalisation of contact counts.
norm_df = bn.bandnorm(hic_df)
Both are bit-equivalent (within f64 ε) to the R reference and faster by ~10-30× depending on the dataset.
Algorithm parity
tests/test_parity.py compares the Rust output against an R reference
generated via pure GenomicRanges (no GenomicInteractions dependency)
on the official BandNorm-shipped scGADExample.rda + mm9Annotations
data: 100 cells × ~1.3 M contact pairs × 10180 genes.
Tolerance: max |Rust − R| < 1e-10 on raw counts (integer-exact),
< 1e-6 on Z-scored GAD output.
Install
git clone https://github.com/omicverse/rust-bandnorm
cd rust-bandnorm
maturin develop --release
PyPI release coming soon (pip install bandnorm-rs).
Layout
rust-bandnorm/
├── pyproject.toml
├── rust/Cargo.toml
├── rust/src/lib.rs # ~250 LoC: gene index + scGAD + bandnorm
├── python/bandnorm_rs/ # Python wrapper
└── tests/
├── reference_scgad.R # R reference generator
└── test_parity.py # pytest parity vs R
License
MIT.
Metadata
Release files for bandnorm-rs 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bandnorm_rs-0.1.0.tar.gz | 12.1 kB | With provenance | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bandnorm_rs-0.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bandnorm_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| bandnorm_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 1.5 MB
Release files / bandnorm_rs-0.1.0.tar.gz
| Download URL | bandnorm_rs-0.1.0.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3d1eed938089da829f65df18e2a8320580890ffc6020d79829430f5f03861544
|
|
BLAKE2b-256 checksum How to use checksums |
7c8c4c2ab48cd8fef15372d59e09f02da7a8416ebcad0d54acd446ed79be2226
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / bandnorm_rs-0.1.0-cp39-abi3-win_amd64.whl
| Download URL | bandnorm_rs-0.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 212.0 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
07d06e266396500784c3364eaf120bb461022be0e8890a004ed98f95596c94b6
|
|
BLAKE2b-256 checksum How to use checksums |
fcee7b8fbb986044976888cb6bdd6acb656cfb0ef10aac2b0f51c60ad072c1d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 345.8 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
580f5e1c240c4159eed333ee2975f6345299115f5eb3d0b2df927c1a7b3bc71e
|
|
BLAKE2b-256 checksum How to use checksums |
c487b1cbd87bfdffc0c93c164a597517adff0fb0b9f01e4c6fa383a985d6a7d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bandnorm_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 347.1 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
9b56e20452cfe3c131d3a9fa0ceafc0ff755fbf7b8d99f9eb0eeaa0eea970139
|
|
BLAKE2b-256 checksum How to use checksums |
d899f8a8e9b2ea2245f30fc72966390f2aca6a1de6daaecc2caf09ee835a93e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / bandnorm_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | bandnorm_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 305.8 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c9b0f0bf7135d12ac54e22791ac18cbd51a039aa693a758ce913d41808fab09d
|
|
BLAKE2b-256 checksum How to use checksums |
adcde7ac3b1c59c5e3335307944d85bf9d068f5e57abf631a236c0e9097d72bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / bandnorm_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | bandnorm_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 311.4 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
c336149cada87b8667184285f4e564e3ca7324f9bf86b787cc68eb632ea524fb
|
|
BLAKE2b-256 checksum How to use checksums |
176afb74ee1f116e368fd23a8a1c144f4af3976a36c27a5aa6022f370e63bda8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logSecurity for bandnorm-rs 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for bandnorm_rs-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.