Add Deep DNAshape weights converted from upstream TensorFlow checkpoints
Browse files12345678910111213141516171819202122232425262728BSD 3-Clause License
Copyright (c) 2023, JinsenLi
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162---license: bsd-3-clauselibrary_name: pytorchtags: - biology - dna - dna-shape - genomics---
# Deep DNAshape — PyTorch weights
PyTorch (`.pt`) conversions of the pretrained [Deep DNAshape](https://github.com/JinsenLi/deepDNAshape)TensorFlow checkpoints, for use with [pyaptamer](https://github.com/gc-os-ai/pyaptamer).
These are **not** newly trained models. Every tensor is a bit-exact copy of thecorresponding variable in the upstream TensorFlow checkpoint, with the Conv1Dkernel 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
```pythonimport torchfrom 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.
- Source repository: <https://github.com/JinsenLi/deepDNAshape>- Webserver: <https://deepdnashape.usc.edu/>
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`.LICENSEAdded+28
README.mdAdded+62