deepdnashape / README.md
Siddharth899's picture
Add Deep DNAshape weights converted from upstream TensorFlow checkpoints
fbb25ab verified
|
Raw
History Blame Contribute Delete
1.99 kB
metadata
license: bsd-3-clause
library_name: pytorch
tags:
  - biology
  - dna
  - dna-shape
  - genomics

Deep DNAshape — PyTorch weights

PyTorch (.pt) conversions of the pretrained Deep DNAshape TensorFlow checkpoints, for use with pyaptamer.

These are not newly trained models. Every tensor is a bit-exact copy of the corresponding variable in the upstream TensorFlow checkpoint, with the Conv1D kernel transposed from TensorFlow's (kernel, in, out) layout to PyTorch's (out, in, kernel). All credit for the models belongs to the original authors.

Contents

One state_dict per DNA shape feature, 27 in total.

Intra-base pair features (4 input channels, one value per base): Buckle, EP, MGW, Opening, ProT, Shear, Stagger, Stretch

Inter-base pair features (16 input channels, one value per base step): HelT, Rise, Roll, Shift, Slide, Tilt

Each feature also has a -FL variant trained with extended flanking regions.

Usage

import torch
from huggingface_hub import hf_hub_download

path = hf_hub_download(repo_id="<this-repo>", filename="MGW.pt")
state_dict = torch.load(path, weights_only=True)

The state_dict targets a 7-layer message-passing architecture with 64 filters. See the pyaptamer deepdnashape module for the matching model definition.

Credit

Original method, training and weights by Jinsen Li, Tsu-Pei Chiu and Remo Rohs.

If you use these weights, please cite the original work:

Li, J., Chiu, T.-P. & Rohs, R. Predicting DNA structure using a deep learning method. Nature Communications 15, 1243 (2024). https://doi.org/10.1038/s41467-024-45191-5

License

BSD 3-Clause, inherited from the upstream project. Copyright (c) 2023, JinsenLi. The full license text is in LICENSE.