-
Notifications
You must be signed in to change notification settings - Fork 86
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
Serialization of Viewer #117
Comments
Hi Javier, as of now, there is no support for serializing of the viewer and saving its state. I agree that this would be very useful to have. This will take a while to implement, though as there will need to be custom serialization code for many of the viewer classes. It doesn't make sense to just store the complete objects as is, as the geometries themselves are rather big and the saves state would rather quickly reach multiple megabytes. Instead, the simplest representation that can be used to recreate the geometry would need to be saved. Depending on what your exact use-case is, a simpler approach to serialization might already work. Could you elaborate for what you would like to use the serialization? Best, |
Hi Marco, I am trying to serialize the viewer so I can store the it in a DB. I really like pymol sessions because you can save models with their representation. I am thinking on implementing this by doing something like CSS that cascades through the molecule -> chain -> residue -> atom hierarchy. |
Depending on how complex your application is you might be able to serialize the list of commands that were used to create the session, e.g. save the original PDB file together with all the calls to In the long term, the ideal solution would be for the viewer to offer a From the top of my head the following parts of the viewer need to be serialized:
Thinking about this again, it's probably not going to be too bad to implement. I'd guess 1 day of work should be sufficient to get most of it going. But it's still going to be 1 day and I'm not sure I have the time for this right now. Depending on how quickly you need this, you will have to work on this on your own. |
Thanks Marco, I will try to implement it myself. Cheers, Javier |
OK, cool! I might have a little time next week to help out with some parts of it. |
Hi Marco,
Thanks for making such beautiful, the performance is just amazing.
Is there any way to serialize a the contents of a viewer and reload them into another viewer?
I tried dumping the contents into a JSON but I get a circular reference error.
Thanks!
Javier
The text was updated successfully, but these errors were encountered: