nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
664 stars 169 forks source link

load .h5 traj from Mdsrv #982

Open pguillem opened 1 year ago

pguillem commented 1 year ago

Hello Alexander,

I want to load a trajectory in .h5 format into NGL via mdsrv, but using the "file://" as source doesn't work, since NGL doesn't understand h5 (yet).

The mdsrv docs/scripts speak of a way to stream any trajectory format directly into NGL. I see that trajectory.py (mdsrv) provides a method to read and cache H5 trajectories, but I'm not sure I understand how to properly use the NGL.DatasourceRegistry or NGL.getQuery methods at the client side to do so... or how to request frame coord/topology data into NGL using the traj:// method, instead of the file:// method.

If available, could you point to an example JS to load a H5 trajectory via mdsrv, or explain a bit on how to properly call frames from mdsrv regardless of the format? (this is all I could find https://nglviewer.org/mdsrv/webapp.html )

(I am already running mdsrv behind apache/wsgi, and it loads PDB files properly)

A nice weekend for you! Thanks in advance