Repository navigation
SecondaryStructures port (TexMol T5): helices and sheets from a surface's medial axis - #1440
Merged
Merged
Conversation
…ce'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.
# Conflicts: # THIRD_PARTY_NOTICES.md
…'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.
…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').
…-secondary #1439 moved the cocone core to src/cvc/geometry/cocone and the skeleton's U1/U2 declarations to skeleton/skeleton_stages.h, so secondary.h now includes that. The eight conflicts are adjacent additions, and both sides are kept: the build lists, the goldens tool (CMakeLists, make_goldens.py, make_inputs.py, README) and the TexMol roadmap. The shared cvcgeom.h shim is #1439's plus line_t and lines(). With that shim, the legacy SecondaryStructures makes the same bytes as before.
transfix
added a commit
that referenced
this pull request
Nov 23, 2026
…-segment volume_grid_quad.png conflicted (both sides re-rendered it); kept ours until CI renders the merged panel.
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 second half of TexMol roadmap item T5. It ports VolumeRover's SecondaryStructures, which finds a protein's helices and sheets from a density map's isosurface through the surface's medial axis. The port is a headless
cvc::core with a resumable stepper, tests natively and in wasm-mt, and an A/B against the legacy library.The core
cvc::find_secondary_structures(app, surface, params)lives ininc/cvc/geometry/secondary_structures.h, with its parameter table insecondary_structures_params.h.What it reuses. It builds on the shared cocone core, and changes none of its files. The triangulation and Tight Cocone are the core's, in
src/cvc/geometry/cocone/since #1439. U1 and U2 are the skeleton's (src/cvc/geometry/skeleton/skeleton_stages.h). SecondaryStructures' copies of those files were near-copies of Skeletonization's; a token-level diff found only the U2 return value and the cosmetics changed.Its own stages are in
src/cvc/geometry/secondary/:secondary_axis.cpp:add_u1_to_skel/add_u2_to_skel). It is rebuilt from the core's U2 graph, and the legacy cell-base fields live in side arrays indexed by cell id.secondary_select.cpp:dsyevbecomes a 3x3 Jacobi);secondary_structures.cpp:secondary_stepper(aresult_job, with phasescheckingthroughoutput),find_secondary_structures_job, andselect_secondary_structures.The result keeps the skeleton graph.
select_secondary_structuresre-runs only the selection with new windows and counts, as the legacy GUI's sliders did.State and I/O.
singleton_scanallowlist lines were added.exit().Fixed on the way in. Each fix is also a recorded patch of the legacy build, so the A/B compares like with like:
CGAL_assertion(get_eid(...))calls had side effects that release builds compiled out, which wrote before the edge array; the lookups now always run.std::mapdropped helices of equal length; all are kept.rand()colours and the Robust Cocone path (whose output the second triangulation never read) are gone.The A/B (
tools/volrover-goldens)The legacy build.
secondary_legacybuilds the library from the pinned volrover sha:dual();dsyev_,cvcgeom_t,HistogramData, and a forcedHUGE, because the UCRT and glibc treat the legacy-DHUGEdifferently.make_goldens.pyruns it by default, so CI's existingvolrover goldensjob runs--checkon it.Two committed inputs:
helices_and_sheet: three tubes and a slab (make_inputs.py)1grl: PDB 1GRL's blur-map isosurface (blobbiness -0.3, 2 Å, isovalue 12, 9,581 points)Why 1GRL is statistical. On 1GRL the core's Tight Cocone already differs a little from the legacy's: 19,166 surface facets against 19,154. P1's own skeleton matches 98.5% of the legacy Skeletonization's segments on the same surface. So the residual difference comes from the shared core, through cell order and Voronoi-vertex rounding, and is not in the SecondaryStructures stages.
The 1GRL input's provenance. The surface is
cvc::mol::blur(#1428, now on master) pluscvc::iso, rounded to 1/64 Å.The1GRLInputIsItsBlurMapsIsosurfacemakes it again on native builds: all 9,581 points are identical on MSVC, and the test allows 1% to move across a rounding step on another compiler.The molecule check
FindsTheHelicesOf1GRLreads the committed surface andexamples/data/molecules/1grl.pdb:How the settings were chosen. A sweep picked blobbiness -0.3, 2 Å, isovalue 12. The skeleton lab's -0.2 / 2 Å / 10 map is too blobby for the legacy 2–3 Å window: it finds one helix there. The result is sensitive to the isovalue, because the window is the legacy's.
Tests
secondary_structures_testhas 12 tests. It is inCVC_PORT_TESTS, so it runs natively and in the wasm-mt ports lane:Local runs on the head with #1439 merged in, against the Linux goldens:
pocket_tunnel_test15/15,skeleton_test11/11 andtet_complex_test10/10.pocket_tunnel_test14 andskeleton_test11 pass.The goldens are Linux's. CI's first Linux
--check(run 44957679986) made different bytes from the Windows build, so the committed goldens are that run's upload, as the skeleton's are:helices_and_sheet: the same counts, and the same values to 4e-13, some in another order;1grl: the legacy finds 22 candidate runs on Linux, 21 on Windows, and draws 20 on both.The port passes against either set:
helices_and_sheetexactly; on1grl, 15 of 20 axes within 1 Å at both ends against Linux's goldens and 13 against Windows', with 17 within 3 Å against both.tools/volrover-goldens/README.mdrecords this. A Windows--checknow fails, as the skeleton's does.Docs
docs/roadmap/TEXMOL-F2DOCK-ARISRV-ROADMAP.md: §2.2's row records the licence ruling ("It is also LGPL-2.1 like the rest", 2026-11-21) and points at the port; §2.6 gets a "built" note; T5's "needs" no longer waits on the licence.THIRD_PARTY_NOTICES.mdrecords the ruling, and the derived 1GRL surface and goldens under PDB entry 1GRL.tools/volrover-goldens/README.mdgets a SecondaryStructures section.Follow-ups
mesh_labrequest or demo.After #1439
#1439 (PocketTunnel) merged first and moved the cocone core to
src/cvc/geometry/cocone/. Master is merged in here:secondary.hincludes../skeleton/skeleton_stages.h;cvcgeom.hshim is cvc::pocket_tunnel: PocketTunnel on the shared cocone core, with its legacy A/B (TexMol T5 part 1) #1439's (64-bit indices) plusline_tandlines(). With it, the legacy SecondaryStructures makes the same bytes as before.