-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Initializing py3DMol GL's buffers from arrays #530
Comments
You need to call view.render() to render the scene. If you are loading simulation data, most likely the atoms (and bonds) are all the same and all you need to update are the coordinates. You can use setCoordinates (https://3dmol.org/doc/$3Dmol.GLModel.html#setCoordinates) to do this using the supported trajectory formats (mdcrd, inpcrd, pdb, netcdf). It wouldn't be very difficult at all to add support for a raw float array. What exactly is the format the coordinates are in? |
Adding
On the other hand, we use RedisAI for in-memory storage, simulation push time steps while vis/and analysis pull them for processing in different nodes. In particular, arrays are tensors, we have a tensor for X, another for Y, and so on... |
|
Great, it works. Is there another option to this solution ? i.e. not to put all the frames in one string. In my case I'll be receiving frames from the simulation and putting together the frames in one string imply to rebuild the py3Dmol's related objects every time a new frame is ready. On the other hand, I think thanks for your advise. |
Support for arrays in setCoordinates is now implemented. Example py3Dmol code:
I've got one more feature request I want to address before making a release. Hopefully that will happen soon. |
Great, thank you! This is very useful. |
Hi 3Dmol team,
I am looking for a way to create a molecule from arrays (positions, atom ids, etc.) coming from a simulation. Is it possible to initlize py3Dmol's GL buffers from these arrays ? What I want to avoid as much as possible is the serialization/deserialization of these arrays.
On the other hand, I am trying to replicate this 3Dmol.js sample in py3Dmol:
using the next code:
and only I can see the empty canvas. Is there something I am missing ?
Thanks
The text was updated successfully, but these errors were encountered: