Bridge is a standalone Python package for applying the Bridge model to predict Acute Leukemia class to new RNA-seq count matrices.
The inference bundle (bridge_inference.bundle) is not distributed publicly in this repository.
If you want to run the package, please email us (the project maintainers) to request bundle access.
pip install -e ./BridgeConda package (published):
conda install -c eonurk -c conda-forge -c pytorch bridgePackage page: https://anaconda.org/eonurk/bridge
from bridge import BridgePredictor
predictor = BridgePredictor(
bundle="path/to/bridge_inference.bundle",
)
result = predictor.predict_rna("path/to/rna_count_matrix.csv")
print(result.combined.head())
predictor.close()result.combined includes predictions, per-class probabilities, and RNA latents.
The bundle is provided by the model team and contains all required inference artifacts.
After install, the package exposes a bridge command:
bridge --helpPredict labels from an RNA matrix:
bridge predict-rna \
--bundle path/to/bridge_inference.bundle \
path/to/rna_count_matrix.csv \
--combined-out outputs/predictions.csvExport RNA latents:
bridge encode-rna \
--bundle path/to/bridge_inference.bundle \
path/to/rna_count_matrix.csv \
--output outputs/rna_latents.parquetExport methylation latents:
bridge encode-methylation \
--bundle path/to/bridge_inference.bundle \
path/to/methylation_matrix.csv \
--output outputs/meth_latents.csvIf you are not using a bundle, pass --checkpoint (plus --metadata if needed) and for
predict-rna also pass --classifier.
For existing pipelines, avoid storing large bundles in your repo by passing a URL and cache dir:
bridge predict-rna \
--bundle-url https://example.org/path/bridge_inference.bundle \
--bundle-cache-dir /shared/cache/bridge \
--bundle-sha256 <expected_sha256> \
input/rna_counts.csv \
--combined-out output/predictions.csvThe bundle is downloaded once and reused from cache in later runs.
All model-source options support environment variable fallbacks:
BRIDGE_BUNDLE,BRIDGE_BUNDLE_URL,BRIDGE_BUNDLE_CACHE_DIR,BRIDGE_BUNDLE_SHA256BRIDGE_CHECKPOINT,BRIDGE_METADATA,BRIDGE_CLASSIFIER
- License:
CC-BY-NC-4.0 - Non-commercial use only.
- For any commercial use (including commercial research, product integration, or deployment), you must email us to request a separate commercial-use license.
- See
LICENSEfor details.
The package auto-detects whether features are in rows or columns and aligns input features to the training metadata.
A drop-in Snakemake example is included at:
Bridge/examples/snakemake/SnakefileBridge/examples/snakemake/rules/bridge.smkBridge/examples/snakemake/config.yamlBridge/examples/snakemake/README.md
It is designed for private bundle delivery via environment variables (BRIDGE_BUNDLE or
BRIDGE_BUNDLE_URL) and keeps bundle paths/URLs out of committed config.
Install test dependencies and run:
cd Bridge
pip install -e ".[test]"
PYTHONPATH=src pytest -q