Skip to content

cvc::mol::blur: TexMol's GOABlur density as a stepper, with its A/B against TexMol (TexMol T1 part 1) - #1428

Merged
transfix merged 10 commits into
masterfrom
tmol/t1-blur
Nov 21, 2026
Merged

transfix merged 10 commits into
masterfrom
tmol/t1-blur

Conversation

@transfix

Copy link
Copy Markdown
Owner

Stacked on #1427 (M0 part 1), so the diff here is T1's alone. Once #1427 merges this PR retargets to master.

TexMol roadmap T1 part 1: TexMol's blur map, GOABlur's electron density, as a resumable stepper. Each atom adds exp(B (r²/R² − 1)) to the grid points within its reach. This density's isosurface is the molecular surface the skeleton demo will skeletonize (the next PR). It turns 1GRL into a low-resolution map where helices read as rods.

What it adds

  • inc/cvc/mol/blur.h:

    • blur_params, a param_table: blobbiness, resolution or dims, padding, cutoff, snap_centres.
    • blur_stepper, with phases "checking" (a unit per atom) and "splatting" (a unit per grid point an atom reaches).
    • blur() and blur_job(), which returns a result_job<volume>.
  • GOABlur's arithmetic, type for type:

    • float positions, box and spacing;
    • double kernels;
    • float sums, atoms in order, each atom's cube z, y, x.

    It keeps GOABlur's choices:

    • centres snapped to the nearest grid point (snap_centres, on by default);
    • the box padded by four of the largest radius. TexMol's own check for padding by the kernel's reach never fires, because B is negative.
    • extent / resolution + 3 grid points;
    • each atom's whole cube splatted, corners and all.
  • tools/texmol-goldens, modeled on tools/volrover-goldens:

    • It builds TexMol's PDBParser and GOABlur at a pinned sha. Two shims stand in: BlurMapsDataManager.h, whose getBoundingBox text CMake copies out of the legacy source, and libcvc 3.x's cvc/endians.h.
    • It runs them on 1GRL for two cases: TexMol's default blobbiness at 1.5 Å, and a low-resolution map (B = −0.5 at 2 Å).
    • make_goldens.py --check regenerates them and compares. CI's new texmol goldens job runs it when the tool, the goldens or 1GRL change. The job is in ci.yml, which stays CRLF.
  • blur_test, a port test, natively and in the wasm-mt lane:

    • the kernel at every grid point;
    • snapping off;
    • densities adding;
    • T7: budgets 1, 64, random and 0 give the same volume bit for bit, with monotone progress, cancel and the result_job;
    • T5: bad parameters and no atoms;
    • T6: two apps at once.
  • T1 (the A/B), on 1GRL:

    • The atoms and radii are TexMol's. The test reads them with unknown_radius 1.0, because TexMol gave an atom missing from its table its occupancy as radius.
    • The atoms come in a different order: TexMol's group tree keeps a sheet's strands together.
    • The grid is TexMol's.
    • The densities match to 1e-5 relative. At TexMol's default blobbiness, 158,394 of 159,120 voxels are bit for bit, with the worst at 3.3e-7. In the low-resolution map, 68,069 of 70,200 are bit for bit, with the worst at 1.3e-6, where hundreds of blobs overlap and the order of summation shows.

Not in this part

The hydrophobicity and electrostatic densities, colour, the multilevel blur, and the surfaces (T1 part 2).

Testing

  • blur_test: 10 of 10 pass natively (MSVC Release) and as wasm-mt under node 22.
  • make_goldens.py from a fresh TexMol fetch, then --check: the goldens match.
  • clang-format: changed lines only.

…ue-atom table (TexMol M0 part 1)

The first TexMol port (docs/roadmap/TEXMOL-F2DOCK-ARISRV-ROADMAP.md, M0), and the first step
toward a skeleton demo on molecular data: a PDB file read into atoms with radii, which T1's blur
turns into a density and its isosurface into the surface mesh_lab skeletonizes.

- inc/cvc/mol/molecule.h: a flat molecule (atoms with serial, name, alternate location,
  residue, chain, insertion code, position, occupancy, B factor, element, HETATM, model, radius,
  charge and table row; HELIX, SHEET and TURN residue ranges; HEADER's id and TITLE), its
  bounds, and the structure an atom's residue lies in.
- Readers: PDB by its fixed columns (v3.3, and the older files whose columns 73-80 hold the
  entry and a line number; elements from columns 77-78 or the atom name, by the PDB's own
  convention), PQR by whitespace (charge and radius from the file), XYZR. A malformed line is an
  error naming the file and line, where TexMol's parser read it as zeros.
- Each app's own file handlers (molecule_handlers(app), an app slot, as point_classes), and
  read_molecule by extension.
- molecule_read_params, a param_table: which model, HETATM, water, hydrogens, alternate
  locations, van der Waals or solvent-enlarged radii, and the radius of an atom the table
  lacks. The defaults keep what TexMol's PDBParser kept.
- residue_atom_table.inc: PDBParser's ElementInformation table (TexMol ed20eae, LGPL-2.1 since
  TexMol#7), all 410 rows, generated from it: radii, colours, hydrophobicities, interface
  propensities, solvent-enlarged radii and charges, looked up by atom and residue name without
  blanks. TexMol gave an atom the table lacks its occupancy as its radius (addAtom's argument
  order); here it gets unknown_radius, 2.0 by default, TexMol's defaultInformation.
- molecule_test (a port test: natively and in the wasm-mt lane): the table, every record kind
  and filter, the older columns and CRLF lines, PQR and XYZR, each reader's errors, two apps'
  handlers, and PDB entry 1GRL, a GroEL subunit: 4,186 atoms, 757 hydrogens, one heavy atom the
  table lacks (OXT), 19 helices and 11 sheet strands.
- src/cvc/tests/data/mol/1grl.pdb (the PDB, CC0) and its notice; the TexMol roadmap's progress.

Not in this part: the group tree, torsions, writers, CLI, pycvc and intrinsics (M0 part 2), and
the A/B against TexMol's parser, which comes with T1's blur in tools/texmol-goldens.
…ldens), its CI job, docs

- tools/texmol-goldens, as tools/volrover-goldens: builds TexMol's PDBParser and Blurmaps'
  GOABlur at a pinned sha (texmol.sha, ed20eae), with two shims (BlurMapsDataManager.h, whose
  getBoundingBox CMake copies out of the legacy source as it is; libcvc 3.x's cvc/endians.h), runs
  them on 1GRL (TexMol's default blobbiness at 1.5 Å, and a low-resolution map, B -0.5 at 2 Å),
  and writes the goldens to src/cvc/tests/data/texmol-goldens/blur; --check makes them again and
  compares (densities to 1e-5 relative). blur_driver.cpp stands in for getBlurredVolume.
- ci.yml: the texmol-goldens job runs --check when the tool, the goldens or 1GRL change.
- blur_test T1: TexMol's atoms and radii (read with unknown_radius 1.0, since TexMol gave an atom
  its table lacks its occupancy), in another order (its group tree keeps a sheet's strands
  together); its grid and box; its densities to 1e-5 relative: 158,394 of 159,120 voxels bit for
  bit at TexMol's default, 68,069 of 70,200 in the low-resolution map, the rest the same float
  sums in TexMol's order.
- blur.h says how close it is; the TexMol roadmap's progress; 1GRL's notice covers the goldens.
…he float grid positions' multiply-add and misses TexMol's maps by up to 5e-5
Base automatically changed from tmol/m0-molecules to master November 21, 2026 20:06
# Conflicts:
#	THIRD_PARTY_NOTICES.md
#	docs/roadmap/TEXMOL-F2DOCK-ARISRV-ROADMAP.md
#	src/cvc/CMakeLists.txt
#	src/cvc/tests/port_tests.cmake
@transfix
transfix merged commit d04c070 into master Nov 21, 2026
32 of 62 checks passed
@transfix
transfix deleted the tmol/t1-blur branch November 21, 2026 22:26
transfix added a commit that referenced this pull request Nov 21, 2026
…'s isosurface

With #1428's cvc::mol::blur on master, the test makes 1GRL's surface again: the
isosurface at 12 of its heavy atoms' blur map (blobbiness -0.3, a 2 A grid), rounded to 1/64 A.
It then compares the result with tools/volrover-goldens/inputs/secondary/1grl.pts. On MSVC all
9,581 points are the same; the test allows 1% to move across a rounding step on another compiler.
It runs natively only, because the wasm ports lane has no isosurfacing.

1grl.json now names master's commit instead of a local copy of the blur. The goldens' ss.txt
files are unchanged.
transfix added a commit that referenced this pull request Nov 23, 2026
…ce's medial axis (#1440)

* SecondaryStructures port (TexMol T5): helices and sheets from a surface's medial axis

cvc::find_secondary_structures (inc/cvc/geometry/secondary_structures.h) ports VolumeRover's
SecondaryStructures onto P1's cocone core as it is: the triangulation, Tight Cocone, U1 and U2
come from src/cvc/geometry/skeleton unchanged. Its own stages are in src/cvc/geometry/secondary:
- the inner medial axis, peeled from its free boundary down to the facets the angle and ratio
  conditions choose;
- the skeleton graph (U1's polygons, U2's chains), each with its width;
- the selection: sheets by component area and polygon width, helices by U2 width, clustered into
  runs of one direction, with a principal axis fitted to each run.

The stepper is a result_job and the parameters are a param_table. The result keeps the skeleton
graph, so select_secondary_structures re-chooses the helices and sheets as the legacy GUI's sliders
did. The output geometries belong to the app the call names. No statics, no file writes, no exit().
Fixed on the way in, as patches of the legacy build:
- a chain step's width was a squared circumradius;
- the fit of an empty run divided by zero;
- three assertions with side effects were compiled out.

The A/B in tools/volrover-goldens builds the legacy library at the pinned volrover sha, with
shims for LAPACK's dsyev and its geometry and histogram types. It has two committed inputs:
- three tubes and a slab, which the port matches exactly;
- 1GRL's blur-map isosurface, matched statistically: 99% of the polygon widths, every helix
  width, 17 of 20 helix axes within 3 A. The core's Tight Cocone differs slightly there already,
  as does P1's skeleton against the legacy Skeletonization.

Against PDB 1GRL's own records, 18 of the 20 helix axes found lie on HELIX residues, and 15 of
its 19 helices are found. secondary_structures_test passes natively and as wasm-mt under node.

Licence: SecondaryStructures is UT LGPL-2.1 like the rest (Joe, 2026-11-21), recorded in the
TexMol roadmap's §2.2 row and THIRD_PARTY_NOTICES.md.

* secondary_structures_test: the committed 1GRL surface is its blur map's isosurface

With #1428's cvc::mol::blur on master, the test makes 1GRL's surface again: the
isosurface at 12 of its heavy atoms' blur map (blobbiness -0.3, a 2 A grid), rounded to 1/64 A.
It then compares the result with tools/volrover-goldens/inputs/secondary/1grl.pts. On MSVC all
9,581 points are the same; the test allows 1% to move across a rounding step on another compiler.
It runs natively only, because the wasm ports lane has no isosurfacing.

1grl.json now names master's commit instead of a local copy of the blur. The goldens' ss.txt
files are unchanged.

* volrover goldens: SecondaryStructures' goldens are the ones Linux CI made

CI's first Linux --check of the legacy SecondaryStructures (run 44957679986) made other bytes
than the Windows build: on helices_and_sheet the same values to 4e-13, some in another order;
on 1grl 22 candidate runs to Windows' 21, 20 drawn on both. These are that run's goldens, as
the skeleton's are. The port passes against either set (helices_and_sheet exactly; on 1grl 15
of 20 axes within 1 A at both ends against Linux's, 13 against Windows').
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.

1 participant