Repository navigation
PyMOL plugin, in-memory structure input, and the 2.2.0 release - #59
Merged
Merged
Conversation
dbstep/pymol_plugin.py registers dbstep_sterimol, dbstep_vbur (residue contributions coloured on the protein), dbstep_cone, dbstep_vdw, dbstep_ensemble, dbstep_conformers and dbstep_style inside PyMOL. They take PyMOL selections, run DBSTEP on the open object through the new from_coords/Structure route and draw the results in the object's own frame using the rigid transform recovered from the aligned coordinates. Tested headless against pymol-open-source (optional 'pymol' extra, also installed in CI for Python < 3.14). Version bumped to 2.2.0.
|
Warning Review limit reached
This review includes 14 billable files and costs up to $3.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 29 minutes for your next included review. View limit detailsLimit details: You’ve used all 4 included reviews currently available. Your 30 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Essentials Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The visual side of wSterimol, brought over to DBSTEP as a PyMOL plugin, plus the version bump so 2.2.0 ships together with the legacy-gap features from #58.
PyMOL plugin (
dbstep/pymol_plugin.py)Install dbstep into PyMOL's Python, then
import dbstep.pymol_plugin(orrun .../pymol_plugin.py;python -m dbstep.pymol_pluginprints the path). Commands take PyMOL selections and draw on the open object:dbstep_sterimol atom1, atom2 [, atom3, radii, measure, selection, name]: L axis and Bmin/Bmax circles plus direction cylinders, in the object's own frame.dbstep_vbur atom1 [, radius, radii, selection, decompose=1]: translucent sphere; residue contributions written to B-factors and coloured white to red.selection="polymer and not resi 45"gives the exclude-self, no-water pocket measurement (atoms named as atom1 outside the selection become zero-radius ghosts).dbstep_cone metal [, ligand, radii=cpk]: translucent cone of the Tolman angle, centroid pseudoatom and distance object, Sterimol axes of the ligand.dbstep_vdw object [, radii, scale]: theAdd_VDWequivalent, usingradii.for_atomsso CPK atom typing is shared with the CLI.dbstep_ensemble files, atom1, atom2 [, radii, temperature, window, vbur]: Boltzmann weighting over QM outputs or a multi-structure file; conformers loaded with populations as titles, minor conformers faded by transparency. Formats PyMOL cannot read (e.g..out.gz) are loaded from the measured coordinates.dbstep_conformers folder,dbstep_style.Package changes that make this possible
parse_data.Structure+from_coords(atoms, coords, name, metadata, **kwargs): in-memory input through the normal parser path; metadata arrays enable--decompose(tested equal to the PDB residue route).run.aligned_coords,run.sterimol_vectors()andcalculator.rigid_transform(Kabsch) recover the rigid map from DBSTEP's aligned frame back to the input coordinates, so drawings land on the loaded structure instead of a transformed copy.dbstep.radii,dbstep.coneanddbstep.ensembleare now exported from the package namespace.Testing
tests/test_pymol_plugin.pyruns the plugin against headless open-source PyMOL (pymol-open-sourcefrom PyPI, new optional extrapymol, wheels for 3.9 to 3.13; the extra carries apython_version < '3.14'marker and the tests skip when PyMOL is absent). CI installs the extra. Checks: Sterimol values and the drawn L axis against the CLI, %V_bur and contributions equal to--residue A:3 --decompose, the selection route equal to--exclude-self --nowater --nohet, the legacy 173.97° cone angle, CPK radii on the vdW copy, ensemble loading and titles, error handling.tests/test_from_coords.pycovers the in-memory route and the transform.Release
__version__andmeta.yamlbumped to 2.2.0; CHANGELOG has the 2.2.0 section covering #57, #58 and this PR. After merging, publish a GitHub Release with tag2.2.0and the release workflow uploads to PyPI.