RosettaCommons / pyrosetta_viewer3d

Display PackedPose objects, Pose objects, or PDB files within a Jupyter notebook and Google Colab

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set BuriedUnsatHBond preset

klimaj opened this issue · comments

It would be great to have a preset that automatically shows buried unsatisfied hydrogen bonds using the UnsatSelector residue selector, or wrapping the BuriedUnsatHbonds filter to produce a residue selector that can be visualized.

These are both great ideas! I think #13 and #14 should be combined into a load Rosetta PDB preset, and then one could toggle the various features you would usually want to display.

Usually one would like to:

  • display unsats
  • color by simple metric and score terms
  • show PDBInfoLables
  • (Show arbitrary residue selectors?)

I've played with a pymol version here https://github.com/ajasja/rosetta_pymol_utils

Thanks, and sounds great - I think the first step is the write each of the presets, then since presets now return a viewer instance we can write wrapper presets with syntax of the sort:

# Presets to display using an IntSlider widget
presets = (
    viewer3d.presets.BuriedUnsatHbonds(),
    viewer3d.presets.TotalEnergy(),
    viewer3d.presets.PerResidueClashMetric(),
    ...,
)
v = viewer3d.init(poses)
preset = IntSlider(
    min=0,
    max=len(presets) - 1,
)
def on_preset(i):
    v.set_modules(presets[i].get_modules())
    v.update_viewer()
preset.observe(on_preset, names="value")

I'll start working on a few of these presets.

Re: rosetta_pymol_utils - it's great to see selectors in PyMOL! Perhaps it's possible to integrate some functions into the apply_pymol methods of the visualization modules once the pymol backend is supported.