Giter VIP home page Giter VIP logo

alescrnjar / framefromnoise Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 11.64 MB

Conditional Denoising Diffusion Probabilistic Model for Molecular Dynamics frame generation

License: MIT License

Python 89.71% Shell 10.29%
deep-learning deep-neural-networks denoising-diffision-probabalistic-models denoising-diffusion-models diffusion-models molecular-dynamics molecular-dynamics-simulation

framefromnoise's Introduction

FrameFromNoise

FrameFromNoise is a conditional denoising diffusion probabilistic model (DDPM) which, given the AMBER parameter and topology file of a biological system (.prmtop, .top) and an associated molecular dynamics (MD) trajectory (.dcd, .nc, ...), reconstructs a frame belonging to the same distribution of the sampled trajectory. Moreover, it is given a label (0 or 1) which allows to distinguish between frames with an observed condition from those without.

The trajectory is aligned and centered around the origin in the pre-processing stage, as this is necessary for the algorithm. The first frame is outputted as "initial.inpcrd"

Instead of a U-Net, as typical for diffusion models, the code makes use of a more traditional architecture composed of linear layers, where both time and label embeddings are added in every layer.

The code is adapted from this tutorial: https://medium.com/mlearning-ai/enerating-images-with-ddpms-a-pytorch-implementation-cef5a2ba8cb1

The output .inpcrd files can be visualized with VMD (or pymol): load the parameter and topology files as "AMBER7 Parm", then the .incprd as "AMBER7 Restart"

Required Libraries

Case Study

As a case-study, the software LEaP and CPPTRAJ (AmberTools21) were used to generate 30,000 conformations of a tetrapeptide, and arranged in a trajectory file. Approximately half of the frames regard a peptide of sequence HHHH, whereas the others regard a peptide of sequence MMMM. Given that histidine and methionine share the same number of atoms, their atomic position can give rise to a 3*N tensor of identical size (N being the number of atoms) that can be taken as input. However, for simplicity reasons, frames beloning to the two labels were assigned to two separate sets of .prmtop and .dcd files.

On 250 samples generated per label after 200 epochs of training, accurarcies of 0.992 and 0.916 were obtained for label 0 (HHHH) and label 1 (MMMM), where the accuracy measures what fraction of the total generated structures respect a certain quality check condition (in this case, maximum bond length deviation of 0.5 ร…).

Two examples of generated structures (left: label 0, right: label 1).

framefromnoise's People

Contributors

alescrnjar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.