feat: add APBS electrostatic surface demo#2
Merged
Conversation
Render a vacuum electrostatic potential surface for 2ewn (E. coli biotin repressor) using util.protein_vacuum_esp (protein contact potential mode), mirroring the existing surface demo's structure prep. Adds scripts/demos/ apbs.pml, the rendered assets/demo_apbs.png, and a README section.
Replace the vacuum-ESP approximation with a true Poisson-Boltzmann electrostatics pipeline: - scripts/apbs/prepare_apbs.sh: pdb2pqr (AMBER charges/radii) -> apbs (linearised PBE, 0.150 M NaCl) -> potential map (.dx, kT/e) for 2ewn chain A. - scripts/demos/apbs.pml: load the .pqr + .dx and colour the molecular surface by potential over -5..+5 kT/e (ramp_new/surface_color), mirroring the mdpp examples/apbs viz scripts. - CI: install apbs + pdb2pqr and run prepare_apbs.sh before rendering. - gitignore generated APBS artifacts (.pqr/.dx/.in/.pdb) and the apbs solver scratch file io.mc.
Replace orient with the explicit set_view matrix copied from scripts/demos/surface.pml so both demos share the same viewpoint (orient on the pqr atom set diverged: added hydrogens, no ligand).
There was a problem hiding this comment.
Pull request overview
Adds an APBS-based electrostatic surface demo to the PyMOL demos set, including a script to generate APBS inputs/outputs and CI updates to generate artifacts before rendering.
Changes:
- Add a new PyMOL demo (
scripts/demos/apbs.pml) that colors a molecular surface by APBS potential from a.dxmap. - Add an APBS preparation pipeline script (
scripts/apbs/prepare_apbs.sh) to download a PDB, generate.pqr/.in, run APBS, and normalize outputs. - Update CI,
.gitignore, and README to include the new APBS demo and its generated artifacts.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/demos/apbs.pml | New demo script that loads .pqr/.dx and renders an electrostatic surface PNG. |
| scripts/apbs/prepare_apbs.sh | New generator pipeline to produce the APBS input/output artifacts used by the demo. |
| .github/workflows/render-demos.yml | Installs APBS + PDB2PQR and runs the generator before rendering demos in CI. |
| .gitignore | Ignores generated APBS artifacts and a scratch file. |
| README.md | Adds the new APBS demo image to the Demos section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+25
to
+26
| echo "[apbs-prep] downloading ${PDB_ID}..." | ||
| curl -sSL -o "${PDB_ID}.pdb" "https://files.rcsb.org/download/${PDB_ID^^}.pdb" |
Comment on lines
+23
to
+24
| pdb2pqr_bin="$(command -v pdb2pqr30 || command -v pdb2pqr)" | ||
|
|
Comment on lines
+38
to
+40
| sed -i "s#write pot dx ${PDB_ID}.pqr#write pot dx ${PDB_ID}#" "${PDB_ID}.in" | ||
| sed -i "s#^ lpbe# ion charge +1 conc 0.150 radius 2.0\n ion charge -1 conc 0.150 radius 2.0\n lpbe#" \ | ||
| "${PDB_ID}.in" |
| ramp_new 2ewn_esp, 2ewn_potential, [-5, 0, 5], [red, white, blue] | ||
| set surface_color, 2ewn_esp, 2ewn | ||
|
|
||
| # set the view (same camera as scripts/demos/surface.pml) |
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.
Summary
Adds an APBS electrostatic surface demo, computed with the real APBS Poisson-Boltzmann solver and rendered in the same style as the existing surface demo.
scripts/apbs/prepare_apbs.sh— pipeline: download2EWN→ isolate chain A →pdb2pqr(AMBER charges/radii) →apbs(linearised PBE, 0.150 M NaCl, pdie 2.0 / sdie 78.54) → potential map2ewn.dx(units kT/e).scripts/demos/apbs.pml— loads the.pqr+.dx, colours the molecular surface by potential over[-5, 0, 5]kT/e (ramp_new/surface_color), mirroring themdpp/examples/apbsviz scripts. Uses an explicitset_viewcopied fromsurface.pmlso both demos share the same camera.render-demos.yml) — installsapbs+pdb2pqr, runsprepare_apbs.shbefore the render loop..gitignore— ignores generated APBS artifacts (.pqr/.dx/.in/.pdb, the 67 MB map regenerates in CI) and the APBS scratch fileio.mc.Test plan
pymol-open-source,apbs3.4.1,pdb2pqr3.7.1); committed PNG is byte-identical to the CI render.render-demosworkflow passes green on the branch (real APBS solve runs in CI:Global net ELEC energy = 3.07e+05 kJ/mol).demo_surface.png.