Metadata-Version: 2.4
Name: PersonalBPNet
Version: 0.7.0
Summary: PyTorch BPNet-family models (CLIPNET, ProCapNet, PauseNet) for base-resolution genomic signal prediction, extending bpnetlite.
Author-email: Adam He <adamyhe@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Adam Youlin He
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/adamyhe/PersonalBPNet
Project-URL: Repository, https://github.com/adamyhe/PersonalBPNet
Project-URL: Issues, https://github.com/adamyhe/PersonalBPNet/issues
Project-URL: Changelog, https://github.com/adamyhe/PersonalBPNet/blob/main/CHANGELOG.md
Project-URL: Documentation, https://github.com/adamyhe/PersonalBPNet/tree/main/docs
Keywords: genomics,deep-learning,pytorch,bpnet,clipnet,pro-cap,regulatory-genomics
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bpnet-lite>=1.0.0
Requires-Dist: tangermeme>=1.0.0
Requires-Dist: pyfaidx
Requires-Dist: numba
Provides-Extra: tf
Requires-Dist: h5py; extra == "tf"
Dynamic: license-file

# PersonalBPNet

A PyTorch library of [BPNet](https://github.com/jmschrei/bpnet-lite)-family models for predicting base-resolution genomic signal (e.g., PRO-cap read coverage) from DNA sequence, plus CLI tools for prediction and attribution.

- **PersonalBPNet** — `bpnetlite.bpnet.BPNet`, with a `fit()` that validates against a PyTorch `DataLoader` instead of holding the whole validation set in memory.
- **CLIPNET** — `PersonalBPNet` plus batch normalization; PyTorch port of the original TensorFlow [CLIPNET](https://github.com/Danko-Lab/clipnet).
- **ProCapNet** — `BPNet` with a masked profile loss, improving attributions (from the [ProCapNet paper](https://www.biorxiv.org/content/10.1101/2024.05.28.596138v2)).
- **PauseNet** — transfer-learns a base-resolution model to predict a single scalar phenotype per locus.

## Install

With [uv](https://docs.astral.sh/uv/):

```sh
uv add personalbpnet
```

Or with pip:

```sh
pip install personalbpnet
```

To load TensorFlow-trained weights (requires `h5py`), install with the `tf` extra: `uv add "personalbpnet[tf]"` or `pip install "personalbpnet[tf]"`.

Installing from source, for local development, is covered in [CONTRIBUTING.md](CONTRIBUTING.md).

## Documentation

| | |
| --- | --- |
| [docs/clipnet.md](docs/clipnet.md) | `PersonalBPNet` and `CLIPNET`, incl. pretrained weights |
| [docs/clipnet-tf.md](docs/clipnet-tf.md) | Porting the original TensorFlow CLIPNET weights |
| [docs/procapnet.md](docs/procapnet.md) | `ProCapNet` |
| [docs/pausenet.md](docs/pausenet.md) | `PauseNet` |
| [docs/cli.md](docs/cli.md) | `clipnet`, `pausenet`, and `clipnet_tf` command line tools |
| [CONTRIBUTING.md](CONTRIBUTING.md) | Installing from source and local development |

This package is under active development; APIs may change between releases. See [CHANGELOG.md](CHANGELOG.md).

## Citing

If you use `PersonalBPNet`/`CLIPNET`/`ProCapNet`, or the underlying `BPNet` architecture (via the `bpnet-lite` dependency), please cite the corresponding paper (see [CITATION.cff](CITATION.cff)):

- Avsec et al. (2021). [Base-resolution models of transcription-factor binding reveal soft motif syntax](https://doi.org/10.1038/s41588-021-00782-6). *Nature Genetics* 53:354–366. — BPNet
- He & Danko (2024). [Dissection of core promoter syntax through single nucleotide resolution modeling of transcription initiation](https://www.biorxiv.org/content/10.1101/2024.03.13.583868). *bioRxiv*. — CLIPNET
- Cochran et al. (2024). [Dissecting the cis-regulatory syntax of transcription initiation with deep learning](https://www.biorxiv.org/content/10.1101/2024.05.28.596138). *bioRxiv*. — ProCapNet

## License

[MIT](LICENSE)
