Skip to content

Release v0.3.0

Choose a tag to compare

@github-actions github-actions released this 12 Apr 18:21

PyMOL-RS v0.3.0

An algorithmic independence release — core algorithms rewritten from published papers and public specifications, replacing PyMOL-derived implementations. CE structural alignment, cartoon rendering, secondary structure assignment, and crystallographic space groups are now clean-room code with full academic citations. New coloring features, a DSSP implementation, and command UX improvements round out the release.

image

Highlights

CE Structural Alignment Rewrite

The Combinatorial Extension (CE) algorithm has been completely rewritten from the original Shindyalov & Bourne (1998) paper. Function names and parameters now map directly to the paper's notation — distance_matrix, afp_similarity_matrix, extend_paths, select_best_path — with inline comments referencing equations 1–11. Z-score normalization follows Zhang & Skolnick (2004).

The align command now supports multi-object alignment: when the mobile selection matches multiple objects via wildcards, each is independently superimposed onto the target.

DSSP Secondary Structure Assignment

A full implementation of the Kabsch & Sander (1983) DSSP algorithm provides an alternative to the existing PyMOL-compatible DSS assigner:

  • H-bond detection — Electrostatic energy model with the standard coupling constant (q₁ × q₂ × f = 27.888 kcal/mol)
  • Spatial hashing — O(n) average-case H-bond detection using 5.5 Å grid cells on carbonyl oxygen atoms
  • Full classification — Turn detection (3/4/5-turn patterns), parallel and antiparallel bridge/ladder detection, bend analysis (>70° Cα angle), priority-ordered state assignment
  • Quantization — Eight-state DSSP output collapsed to helix/sheet/loop to match PyMOL DSS semantics

A new SecondaryStructureAssigner trait makes the algorithm pluggable at runtime via set dss_algorithm, dssp|pymol|none.

Space Groups from CCP4

All crystallographic space group definitions (16,000+ lines) have been regenerated from CCP4's syminfo.lib, the canonical machine-readable encoding of the International Tables for Crystallography, Vol. A. This replaces data previously sourced from PyMOL's xray.py, correcting several space group definitions in the process.

A new scripts/generate_space_groups.py script makes the data fully reproducible from the source authority, with a --verify flag for round-trip validation.


New Features

  • set_color command — Define custom named colors with RGB values (set_color mywhite, [255, 255, 255]) or remove them by name. Aliases: set_colour
  • Residue coloring schemes — Two new color modes: residue_type (amino acids colored by chemical property — hydrophobic green, positive blue, negative red, polar magenta, cysteine yellow) and residue_index (rainbow spectrum from blue through green to red). Aliases: aa_type, spectrum, rainbow
  • Sequence panel viewer colors — A "Color by viewer" toggle in the sequence panel matches residue letter colors to the 3D viewport coloring scheme. Uses FNV-1a checksums to detect color-only changes efficiently
  • Tab-completion hintsarg_hints() implementations added to 21 commands that were previously missing autocompletion (fetch, group, rename, delete, dss, zoom, clip, rotate, translate, and more)
  • Infix distance operatorswithin, beyond, and near_to now work as infix operators: chain A within 5 of chain B. The existing prefix form (within 5 of chain B) continues to work unchanged

Bug Fixes

  • Viewport click selection restored — Fixed atom selection-by-clicking broken by egui event handling; replaced egui_consumed flag with egui_ctx.is_using_pointer() for correct mouse input gating
  • Context menu click isolation — Context menu clicks in the sequence viewer that overlapped the 3D viewport no longer clear the current selection
  • Empty selection cleanup — Named selections that evaluate to zero atoms are now automatically deleted instead of stored as empty entries
  • Sequence viewer highlight — Selection highlight switched from text color override to semi-transparent background, preserving the residue's original coloring (element, chain, etc.)

Under the Hood

  • Column-major Mat4 — All 4×4 matrices switched from row-major to column-major layout, aligning with lin_alg's native representation. Custom left_multiply_mat4, transform_mat4, and is_identity_mat4 helpers deleted in favor of the library's * operator. Raw [f32; 3/9/16] arrays replaced with typed Vec3/Mat3/Mat4 across Kabsch, CE, crystal symmetry, and space group code
  • Command argument deduplication — New str_arg_or(), int_arg_or(), float_arg_or() accessors on ParsedCommand replace ~134 boilerplate get_str(i).or_else(|| get_named_str("name")) patterns. Extracted set_visibility() and camera_to_model_vec() shared helpers. Net reduction: 686 lines across 15 command modules
  • Wildcard consolidation — Duplicated glob_match/is_object_pattern helpers replaced with Pattern::Wildcard matching in ObjectRegistry and SelectionManager
  • Clippy clean — All workspace clippy warnings resolved
  • CI — Removed DMG build from release workflow

Full Changelog: v0.2.8...v0.3.0