--- license: mit pipeline_tag: other tags: - genomics - dna - webgpu - wgsl - genome-spy - bpnet --- # BPNet WebGPU 11,695 model weight files for predicting protein binding to DNA (ChIP-seq). There are five models (folds) for each of 2,339 experiments. Original models: [Kundaje Lab](https://huggingface.co/kundajelab), using ENCODE data. These `.bin` files need GenomeSpy's **`bpnet-wgsl@1` WebGPU runner**. The runner code is not included here. For ONNX Runtime, use [BPNet-ONNX](https://huggingface.co/genome-spy/BPNet-ONNX). ## Main files ```text models//fold_/*.bin manifest.json # available models and file names original-metadata.tar.gz # original model descriptions LICENSE ``` ## Inputs and outputs DNA uses four float32 channels in **A, C, G, T** order: 1 for the matching base, 0 otherwise. Unknown bases use four zeros. The runner processes one sequence at a time. | Name | Shape | Meaning | | --- | --- | --- | | `sequence` | `[1, 4, 2114]` | DNA input | | `profile_controls` | `[1, 2, 1000]` | Plus/minus control counts at each position | | `count_controls` | `[1, 2]` | Natural-log control totals, plus/minus | | `profile_logits` | `[1, 2, 1000]` | Scores for each output position | | `log_counts` | `[1, 1]` | Log predicted total count (natural log) | The 1,000 predicted bases start 557 bases into the input sequence (human hg38). The two output channels are plus/minus strands sharing one total count. Use measured controls when available, or zeros for sequence-only prediction. ## Download a model Install `huggingface_hub`. Choose a model from `manifest.json`; this example downloads the first one for use with the runner above. ```python import json from pathlib import Path from huggingface_hub import HfApi, hf_hub_download repo = "genome-spy/BPNet-WebGPU" revision = HfApi().model_info(repo).sha listing = hf_hub_download(repo, "manifest.json", revision=revision) model = json.loads(Path(listing).read_text())["models"][0] weights = hf_hub_download(repo, model["artifact"]["path"], revision=revision) print(weights) ``` ## License Model weights: **MIT**. See [LICENSE](LICENSE). Original model details and citations are kept in `original-metadata.tar.gz`.