Add BPNet model ENCSR438TVE (ENCSR778QLY)
Browse filesFiles changed (23)
- .gitattributes+5
- README.mdAdded+137
- config.jsonAdded+45
- fold_0/model.h5Added+3
- fold_0/saved_model/saved_model.pbAdded+3
- fold_0/saved_model/variables/variables.data-00000-of-00001Added+3
- fold_0/saved_model/variables/variables.indexAdded
- fold_1/model.h5Added+3
- fold_1/saved_model/saved_model.pbAdded+3
- fold_1/saved_model/variables/variables.data-00000-of-00001Added+3
- fold_1/saved_model/variables/variables.indexAdded
- fold_2/model.h5Added+3
- fold_2/saved_model/saved_model.pbAdded+3
- fold_2/saved_model/variables/variables.data-00000-of-00001Added+3
- fold_2/saved_model/variables/variables.indexAdded
- fold_3/model.h5Added+3
- fold_3/saved_model/saved_model.pbAdded+3
- fold_3/saved_model/variables/variables.data-00000-of-00001Added+3
- fold_3/saved_model/variables/variables.indexAdded
- fold_4/model.h5Added+3
- fold_4/saved_model/saved_model.pbAdded+3
- fold_4/saved_model/variables/variables.data-00000-of-00001Added+3
- fold_4/saved_model/variables/variables.indexAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines333435363738394032 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textfold_0/saved_model/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -textfold_1/saved_model/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -textfold_2/saved_model/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -textfold_3/saved_model/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -textfold_4/saved_model/variables/variables.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137---license: cc-by-4.0library_name: bpnettags: - bpnet - dna - genomics - transcription-factor-binding - chip-seq - encode - encode-bpnet-atlas - hg38 - qc-passed - ELF4---
# ENCODE BPNet Atlas
As part of the ENCODE 4 Project, we trained BPNet models on 2,339 ENCODEtranscription factor ChIP-seq experiments spanning 788 targets across175 biosamples. Here, we provide all models for open-source use.
For more information about the models, see:
- Main ENCODE 4 Paper- A unified lexicon of predictive DNA sequence motifs from ENCODE transcription factor binding and chromatin accessibility assays (Deshpande et al., Zenodo 2025)- Base-resolution models of transcription-factor binding reveal soft motif syntax (Avsec et al., Nat Genet 2021)
## BPNet model: ELF4 ChIP-seq in HEK293T (ENCSR778QLY)
- Model: BPNet- Assay: TF ChIP-seq- Target: ELF4- Experiment: [ENCSR778QLY](https://www.encodeproject.org/experiments/ENCSR778QLY/)- Model annotation: [ENCSR438TVE](https://www.encodeproject.org/annotations/ENCSR438TVE/)- Biosample: HEK293T (Full name: Homo sapiens HEK293T)- Cell slim(s): epithelial cell- Organ slim(s): epithelium, kidney- Developmental slim(s): mesoderm- System slim(s): excretory system- Assembly: hg38
## QC
- Status: passed- Notes: Found direct motif (counts, profile);
## Directory structure
5-fold cross-validation. Each `fold_*/` contains the trained BPNet model in two formats:
- `fold_0/model.h5` — BPNet model in .h5 (Keras) format- `fold_0/saved_model/` — BPNet model in TensorFlow SavedModel format (a directory; load directly)- `config.json` — training / architecture parameters
## Instructions
BPNet takes a one-hot DNA sequence plus control (bias) inputs and predictsstranded profile logits and total logcounts. The control inputs come from thematched WCE/Input DNA control and **can be passed as zeros**.
### 1. Loading the SavedModel and making predictions
```pythonimport numpy as npimport tensorflow as tffrom scipy.special import logsumexp
model = tf.saved_model.load("fold_0/saved_model")# sequence: (N, 2114, 4) one-hot [A,C,G,T]# profile_bias_input: (N, 1000, 2) per-base profile bias from WCE/Input control, or zeros# counts_bias_input: (N, 2) log2 total counts from WCE/Input control, or zerospredictions = model.signatures["serving_default"](**{ "sequence": sequence.astype("float32"), "profile_bias_input_0": profile_bias_input.astype("float32"), "counts_bias_input_0": counts_bias_input.astype("float32")})# predictions["profile_predictions"]: (N, 1000, 2) logits (strands NOT independent)# predictions["logcounts_predictions"]: (N, 1) total logcount
output_len = 1000def vectorized_prediction_to_profile(predictions): logits_arr = predictions["profile_predictions"] counts_arr = predictions["logcounts_predictions"] pred_profile_logits = np.reshape(logits_arr, [-1, 1, output_len * 2]) probVals_array = np.exp(pred_profile_logits - logsumexp( pred_profile_logits, axis=2).reshape([len(logits_arr), 1, 1])) profile_predictions = np.multiply( np.exp(counts_arr).reshape([len(counts_arr), 1, 1]), probVals_array) plus = np.reshape(profile_predictions, [len(counts_arr), output_len, 2])[:, :, 0] minus = np.reshape(profile_predictions, [len(counts_arr), output_len, 2])[:, :, 1] return plus, minus, counts_arr
plus, minus, logcounts = vectorized_prediction_to_profile(predictions)```
### 2. Loading the .h5 (Keras) and making predictions
```pythonimport numpy as npimport tensorflow as tfimport tensorflow.keras.backend as kbfrom tensorflow.keras.models import load_modelfrom tensorflow.keras.utils import CustomObjectScopefrom bpnet.model.custommodel import CustomModel
def get_model(model_path): with CustomObjectScope({"kb": kb, "tf": tf, "CustomModel": CustomModel}): return load_model(model_path)
model = get_model("fold_0/model.h5")N = sequence.shape[0]predictions = model.predict([ sequence, # (N, 2114, 4) np.zeros((N, 1000, 2)), # profile_bias_input (or real WCE/Input control values) np.zeros((N, 2))]) # counts_bias_input (or real control log2 counts)# predictions[0]: (N, 1000, 2) logits; predictions[1]: (N, 1) logcounts# convert with the same vectorized_prediction_to_profile() (predictions[0], predictions[1])```
## Docker image to load and use the models
`kundajelab/bpnet-atlas` (placeholder — image forthcoming).
## Code
- Code: https://github.com/kundajelab/bpnet/- Toolbox & downstream analysis: https://github.com/kundajelab/bpnet/wiki
## License & citation
External data users may freely download, analyze and publish results based on anyENCODE data without restrictions.
Released under the ENCODE data-use policy. Please cite the ENCODE ProjectConsortium and the model software: BPNet (Avsec et al., Nat Genet 2021).123456789101112131415161718192021222324252627282930313233343536373839404142434445{ "input_len": 2114, "output_profile_len": 1000, "motif_module_params": { "filters": [64], "kernel_sizes": [21], "padding": "valid" }, "syntax_module_params": { "num_dilation_layers": 8, "filters": 64, "kernel_size": 3, "padding": "valid", "pre_activation_residual_unit": true }, "profile_head_params": { "filters": 1, "kernel_size": 75, "padding": "valid" }, "counts_head_params": { "filters": 1, "kernel_size": 75, "padding": "valid", "units": [1], "activations":["linear"], "dropouts":[0] }, "profile_bias_module_params": { "kernel_sizes": [1] }, "counts_bias_module_params": { }, "use_attribution_prior": false, "attribution_prior_params": { "frequency_limit": 150, "limit_softness": 0.2, "grad_smooth_sigma": 3, "profile_grad_loss_weight": 200, "counts_grad_loss_weight": 100 }, "loss_weights": [1, 132.46506678408923], "counts_loss": "MSE"}123version https://git-lfs.github.com/spec/v1oid sha256:6ace14cfdb8a882e418518485d59c1b96c30910df945c475f77e06724dae73f8size 561784123version https://git-lfs.github.com/spec/v1oid sha256:009dec16cbbae2746471f079ec36f88c5512d2b75daa518cdd8285d88a887e9dsize 750202123version https://git-lfs.github.com/spec/v1oid sha256:f15bbb38b9feb753bddfd02325ef022e6d2006e52d6702f879b5e1cb5996ee5bsize 1393322123version https://git-lfs.github.com/spec/v1oid sha256:703de43593342068cdc9e8977d3f92877c9f0ae52db2559e4a5cd11f828883e3size 561784123version https://git-lfs.github.com/spec/v1oid sha256:bda2f84de1ab883968feff3ac7d5aa3a62ecfd48daa247d7d4bdf2759c5eea0dsize 750202123version https://git-lfs.github.com/spec/v1oid sha256:f4a3f63d7ad57abebae0137c8c97fde6ae0cfeffc7ecf4ef9cb5e8bd756c51fcsize 1393322123version https://git-lfs.github.com/spec/v1oid sha256:3c12461da5be0e8cba7863490be82c9ff0cadfcd721b12af2bf5482ffdb8e8d2size 561784123version https://git-lfs.github.com/spec/v1oid sha256:570587afe2a90fecb6d3314d486abb00cc5f63829f5522ea2154db9f0648aa9asize 750202123version https://git-lfs.github.com/spec/v1oid sha256:3fec5de0246f3bf05a4a1caddc66e57bcf715c15e1c3403d792dc163762ca01asize 1393322123version https://git-lfs.github.com/spec/v1oid sha256:2e1e45eaba4e9302f999b800b7594b2e949eaa6595266ad86d8da2935ae8f55asize 561784123version https://git-lfs.github.com/spec/v1oid sha256:6280420f05c81e579d2188d7b531e22d9990a83d606a42571ec9f3036dbb21b7size 750202123version https://git-lfs.github.com/spec/v1oid sha256:c85fdf28b288b17b4130d5c6039cc7d0a8d74f1651a322a0819a605a5afd8abesize 1393322123version https://git-lfs.github.com/spec/v1oid sha256:229b6e78283e7fee92d6de539f31cef10d1b4c1549d26bad9bb770017fe5a26esize 561784123version https://git-lfs.github.com/spec/v1oid sha256:43e4e61a04de606e6c5888046e18f58d244a8c116b93f3b08c5fe8e27b3fa0besize 750202123version https://git-lfs.github.com/spec/v1oid sha256:14cde9b47c09e759952845fc293b977fa97a8b1ce03159cab9a47065d4697263size 1393322.gitattributes+5
README.mdAdded+137
config.jsonAdded+45
fold_0/model.h5Added+3
fold_0/saved_model/saved_model.pbAdded+3
fold_0/saved_model/variables/variables.data-00000-of-00001Added+3
fold_0/saved_model/variables/variables.indexAdded
fold_1/model.h5Added+3
fold_1/saved_model/saved_model.pbAdded+3
fold_1/saved_model/variables/variables.data-00000-of-00001Added+3
fold_1/saved_model/variables/variables.indexAdded
fold_2/model.h5Added+3
fold_2/saved_model/saved_model.pbAdded+3
fold_2/saved_model/variables/variables.data-00000-of-00001Added+3
fold_2/saved_model/variables/variables.indexAdded
fold_3/model.h5Added+3
fold_3/saved_model/saved_model.pbAdded+3
fold_3/saved_model/variables/variables.data-00000-of-00001Added+3
fold_3/saved_model/variables/variables.indexAdded
fold_4/model.h5Added+3
fold_4/saved_model/saved_model.pbAdded+3
fold_4/saved_model/variables/variables.data-00000-of-00001Added+3
fold_4/saved_model/variables/variables.indexAdded