dynamics? animation, simulation...
This is a naive question. I offer apologies in advance.
I have been delighted by the power of ngl.js, which I currently use via an R/shiny app. Our first application is an exploration of the structure of the oxygen-evolving complex in the the context of photsystem II.
See the Demo button in https://paulshannon.shinyapps.io/OECapp/. The underlying widget is maintained here.
Can ngl.js support dynamics, as well as structure? For instance: could I somehow animate/simulate the absorbtion of a photon and the travel of an excited electron down the electron transport chain?
I'd be grateful for any suggestions you have.
I had it pulling a pdb from a dynamics simulation once a second. I disabled the feed a while back, but the code is likely still in the page. :-)
http://phobrain.com/pr/home/mol.html
There are various ways this can be done:
- NGL support multi-models files, such as PDB files containing multiple models. You could make an animation based on different frames saved as distinct models in the same PDB file.
- NGL has support for trajectories such as the ones output by MD simulations. The general idea is to load the topology first and then change the atomic coordinates at each frame of the simulation. The MDsrv project is a related tool that facilitates the distribution of such simulation by streaming the coordinates for a given frame. A telling example of such usage can be found on the GPCR-MD database (e.g. https://submission.gpcrmd.org/view/245/)
- It's possible to load a model in a distinct component and animate its position relative to other components. This could be used as a visual metaphor for electron transfer in your example. It would require a computation of all the translations based on the atomic coordinates, which might be tedious...
@ppillot thank you for these three suggestions. I will give each a try.