Skip to content

PyMOL plugin, in-memory structure input, and the 2.2.0 release - #59

Merged
bobbypaton merged 1 commit into
masterfrom
claude/keen-bardeen-m5y5va
Sep 26, 2026
Merged

bobbypaton merged 1 commit into
masterfrom
claude/keen-bardeen-m5y5va

Conversation

@bobbypaton

@bobbypaton bobbypaton commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

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 (or run .../pymol_plugin.py; python -m dbstep.pymol_plugin prints 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]: the Add_VDW equivalent, using radii.for_atoms so 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() and calculator.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.cone and dbstep.ensemble are now exported from the package namespace.

Testing

  • tests/test_pymol_plugin.py runs the plugin against headless open-source PyMOL (pymol-open-source from PyPI, new optional extra pymol, wheels for 3.9 to 3.13; the extra carries a python_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.py covers the in-memory route and the transform.
  • Full suite: 420 passed, 2 skipped; ruff clean.

Release

__version__ and meta.yaml bumped to 2.2.0; CHANGELOG has the 2.2.0 section covering #57, #58 and this PR. After merging, publish a GitHub Release with tag 2.2.0 and the release workflow uploads to PyPI.

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.
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 14 billable files and costs up to $3.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: e0396c43-5eca-4085-b5ae-57030a5b920f

📥 Commits

Reviewing files that changed from the base of the PR and between ca3f745 and 22507e0.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • CLAUDE.md
  • README.md
  • dbstep/Dbstep.py
  • dbstep/__init__.py
  • dbstep/calculator.py
  • dbstep/parse_data.py
  • dbstep/pymol_plugin.py
  • dbstep/radii.py
  • meta.yaml
  • pyproject.toml
  • tests/test_from_coords.py
  • tests/test_pymol_plugin.py

Comment @coderabbitai help to get the list of available commands.

@bobbypaton
bobbypaton merged commit 67a6d10 into master Sep 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants