ChromBPNet Pytorch
- Pytorch implementation for ChromBPNet
- Please refer to original code and paper ChromBPNet: Bias factorized, base-resolution deep learning models of chromatin accessibility reveal cis-regulatory sequence syntax, transcription factor footprints and regulatory variants by Anusri Pampari*, Anna Shcherbina*, Anshul Kundaje. (*authors contributed equally)
- This repo also refers to bpnet-lite and uses tangermeme for interpretation, two very useful repos by Jacob Schreiber
Reproduce Official ChromBPNet performance
Pearson correlation on counts prediction of peaks
official chrombpnet (left) vs pytorch chrombpnet (right)
Attribution score
Here is the genome browser to compare the profile prediction and attribution scores between official ChromBPNet and pytorch implementation with n_filters = 512 and 128
Table of contents
Installation
Install from pypi
pip install chrombpnet-pytorch
Install from source
pip install git+https://github.com/jsxlei/chrombpnet-pytorch.git
QuickStart
Before training
- Download the genome or use your own genome data
- Download the ENCODE K562 ATAC data or use your own ATAC data
Bias-factorized ChromBPNet training
Please refer to data_config to define your own dataset or pass them through command.
if your <data_path> contains: peaks.bed, negatives.bed, and unstranded.bw, and bias_scaled.h5 as well.
chrombpnet train --data_dir <data_path>
Otherwise
chrombpnet train --peaks <peak_file> --negatives <negative_file> --bigwig <unstrand.bw> --bias <bias_scaled.h5> --adjust_bias
Predict with pretrained model in .h5 format or .cpkt or .pt
chrombpnet predict --data_dir <data_path> --checkpoint chrombpnet_wo_bias.h5/best_model.cpkt/chrombpnet_wo_bias.pt -o <output_path>
Interpret by calculating attribution
chrombpnet interpret --data_dir <data_path> --checkpoint <model_cpkt/model_h5> -o <output_path>
Run full pipeline including training, predicting and interpreting
chrombpnet --data_dir <data_path> -o <output_path>
Finetune model
chrombpnet finetune --data_dir <data_path> --checkpoint <model>.h5/pt -o <output_path>
Variant scoring
snp_score
-l $snps \
-g $ref_fasta \
-pg $ref_fasta_peaks \
-s $chrom_sizes \
-ps $chrom_sizes_peaks \
-m $model \
-p $peaks \
-o $out_prefix \
-t 2 \
-li \
-sc chrombpnet
Input Format
--bigwig--peaks--negatives
Output Format
The ouput directory will be populated as follows with fold_0 chromosome splits -
fold_0\
checkpoints\
best_model.cpkt
last.cpkt
chrombpnet_nobias.pt (pytorch i.e model to predict bias corrected accessibility profile)
train.log
predict.log
evaluation\
eval\
all_regions.counts_pearsonr.png
all_regions_jsd.profile_jsd.png
peaks.counts_pearsonr.png
peaks_jsd.profile_jsd.png
regions.csv
metrics.json
interpret\
counts\
How to Cite
If you're using ChromBPNet in your work, please cite as follows:
@article {Pampari2024.12.25.630221,
author = {Pampari, Anusri and Shcherbina, Anna and Kvon, Evgeny and Kosicki, Michael and Nair, Surag and Kundu, Soumya and Kathiria, Arwa S. and Risca, Viviana I. and Kuningas, Kristiina and Alasoo, Kaur and Greenleaf, William James and Pennacchio, Len A. and Kundaje, Anshul},
title = {ChromBPNet: bias factorized, base-resolution deep learning models of chromatin accessibility reveal cis-regulatory sequence syntax, transcription factor footprints and regulatory variants},
elocation-id = {2024.12.25.630221},
year = {2024},
doi = {10.1101/2024.12.25.630221},
publisher = {Cold Spring Harbor Laboratory},
URL = {https://www.biorxiv.org/content/early/2024/12/25/2024.12.25.630221},
eprint = {https://www.biorxiv.org/content/early/2024/12/25/2024.12.25.630221.full.pdf},
journal = {bioRxiv}
}
Metadata
Release files for chrombpnet-pytorch 0.0.3
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 | Actions |
|---|---|---|---|---|
| chrombpnet_pytorch-0.0.3.tar.gz | 1.3 MB | Without provenance | Details for chrombpnet_pytorch-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chrombpnet_pytorch-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for chrombpnet_pytorch-0.0.3-py3-none-any.whl |
Total release size: 1.4 MB
Release files / chrombpnet_pytorch-0.0.3.tar.gz
| Download URL | chrombpnet_pytorch-0.0.3.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55fc6c4779389a6b288f57e21db2f35edc9dfce7d430ca9e1700909b0462859a
|
|
BLAKE2b-256 checksum How to use checksums |
ad706b6b2151d2e1a77f7da8819d95bc5606ba8fdf60084b1deca8037e4fe01e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Release files / chrombpnet_pytorch-0.0.3-py3-none-any.whl
| Download URL | chrombpnet_pytorch-0.0.3-py3-none-any.whl |
|---|---|
| Size | 68.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71402dfbe02b0f90d7fa22719eef430a51b4d769bd1bb45e0508093c832f987e
|
|
BLAKE2b-256 checksum How to use checksums |
db6084ac307477a3585b19ae6c007fdac84bd06859b5a3e29ac00406462fb467
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Security for chrombpnet-pytorch 0.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.