-
Notifications
You must be signed in to change notification settings - Fork 3
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
Adding module support for NGLView backend #11
Conversation
@ajasja Please try this to add a pose. Upon running the
|
Here are some newly available methods:
The |
For example, one can visualize the residue 1 psi-space of a 20-residue poly-valine linear peptide as follows:
|
if index in self.poses.keys(): | ||
self.update_objects(self.poses[index], self.pdbstrings[index]) | ||
|
||
def _maybe_setup_colab(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ajasja _maybe_setup_colab
runs upon instantiation of the viewer - hopefully this helps show the viewer in Google Colab!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Nglview now displays!
@ajasja Thanks for your review. Additional updates now include:
|
@klimaj Nice! I think it looks really great:) py3dmol works beautifuly and is very responsive. Everything else is working well. |
I agree, |
The goal of this PR is to address:
LayerSelector
methods as widgets, for dynamic layer selector coloring upon parameter changes.core.py
andbase.py
to allow for overlaying multiple poses using theview.add_pose(pose, index=0)
method. Also available are theview.update_pose
andview.remove_pose
methods (and corresponding methods with PDB strings). Poses were previously appended to theview.poses
instance attribute which was of typelist
, but theview.poses
instance attribute is now refactored into a dictionary withint
-type keys specifying theindex
to be displayed andlist
-type values containingPose
objects to be overlaid in the display. This refactor leverages the multiple model support ofpy3Dmol
andnglview
.None
ifPose
objects are input parameters - previously the Viewer was convertingPose
objects to PDBstr
objects anyway and shuttling them around. The Viewer feels faster to displayPose
objects after this change.nglview
with all of the existing modules.makeBundle
preset logging and coloring (i.e.darkred
for the core layer becausered
made oxygen atoms indistinguishable).setZoomTo
module to orient the pose beforeview.show()
is called (otherwise the protein can end up outside the field of view, depending on the 3D coordinates).