Skip to content

Rebase add_bedrmod on develop and preserve NASE export behavior - #10447

Merged
poshul merged 1160 commits into
OpenMS:add_bedrmodfrom
poshul:fix/add-bedrmod-develop-rebase-qvalue
Oct 8, 2026
Merged

poshul merged 1160 commits into
OpenMS:add_bedrmodfrom
poshul:fix/add-bedrmod-develop-rebase-qvalue

Conversation

@poshul

@poshul poshul commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

The add_bedrmod branch does not build against current develop APIs. This branch rebases that work onto develop, migrates the NucleicAcidSearchEngine and BEDRMod code to the updated string and RNA APIs, and preserves the RNOME search behavior under the Becker 11 ppm precursor / 6 ppm fragment control settings.

It also restores BEDRMod's rejection of the -1 sentinel for hits without an assigned q-value. Without that check, the rebased exporter wrote 8,351 extra target rows for the Becker control and changed frequency values on valid rows. A regression test covers both row exclusion and frequency calculation. The existing BEDRMod tests were updated to the current string API so they build and run on develop.

Validation:

  • BedRModFile_test passes.
  • The controlled Becker search produces the same 10,401 target/decoy hits and assignments as RNOME (7,137 target, 3,264 decoy), with the same target-decoy ROC AUC of 0.621063174990.
  • With the sentinel fix, all 132,725 BEDRMod rows match RNOME when the intentional unique_mapping change to a target-mapping count is excluded. No -1 BEDRMod scores remain.

The PR diff is large because the branch includes the requested develop rebase; the OpenMS-specific compatibility and exporter fixes are the commits at the tip.

The final reconciliation merge records add_bedrmod as an ancestor after its changes were ported onto develop. That merge commit makes no changes to the already tested source tree and resolves the PR's merge conflicts.

For a focused review that excludes the already reviewed develop changes, see the 50-file comparison against the develop fork point. This comparison contains the add_bedrmod-specific port and fixes: 4,435 additions and 181 deletions.

timosachsenberg and others added 30 commits September 14, 2026 21:31
…lve xml symbols (OpenMS#10136)

* [FIX] Link libxml2 after Arrow's archives so static Arrow builds resolve xml symbols

With a statically linked Arrow, libOpenMS.so came out with 23 undefined libxml2
symbols and every consumer that dlopen()s it failed:

    ImportError: .../libOpenMS.so: undefined symbol: xmlBufferFree

arrow_bundled_dependencies vendors the AWS SDK, which references
xmlBufferCreate/xmlBufferFree and friends. src/openms/CMakeLists.txt accounted for
that by adding LibXml2::LibXml2 as a direct OpenMS dependency, but CMake emits all
direct link libraries before the transitive archives they pull in, so the generated
link line read

    ... libarrow.a libarrow_compute.so libparquet.a libarrow_dataset.a libxml2.so
    ... (30 entries later) ... libarrow_bundled_dependencies.a

libxml2.so sat at position 19 and libarrow_bundled_dependencies.a at 45. With
--as-needed -- the default on most Linux distributions -- nothing had referenced
libxml2 by position 19, so the linker dropped it, and the archive that actually
needs it came afterwards with nothing left to resolve against.

Record the dependency where it belongs instead: append LibXml2::LibXml2 to the
interface of Arrow::arrow_bundled_dependencies (falling back to the dataset target
for Arrow configs that do not export it), so CMake's own ordering places libxml2
after the archive that references it. Only done when Arrow or Arrow Dataset is
actually the static target; shared-Arrow builds are unchanged and no longer call
find_package(LibXml2) at all.

This is not hypothetical or vcpkg-specific: the Apache Arrow packages for Debian
and Ubuntu ship ARROW_USE_STATIC=ON in ArrowOptions.cmake, so any build using a
distribution Arrow selects Arrow::arrow_static and hits it. CI does not, because
the vcpkg x64-linux-dynamic triplet provides a shared Arrow.

Verified on Ubuntu 24.04 with Arrow 25.0.1 from the Apache APT repository,
-DOPENMS_USE_VCPKG=OFF -DARROW_USE_STATIC=ON:
- before: libxml2 absent from libOpenMS.so's DT_NEEDED, 23 undefined xml* symbols,
  "import pyopenms" raising ImportError;
- after: libxml2.so at link-line position 45 directly behind
  libarrow_bundled_dependencies.a at 44, libxml2.so.2 in DT_NEEDED, all 15 pyOpenMS
  extension modules import, and the 28 XIC/XIM/XIPM Parquet tests (which exercise
  Arrow Dataset) pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX] Correct the attribution of the libxml2 dependency in the comments

Two factual errors in the previous commit's comment and changelog entry, both
found while answering review questions on the PR. No behaviour change; the fix
itself is unaffected.

1. The libxml2 symbols do not come from the AWS SDK. They come from the bundled
   azure-storage-common: xml_wrapper.cpp.o is the only object in
   libarrow_bundled_dependencies.a with undefined xml* symbols, and its exported
   symbols are Azure::Storage::_internal::XmlReader/XmlWriter/XmlGlobalInitializer.
   The AWS SDK is bundled as well and even contributes an xml_parser.c.o, but that
   is aws-c-common's own parser (aws_xml_node_*) and references no libxml2.

2. ARROW_USE_STATIC is not something the distribution Arrow packages ship. Arrow
   exports both Arrow::arrow_shared and Arrow::arrow_static and sets nothing;
   ARROW_USE_STATIC is OpenMS's own option, declared in
   cmake/build_system_macros.cmake with default ON. The static preference is
   therefore ours, and this affects any default-options build against an Arrow
   that provides a static target -- a wider set than the "distribution packaging
   quirk" the entry described. Release CI escapes it only because the vcpkg
   dynamic triplets used on Linux and macOS export no static target.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX] Apply the libxml2 workaround to static Arrow without Arrow Dataset too

The previous commit put the workaround inside the ArrowDataset_FOUND block, but
the undefined symbols come from arrow_bundled_dependencies, which arrives through
Arrow::arrow_static's own interface. Arrow Dataset is optional here
(find_package(ArrowDataset CONFIG QUIET)), so a static Arrow build without it hit
the original bug with the fix silently not applying.

Moved the block out of the ArrowDataset section so it runs whenever a static
Arrow or a static Arrow Dataset target was selected. The fallback for Arrow
configs that do not export arrow_bundled_dependencies now attaches LibXml2 to
whichever static targets are actually in use, rather than only to the dataset
target, so direct Arrow consumers are covered as well.

Found by CodeRabbit review on OpenMS#10136.

Verified on Ubuntu 24.04 with Arrow 25.0.1, using
-DCMAKE_DISABLE_FIND_PACKAGE_ArrowDataset=ON to reproduce the static-Arrow-only
configuration:
- before this commit, that configuration emitted no "added LibXml2" message and
  had no libxml2 anywhere on libOpenMS.so's link line -- the original failure
  would have reproduced in full;
- after it, libxml2.so sits at link-line position 40, directly behind
  libarrow_bundled_dependencies.a at 39;
- static Arrow with Arrow Dataset is unchanged and still gets the dependency;
- shared Arrow is untouched: no LibXml2 lookup and no message.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX] Do not require LibXml2 for static Arrow builds that do not need it

83b9cfd moved the libxml2 link-interface workaround out of the Arrow Dataset
block so that a static Arrow without Arrow Dataset is covered too. That made
find_package(LibXml2 REQUIRED) run on Windows for the first time, where the
contrib build links a static Arrow but ships no system libxml2 -- and it does
not need one, because MSVC's linker has no --as-needed and keeps the archive
members regardless. Configuration then failed with

  Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)

Look libxml2 up quietly instead and only append it to Arrow's link interface
when it is actually present. The workaround stays in place everywhere it is
needed; platforms without a system libxml2 configure as before, and a STATUS
message points at libxml2 should the link ever fail with undefined xml*
symbols.

Verified by configuring three shapes against a static system Arrow:
  - with Arrow Dataset        -> libxml2.so follows libarrow_bundled_dependencies.a
  - without Arrow Dataset     -> libxml2.so follows libarrow_bundled_dependencies.a
  - without libxml2 installed -> configures cleanly, no libxml2 on the link line

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

---------

Co-authored-by: Claude <[email protected]>
…R 1) (OpenMS#10138)

* [pyOpenMS] Require nanobind 3 and py-build-cmake 0.5 (OpenMS#10133, PR 1)

Establishes the nanobind 3 baseline in normal linked mode, ahead of the
split-mode/abi3 wheel change. Wheel production is unchanged: one build per
supported Python version, no BACKEND_MODULE or STABLE_ABI_VERSION yet.

Build metadata (src/pyOpenMS/pyproject.toml), in both [build-system].requires
and [dependency-groups].build:
- nanobind>=2.4.0 -> nanobind>=3.0.1,<4. The declared range no longer lets an
  isolated build resolve a nanobind the sources cannot compile against, and the
  upper bound keeps a future nanobind 4 out.
- py-build-cmake>=0.3.0 -> py-build-cmake~=0.5.1, so the declared minimum covers
  the wheel ABI configuration the planned cp311-abi3 wheels need.

Type casters: nanobind 3 widened the custom-caster from_python() flags from
uint8_t to uint32_t. All 11 signatures across the five caster headers now take
uint32_t, matching the protocol nanobind 3 documents in nb_cast.h.

CMake (src/pyOpenMS/CMakeLists.txt):
- The FetchContent fallback fetches nanobind v3.0.1 instead of v2.10.0 (which
  was also yanked upstream for a CMake regression).
- find_package(nanobind) now requests 3.0.1. nanobind ships a SameMajorVersion
  config, so this accepts >= 3.0.1 and < 4; the previous unversioned call would
  happily have selected an installed 2.x.
- A nanobind supplied by an enclosing project is checked rather than bypassing
  the requirement, and a caller-supplied nanobind_ROOT/nanobind_DIR is no longer
  overwritten by the interpreter probe, only version-checked like any other.
- The probe result is checked, and the selected nanobind version and directory
  are reported in the configure log and the configuration summary.
- Stub generation imports nanobind from ${Python_EXECUTABLE}; configure now warns
  when that interpreter has no nanobind, or one older than the frontend the
  modules are compiled against.
- The MSVC __forceinline patch is kept: nanobind 3.0.1 still has it in nb_defs.h.

Docs/changelog: the conda quick-start created a python=3.10 environment, which
is no longer a supported version; the dependency list and the PyOpenMS section
of the 3.6.0 changelog record the new nanobind minimum.

Verified locally against nanobind 3.0.1 (the current 3.x release, so also what
CI resolves):
- All 15 binding translation units (13 domain modules, main_module,
  arrow_zerocopy) compile clean.
- A module built from the real caster headers gives byte-identical results on 26
  str/bytes/list/tuple/set/dict conversion and rejection probes under
  (old casters, nanobind 2.9.2) and (new casters, nanobind 3.0.1).
- nanobind.stubgen 3.0.1 emits the same ndarray/None annotations as 2.x for the
  nb::ndarray shapes pyOpenMS uses, so fix_stubs.py and stubs.patch still apply.
- Discovery exercised for: nanobind 3 installed, nanobind 2.x installed (rejected,
  falls back to fetching v3.0.1), no nanobind installed, and nanobind 3 / 2.x
  supplied by an enclosing project (accepted / fatal error).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [pyOpenMS] Compare the full nanobind version of a supplied installation

The enclosing-project branch accepted any nanobind whose headers contain
nb_backend.h. That header is also present in nanobind 3.0.0, so a project
supplying 3.0.0 passed a check that is meant to require >= 3.0.1, and the
reported version was only ever "3 (exact version unknown)".

nanobind.h defines NB_VERSION_MAJOR / NB_VERSION_MINOR / NB_VERSION_PATCH, so
read those and compare the complete version instead. A supplied installation
whose version cannot be determined is now rejected rather than accepted, with a
message pointing at find_package(nanobind 3.0.1 CONFIG) as the way to make the
version known. The components are collected and counted rather than tested for
truth, because 0 is a legitimate value for any of them (3.0.1 itself has
NB_VERSION_MINOR 0).

Found by CodeRabbit review on OpenMS#10138.

Verified against the same harness as the original block:
- nanobind 3.0.1 supplied without nanobind_VERSION -> parsed as 3.0.1 from the
  header and accepted;
- a tree carrying NB_VERSION_PATCH 0 (i.e. 3.0.0) and nb_backend.h -> rejected,
  "the enclosing project supplied nanobind 3.0.0", which is exactly the case the
  previous check let through;
- NB_DIR without nanobind.h -> rejected as undeterminable;
- no regression on the other paths: plain find_package discovery and an
  enclosing project that does export nanobind_VERSION both still report 3.0.1,
  and a full OpenMS configure with PYOPENMS=ON still selects nanobind 3.0.1.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

---------

Co-authored-by: Claude <[email protected]>
… mode (OpenMS#10133, PR 2) (OpenMS#10140)

* [pyOpenMS] Build one cp311-abi3 wheel per platform via nanobind split mode (OpenMS#10133, PR 2)

Compiles the bindings in nanobind's split mode against the CPython 3.11 stable
ABI, so each platform produces a single cp311-abi3 wheel serving 3.11 and every
later version instead of one wheel per interpreter. nanobind's version-specific
runtime moves into the separate nanobind-backend package.

Limited API compatibility:
PyList_SET_ITEM is unavailable under the Limited API. All 8 uses (6 in
openms_datavalue_caster.h, 1 each in openms_dposition_caster.h and
openms_stl_caster.h) become checked PyList_SetItem calls. The allocation and
item-conversion checks stay as they were; the setter's return value is checked,
and since PyList_SetItem steals the reference even on failure, the item is not
released a second time -- only the partially built list is, leaving the Python
exception set. nb::list_builder is deliberately not used: its constructor and
commit() can throw, and these casters are noexcept.

CMake:
- A shared PYOPENMS_NB_MODULE_OPTIONS list feeds all 15 nanobind_add_module
  sites, so no module can miss the common domain or the ABI settings.
- Split mode adds BACKEND_MODULE nanobind_backend, STABLE_ABI and
  STABLE_ABI_VERSION. STABLE_ABI is needed in addition to STABLE_ABI_VERSION:
  the version keyword only selects which ABI to target, while the boolean is
  what defines Py_LIMITED_API and gives the module its .abi3 suffix. With only
  the version keyword the modules stay full-API and interpreter-tagged while the
  wheel claims abi3 -- a wheel that lies about its ABI.
- PYOPENMS_SPLIT_MODE=OFF keeps interpreter-specific modules for local work, and
  refuses to run under py-build-cmake, because pyproject.toml tags the wheel
  abi3 and packaging linked-mode modules under that tag would mislabel them.
- Split mode requires CMake 3.26 for FindPython's Development.SABIModule, checked
  in pyOpenMS only; the C++-only OpenMS build still requires no more than 3.24.
- PYOPENMS_GENERATE_STUBS=ON now actually produces stubs: pyopenms_stubs was
  neither in ALL nor reachable from the aggregate pyopenms target, so wheel
  builds silently skipped it. It now runs after the bundled libraries are in
  place, and keeps the Windows PYOPENMS_DLL_PATH search setup.

Packaging and CI:
- nanobind-backend>=1.0 in [project].dependencies (runtime) and in both
  [build-system].requires and [dependency-groups].build, because stubgen imports
  the freshly built package before the wheel is installed. Unpinned with no upper
  bound; 1.0 is the revision nanobind 3.0.1 declares, which nanobind's own
  configure output confirms.
- [tool.py-build-cmake.wheel] python_abi = "abi3",
  abi3_minimum_cpython_version = 311, and cmake minimum_version = "3.26".
- cibuildwheel compiles cp311 only. The workflow derives that from
  abi3_minimum_cpython_version rather than hardcoding it, so the compiled version
  and the declared ABI floor cannot drift; python_versions.json is now purely the
  test-version list.
- test-wheels installs the one abi3 artifact (failing loudly if the artifact does
  not contain exactly one candidate) rather than globbing per-version wheels, and
  installs the local file rather than a package-index substitute. It now also runs
  pip check, imports all 15 extension modules explicitly -- pyopenms/__init__.py
  swallows per-domain import errors, so `import pyopenms` alone proves nothing --
  and runs the full pytest suite with --import-mode=importlib. That last part
  matters: cibuildwheel only tests the single compiled interpreter, so without it
  3.12-3.14 would lose full-suite coverage. Thermo smoke tests and the aarch64
  exclusion are unchanged.

Verified on Linux x86_64 (gcc 13, nanobind 3.0.1, nanobind-backend 1.0.0):
- All 15 translation units compile under Py_LIMITED_API=0x030B0000 with the
  split-mode defines; the same check rejects the pre-change casters with
  "'PyList_SET_ITEM' was not declared in this scope", so it has teeth.
- The build emits -DPy_LIMITED_API=0x30b0000, NB_BACKEND_MODULE, NB_DOMAIN=pyopenms
  and links all 15 modules as .abi3.so.
- The only private CPython symbols left are _Py_NoneStruct, _Py_TrueStruct,
  _Py_FalseStruct and _Py_Dealloc, which Py_None/Py_True/Py_False/Py_DECREF expand
  to and which compile under the 3.11 Limited API.
- One build, three interpreters: the same .abi3.so files import on CPython 3.11,
  3.12 and 3.13 and pass the full suite on each (5957 passed, 94 skipped,
  10 xfailed, 7 xpassed, 0 failed), matching the linked-mode baseline.
- Caster tests extended from 20 to 41 cases covering empty and populated
  DataValue/ParamValue string/int/double lists, std::vector<std::string>,
  DPosition<2> container shapes, invalid conversions and the bytes/str behaviour.
- PYOPENMS_SPLIT_MODE=OFF still yields .cpython-311-*.so with no Py_LIMITED_API
  and no backend, and the wheel guard fires under py-build-cmake.
- The aggregate pyopenms target now emits all 18 .pyi files plus py.typed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX][pyOpenMS] Read only the value of abi3_minimum_cpython_version

The setup job derived the compiled CPython version from pyproject.toml with

  grep -E '^abi3_minimum_cpython_version' ... | grep -oE '[0-9]+'

but the key name carries a digit of its own, so matching every number on
"abi3_minimum_cpython_version = 311" returned two: the 3 from "abi3_" and the
actual 311. ABI3_MIN became "3\n311", CIBW_PY became "cp3\n311", and writing
that multi-line value to $GITHUB_OUTPUT without a heredoc delimiter failed the
job before any wheel was built:

  Compiling the cp3
  311 frontend; wheels are tagged cp3
  311-abi3
  ##[error]Unable to process file command 'output' successfully.
  ##[error]Invalid format '311'

The -z guard did not catch it because the value was not empty.

Capture only the right-hand side with sed, and check the result against
^[0-9]+$ rather than merely non-empty, so a duplicated or malformed key fails
loudly at this step instead of producing a broken wheel tag downstream.

Verified against the committed pyproject.toml and adversarial variants:
  as committed                 -> cp311
  indented, no spaces round =  -> cp312
  trailing comment with digits -> cp311  (the old code also ate the comment)
  commented-out decoy above    -> cp311
  duplicated key               -> rejected
  key absent                   -> rejected
  quoted value                 -> rejected
Simulating the whole step writes five well-formed single-line outputs
(abi3-python and the four cibw-build-*), where the old code wrote none.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX][pyOpenMS] Let the caller supply the stub-generation DLL path on Windows

Wiring pyopenms_stubs into the aggregate target made stub generation actually
run during a wheel build, and the Windows wheel job then failed:

  ImportError: DLL load failed while importing _pyopenms_analysis:
               The specified module could not be found.
  ...
  ImportError: Failed to import any pyOpenMS bindings.
  error MSB8066: Custom build for '...pyopenms_stubs.rule' exited with code 1

nanobind.stubgen imports the freshly built package, so on Windows the modules
must be able to find OpenMS.dll and everything it depends on. The directory
list handed to PYOPENMS_DLL_PATH was built from OPENMS_CONTRIB_LIBS and
QT_INSTALL_BINS, but those are variables of the enclosing OpenMS build: a
standalone py-build-cmake wheel build has neither. The list therefore collapsed
to OpenMS.dll's own directory, OpenMS.dll could not load its Qt and contrib
dependencies, and every module failed to import -- which is why the error names
all of them and not just some.

Keep whatever the caller already put in PYOPENMS_DLL_PATH instead of
overwriting it, and have the Windows wheel job pass exactly the directories it
already gives delvewheel --add-path. The two lists are now written from the
same three workflow variables, so they cannot drift apart.

Linux and macOS were unaffected: they resolve OpenMS through RPATH, and both
wheel jobs built and generated stubs on the previous commit.

Verified:
- the DLL-path construction, exercised directly in all four shapes:
    standalone + caller-supplied  -> target dirs, then install/bin, install/lib,
                                     Qt/bin, contrib/lib
    standalone + nothing supplied -> target dirs only (reproduces the failure)
    in-tree, env unset            -> unchanged from before this commit
    in-tree + env set             -> both kept, build-tree dirs first
- PYOPENMS_DLL_PATH and delvewheel --add-path parse to identical 4-entry lists;
- Linux rebuild of the pyopenms target: 0 errors, 15 modules, 18 .pyi files
  plus py.typed, so stub generation still works where it already did.

The Windows leg can only be proven by CI; this is the first commit that has the
directories it needs.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [pyOpenMS] Report the stub-generation DLL search path on Windows

When nanobind.stubgen cannot import the freshly built package on Windows the
only thing it ever says is

  ImportError: DLL load failed while importing _pyopenms_analysis:
               The specified module could not be found.

which never names the DLL that is actually missing. Two attempts at this
failure have now had to guess at whether PYOPENMS_DLL_PATH reached the build
and whether it named the right directories, with a full CI cycle between each
guess.

Print at configure time whether the environment supplied a value and what it
was. That is the one fact the message itself cannot convey and the first thing
anyone debugging this needs.

Deliberately a configure-time message(STATUS) rather than a build-time echo of
the fully resolved list: the resolved value contains generator expressions and
";"-separated directories, and echoing it through the build tool's shell breaks
on those metacharacters -- an echo of the non-Windows variant containing "(" and
then ";" failed locally with /bin/sh: Syntax error and took the stub target with
it. The generator-expression half is predictable; whether the caller's value
arrived is not.

Verified on Linux: stub target still exits 0 and emits 18 .pyi files plus
py.typed, and the Windows-only message stays out of non-Windows configure logs.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [pyOpenMS] Drop the stub-generation wiring from the abi3 wheel change

Wiring pyopenms_stubs into the aggregate target was an incidental fix bundled
into this PR, not part of the split-mode/abi3 work, and it is the only thing
failing: on Windows the wheel build cannot import the freshly built package
during stub generation, so every module dies with

  ImportError: DLL load failed while importing _pyopenms_<module>:
               The specified module could not be found.

and the pyopenms_stubs custom command takes the build down with MSB8066.

That is a pre-existing gap this change exposed rather than created -- the
target was neither in ALL nor reachable from the aggregate target, so wheel
builds have always skipped stub generation silently, and Windows has evidently
never been able to run it. Two attempts to fix it in place did not land, and
diagnosing it further needs a Windows loop that does not belong in the critical
path of the wheel migration.

So stub generation returns to exactly its previous behaviour: the
pyopenms_stubs target still exists and still works when built explicitly, but
nothing depends on it. The abi3 wheel work, which is verified green on all four
platforms, is no longer held up by it. Windows stub generation is tracked
separately.

Reverted with it: the PYOPENMS_DLL_PATH plumbing and its configure-time
diagnostic, and the workflow environment variable that fed it -- all of which
existed only to make stub generation work during a wheel build -- plus the
CHANGELOG entry claiming stubs are generated. The nanobind-backend build
requirement stays, with its comment corrected: it is there for anything that
imports the freshly built package, which is now only an explicit
pyopenms_stubs build.

Verified on Linux: the stub target's definition is byte-identical to develop's,
building the aggregate pyopenms target produces 15 .abi3.so modules and 0 .pyi
files exactly as develop does, building pyopenms_stubs explicitly still emits
18 stubs, and the suite is unchanged at 5977 passed / 0 failed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [FIX][pyOpenMS] Do not cut the package index out of the wheel test install

test-wheels failed on every platform and every Python version with

  ERROR: Could not find a version that satisfies the requirement numpy>=2.0
         (from pyopenms) (from versions: none)
  ERROR: No matching distribution found for numpy>=2.0

The install passed --no-index, added to guarantee that the test exercises the
artifact just built rather than a release pulled from PyPI. It does guarantee
that, but it also cuts off the wheel's own dependencies -- numpy, matplotlib
and now nanobind-backend -- none of which are in wheelhouse, so the install
could never resolve them.

Naming the wheel by path already provides the guarantee --no-index was there
for: pip installs the file it is given and does not substitute an index release
of the same project. So drop the flag and keep the explicit path.
--only-binary=:all: stays, so a dependency cannot quietly arrive as an sdist
and get built.

Reproduced and verified in a clean virtualenv with a throwaway wheel declaring
the same dependencies:
  with --no-index     -> the two error lines above, verbatim
  without --no-index  -> resolves numpy, matplotlib and their transitive
                         dependencies, and still installs the local wheel
develop's install step has no --no-index either, which is why this is new.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [pyOpenMS] Derive the stable-ABI floor from pyproject.toml, and guard overrides

PYOPENMS_STABLE_ABI_VERSION and abi3_minimum_cpython_version were two
independent copies of the same number. CMake turns the first into
Py_LIMITED_API; py-build-cmake turns the second into the wheel's
cp<N>-abi3 tag. Nothing connected them, so a packaging build configured
with -DPYOPENMS_STABLE_ABI_VERSION=3.12 would still have produced a
wheel tagged cp311-abi3 whose modules need a 3.12 interpreter and fail
to import on 3.11.

CMake now reads abi3_minimum_cpython_version out of pyproject.toml and
uses it as the default, so the two agree by construction rather than by
convention, and there is no second literal to keep in step. Split mode
refuses to configure when that key is missing or duplicated, since the
floor is then unknowable, and refuses to package a build whose floor was
overridden away from it. Overriding it outside py-build-cmake is still
allowed: the knob is only dangerous when a wheel tag is being written.

The wheel workflow already derived the compiled interpreter from the
same key, so all three readers now agree on one source of truth; the
pyproject comment records that contract.

Also drops a stale CHANGELOG sentence claiming wheels still carry one
build per supported Python version. That was true of the nanobind 3
baseline, but this change is exactly what makes it false, and it
contradicted the wheel entry a few lines above.

Verified: derived floor is 3.11, and the emitted -DPy_LIMITED_API,
NB_BACKEND_MODULE, NB_BACKEND_PYPI and NB_DOMAIN defines are byte
identical to before. All 15 modules still link as .abi3.so and the suite
is unchanged at 5977 passed, 94 skipped, 10 xfailed, 7 xpassed. The
guards were exercised against the real CMakeLists: a mismatched floor
under py-build-cmake fails, the same override without it is allowed
through, a missing or duplicated key fails, and the pre-existing
PYOPENMS_SPLIT_MODE=OFF packaging guard still fires.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [pyOpenMS] Reject a stable-ABI floor newer than the interpreter building it

[tool.cibuildwheel].build is a fourth copy of the ABI floor, and the one
copy that cannot be derived: cibuildwheel's configuration has no
interpolation, so the frontend is named literally as cp311-*. The wheel
workflow computes CIBW_BUILD from abi3_minimum_cpython_version and
overrides it, so CI is safe, but a direct cibuildwheel run reads the
literal. Move the floor without moving it and the cp311 frontend would
compile with Py_LIMITED_API set to a newer ABI than its own headers
expose -- promising symbols that are not there, and tagging the result
for a version it cannot serve.

Since that copy cannot be derived, reject the mismatch instead: split
mode now refuses to configure when the building interpreter is older
than PYOPENMS_STABLE_ABI_VERSION. That is an invariant of the stable ABI
rather than a packaging convention, so it holds for every path into the
build, cibuildwheel or not, and it is what turns a forgotten selector
into a configure error at the first compile rather than a mislabelled
wheel. A floor at or below the interpreter is untouched, so the normal
case -- building a cp311-abi3 wheel with 3.11 or anything newer -- is
unaffected.

The pyproject comments now say which readers derive the floor and which
one does not, and point at the guard that catches the difference.

Verified: floor 3.12 on Python 3.11 fails with the new message; floor
3.10 on the same interpreter configures and emits
Py_LIMITED_API=0x30a0000, so overriding it locally still works; the
default configure is unchanged at 0x30b0000 with identical NB_* defines.
All 15 modules link as .abi3.so and the suite is unchanged at 5977
passed, 94 skipped, 10 xfailed, 7 xpassed.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dtk9KoddQxGPNyZkCPDKnT

* [DOC] Explain pyOpenMS split-mode Debug build requirements

---------

Co-authored-by: Claude <[email protected]>
…penMS#10151)

MascotGenericFile::load() created one spectrum object and reused it for
every block; getNextSpectrum_() only cleared the peaks and the TITLE/SEQ
meta values. Every other field that a block may omit (CHARGE,
RTINSECONDS, the PEPMASS intensity, MSLEVEL, and library fields such as
NAME, SMILES, INCHI) silently kept the value of the previous block, so a
charge-less spectrum inherited its predecessor's precursor charge.
A block without peak lines was not terminated at END IONS: its lines
were merged into the following block, and a trailing empty block was
dropped, which also shifted the 'index=N' native IDs.

getNextSpectrum_() now starts from MSSpectrum::clear(true) and re-applies
the MGF defaults (MS level 2, one precursor, centroided), and returns an
empty spectrum when END IONS is reached before any peak line. Header
parameters outside the blocks were never applied and still are not; the
class documentation says so now.

Adds four class-test sections: no carry-over of charge, intensity and
RT; library fields are not inherited; an empty block is neither merged
nor dropped; header parameters are not applied.

Tracked in OpenMS#10148.


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
…LL search path (OpenMS#10141) (OpenMS#10146)

* [pyOpenMS] Fix Windows stub generation and wire pyopenms_stubs into the build (OpenMS#10141)

Type stubs were never produced during a wheel build: pyopenms_stubs was in
neither ALL nor reachable from the aggregate pyopenms target, so
PYOPENMS_GENERATE_STUBS=ON only defined a target nobody built. Wiring it in
failed on Windows with an opaque

    ImportError: DLL load failed while importing _pyopenms_analysis:
                 The specified module could not be found.

for every extension module.

Root cause: OpenMS.dll has a load-time import of libcurl.dll in this build.
The prebuilt Windows contrib links curl statically, but the wheel workflow
rebuilds it with BUILD_SHARED_LIBS=ON, and CMake installs the DLL to
<prefix>/bin while only the import library goes to <prefix>/lib. contrib/bin
appeared in no search list anywhere, and since Python 3.8 the loader resolves
an extension's dependent DLLs only from the module directory, System32 and
os.add_dll_directory() entries -- never from PATH.

The same omission affects delvewheel, which does not fail on a dependency it
cannot find in --add-path: it falls back to the ambient %PATH% and had been
vendoring an unrelated vcpkg-built libcurl 8.13.0-DEV from the runner image,
pulling in a second, mingw-built zlib1.dll next to contrib's zlib.dll. Every
Windows wheel published so far carries that foreign libcurl.

Changes:

* Collect the Windows DLL directories once, in _pyopenms_windows_dll_dirs(),
  instead of in two hand-rolled lists that were each built from
  OPENMS_CONTRIB_LIBS and QT_INSTALL_BINS -- neither of which is defined when
  src/pyOpenMS is the top-level project under py-build-cmake. The list now
  derives bin/ and lib/ from every CMAKE_PREFIX_PATH entry (variable and
  environment), the same transform cmake/package_general.cmake uses to feed
  install(RUNTIME_DEPENDENCY_SET), which is what picks up contrib/bin without
  anyone having to name it. Caller-supplied PYOPENMS_DLL_PATH is preserved.
* Run the stub generator through `cmake -E env` with that path, using
  $<SEMICOLON> and VERBATIM so the ';'-separated value survives as a single
  argument under both the Ninja and Visual Studio generators.
* Make pyopenms_stubs a dependency of the aggregate pyopenms target, ordered
  after the dependency copy/fix step so bundled libraries are in place first.
* Add check_bindings.py, run before stubgen: it requires every expected module
  to import (pyopenms/__init__.py only raises when none import, so stubs could
  silently describe half an API) and, on failure, reports the DLL search path
  in effect, what each directory holds, and -- via dumpbin -- the dependency
  names that resolve nowhere, instead of leaving the loader's message.
* Stop copying py.typed unconditionally. nanobind.stubgen writes the marker
  itself (-M) only after producing stubs, so a wheel can no longer advertise
  types it does not ship; stale .pyi/py.typed are cleared when stubs are off.
* Turn the "stub generation will fail" warning into a decision: fatal when
  py-build-cmake is packaging, otherwise disable stubs and say so, so an
  in-tree build with an unimportable nanobind keeps working.
* Add contrib/bin to delvewheel --add-path (first, so the libcurl we built
  wins) and to the pyopenms_copy_deps lookup dirs; pass -v so the per-DLL
  resolution is in the log next time.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Note the runtime-DLL provenance change from adding contrib/bin

The prebuilt Windows contrib carries the MSVC redistributable in contrib/bin,
so putting that directory on delvewheel's --add-path also moves msvcp140.dll
from System32 (14.51) to contrib (14.44). Checked before relying on it: both
export the same 1515 symbols and cover all 244 the built modules import, and
contrib's bin/zip.dll and lib/zip.dll are byte-identical, so nothing else
changes. Recorded so the hash change in the vendored runtime is not a surprise.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Address review of the stub-generation wiring

Findings from an adversarial review of the previous commit, each reproduced
before fixing:

* Probe nanobind_backend at configure time. In split mode every extension
  imports it at module init and it ships as a separate distribution, so an
  interpreter with nanobind but not nanobind-backend now failed the DEFAULT
  build instead of just the tests -- the opposite of what the escape hatch
  promised. Feeds the existing fatal-when-packaging / disable-otherwise path.
* Drive pyopenms_stubs from a stamp file. A bare add_custom_target is always
  out of date; under the aggregate target it re-imported the package and
  re-ran stubgen and fix_stubs.py on every no-op rebuild. The custom command
  depends on the extension targets (file-level, so a rebuilt module
  regenerates), the Python sources, and the three helper files; the stamp is
  touched last and lives outside the package directory. Verified under
  Ninja: no work on an unchanged rebuild, regeneration on a touched module or
  .py source, and regeneration after stubs are switched off and on again.
* Ship check_bindings.py in the sdist. py-build-cmake's include list is an
  allowlist (the module is generated = "package"); fix_stubs.py and
  stubs.patch were listed, the new sibling was not, so a wheel built from an
  sdist died in the first COMMAND of the stub target.
* Stale-stub cleanup is now recursive: stubgen -r also writes
  pyopenms/addons/*.pyi, which install(DIRECTORY) picks up just the same. The
  stamp is removed too, or turning stubs back on would regenerate nothing.
* Drop the QT_INSTALL_BINS/QT_INSTALL_LIBS entries and correct the comments
  that claimed a WITH_GUI build defines them: they are set only by
  cmake/knime_package_support.cmake, which the root project includes after
  add_subdirectory(src), so they were empty here in every configuration.
* check_bindings.py: include the interpreter's directory (and DLLs/) in the
  search list -- python3.dll is a load-time import of every stable-ABI module
  and would otherwise be reported as unresolvable fifteen times over -- and
  tell the caller how to supply a missing directory.
* fix_stubs.py: read and write the .pyi files as UTF-8, which is what stubgen
  writes. Now that this runs on Windows CI, the cp1252 locale default would
  fail on the first docstring containing a byte cp1252 leaves undefined.
* pyproject.toml: the nanobind-backend comment said the stub target is only
  built explicitly; it is part of the default build now.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [DOC] Changelog entries for pyOpenMS stub generation and the Windows libcurl fix

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Use the shared DLL directory list for dependency copying on Windows

Review findings on OpenMS#10146:

* pyopenms_copy_deps searched a contrib-only list that, in a standalone build
  (OPENMS_CONTRIB_LIBS unset), came out as /bin;/lib;/lib64 -- while the stub
  preflight's search path did cover contrib/bin. With NO_DEPENDENCIES=OFF the
  preflight would therefore have passed a package about to ship without
  libcurl.dll. On Windows the copy step now takes the same list as the
  preflight and the ctest suite; verified that the $<SEMICOLON>-joined value
  reaches the -P script as a proper list, with generator expressions resolved,
  under both Ninja and Make. Other platforms keep the contrib layout as before.
* check_bindings.py carries the $Maintainer:$ marker AGENTS.md asks of every
  file preamble, and the two functions without docstrings have them.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Ship the dependency-bundling scripts in the sdist

pyopenms_copy_deps.cmake and mac_fix_dependencies.rb are run from the source
directory by the NO_DEPENDENCIES=OFF targets, but were missing from
py-build-cmake's sdist allowlist -- the same omission check_bindings.py had.
A build from the sdist with dependency bundling on failed at the copy step.
Pre-existing; flagged by review on OpenMS#10146.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Clear py.typed and the stub stamp before regenerating stubs

A failed preflight or stubgen run left the py.typed of an earlier successful
run in the build directory, so an install performed after a failed build
would still have advertised types. Remove the marker and the stamp as the
first step of the stub command; stubgen's -M writes the marker back only
after it succeeds, and without it the package is untyped under PEP 561
whatever stale .pyi files remain. Verified in a scratch build: a failing
preflight now fails the build and leaves neither file; a subsequent
successful run restores both. Flagged by review on OpenMS#10146.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Do not generate stubs in a sanitizer-instrumented build

With PYOPENMS=ON and ADDRESS_SANITIZER=ON the default build now ran the
stub preflight and nanobind.stubgen, which import the instrumented
extensions (and libOpenMS behind them) into an ordinary interpreter. ASan
refuses that at load time unless its runtime was loaded first ("ASan runtime
does not come first"), so the build failed after compilation -- a regression
against the days when the stub target was never built. Supplying the runtime
(LD_PRELOAD of a compiler-specific libasan, leak detection off, another
mechanism on macOS) is fragile and nothing else in the project needs it, so
an instrumented build simply builds no stubs, through the existing
prerequisite path: a warning and PYOPENMS_GENERATE_STUBS=OFF in-tree, fatal
only when py-build-cmake is packaging. A -fsanitize= flag handed to the
build directly is treated the same way. Each disable reason now carries its
own remedy instead of a nanobind-specific hint that did not fit. Review
finding on OpenMS#10146.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [pyOpenMS] Detect sanitizer flags in the active configuration's flags too

CMake applies CMAKE_CXX_FLAGS_<CONFIG> on top of CMAKE_CXX_FLAGS without
folding it in, so a Debug build handed -fsanitize=address through
CMAKE_CXX_FLAGS_DEBUG passed the guard added in the previous commit and ran
the stub preflight against instrumented extensions anyway. Check the
variables that can actually take effect: the selected configuration's on a
single-config generator, every configuration's on a multi-config one --
rather than all four unconditionally, so an unused Debug configuration
cannot turn a Release packaging build fatal. Review finding on OpenMS#10146.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

* [FIX,BUILD] Generate valid free_mem stubs and validate stub syntax

Replace fallback lambdas with named functions so nanobind does not emit
invalid definitions or re-exports. Parse post-processed stubs before writing
py.typed and the build stamp, and cover the original failures in tests.

Validated on Windows by regenerating all 44 stubs from the existing PR wheel:
zero syntax errors and six regression tests pass. The validator rejects the
original broken stubs; Linux wheel stubs already parse, while macOS exhibits
the same fallback-lambda issue.

* [TEST] Find the stub regression tests' inputs in every test layout

The wheel test job runs the suite from a sparse checkout that holds only
tests/ and the test data next to an installed wheel, so the five tests
that read pyopenms/_sysinfo.py and fix_stubs.py from the source tree
failed with FileNotFoundError on every Linux and macOS interpreter.

Resolve the package's helper through the import system, which finds it in
the installed wheel and the in-tree build alike, and check fix_stubs.py
out alongside tests/ in that job, since it is build tooling that ships in
no wheel. Verified in a simulated sparse checkout with an installed
stand-in package and in the in-tree layout (6 passed each); without the
checkout entry the three post-processor tests fail as they did on CI.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VfWCpgxj1xgtEFWeQNeoMi

---------

Co-authored-by: Claude <[email protected]>
…-02) (OpenMS#10150)

The x/y/z branch of addLinearPeaks_ in TheoreticalSpectrumGeneratorXLMS
and SimpleTSGXLMS passed the already charge-divided position instead of
the charged mono weight to the neutral-loss helper, which subtracts the
loss and divides by the charge again. H2O/NH3 loss peaks of suffix ions
at charge >= 2 therefore sat at (M/z - L)/z instead of (M - L)/z, about
half their true m/z. The a/b/c branch and all cross-linked ion loss call
sites already passed the charged mass; charge 1 was unaffected.

OpenPepXL uses both generators with neutral losses on and linear ions up
to charge 2 by default, so the TOPP_OpenPepXL_1 references change: the
same 12 spectra keep the same top hits, but the y-NH3 peaks at charge 2
now match observed peaks (e.g. TLADVEVNHLK(DSS)CDQFLVAHYR gains a 12th
matched linear ion, y8-NH3 and y10-NH3 at 2+), match_odds/log_occupancy
and thus the xQuest score of every hit shift slightly because the
theoretical spectra now hold different peaks, and one spectrum reports an
additional rank-3 monolink hit that passes the prefilter. The whitelisted
path, date and version fields of the references are kept as they were.
QCCalculator_2, which reads the idXML, is unchanged.

Adds regression sections to both class tests: a charge-independence
check (every charge-2 peak has a charge-1 counterpart at 2*mz - proton)
and the concrete y1-H2O peak of "KS" at charge 2 (44.5233, not 17.7590).

Tracked in OpenMS#10148.


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
…OpenMS#10155)

MapConversion::convert(UInt64, PeakMap&, ConsensusMap&, Size n) clamped
n against MSExperiment::getSize(), which counts the peaks of every
spectrum at every MS level plus all chromatogram points, but filled its
working vector with get2DData(), which collects MS1 peaks only. Whenever
n exceeded the MS1 peak count (n = Size(-1) from
MapAlignerPoseClustering with max_num_peaks_considered -1, the default
1000 on a run with fewer than 1000 MS1 peaks but more peaks in total,
n = exp.size() from FileConverter on MS2-only input) the partial_sort
middle iterator and the copy loop ran past the end of the vector:
undefined behaviour, a crash or heap corruption, or a consensus map
built from garbage with an oversized column header.

The clamp now happens after get2DData(), against the number of peaks
actually collected, and the output is reserved with the clamped n. The
semantics are unchanged: the n most intense MS1 peaks, most intense
first, with the column header size equal to the number of features
written. The header documents that n is capped by the MS1 peak count
and that other MS levels and chromatograms do not contribute.

ConversionHelper_test gains two [EXTRA] sections: a PeakMap with six
MS1 peaks, three MS2 spectra and a chromatogram converted with the
default n, with n between the MS1 peak count and getSize(), and with n
below the MS1 peak count must yield exactly the expected MS1 peaks in
descending intensity order with a matching column header size; MS2-only
and chromatogram-only inputs (n = number of spectra, as FileConverter
passes it, and the default n) must yield an empty consensus map. On the
pre-fix code both sections fail: no crash on GCC 13/libstdc++, but 31
instead of 6 features built from uninitialised memory, 20 instead of 6,
and 3, 15 and 10 instead of 0.

Tracked in OpenMS#10148.


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
OpenMS#10153)

ConsensusMap::split() sized its result vector by the number of column
headers but addressed it with raw map indices: the FeatureHandle map
index, the 'map_index' meta value of assigned and unassigned
PeptideIdentifications, and a hard-coded fmaps[0] in the IsobaricAnalyzer
branch. Column headers are a std::map<UInt64, ColumnHeader> whose keys
need not be contiguous: FileFilter -consensus:map 0 3 keeps the keys
{0, 3}, and a consensusXML may lack <map id="0">. With columns {0, 3} the
vector has two elements and a handle of map 3 called emplace_back on a
FeatureMap beyond the end of the vector (heap corruption, segfault); a
stray index below the size silently filed features under the wrong map.
QualityControl calls split(COPY_ALL) right after loading a consensusXML.

split() now maps every map index to its position among the column
headers (key order) and uses that position at all three sites, so
fmaps[k] is the k-th column header in key order (unchanged for the
contiguous keys 0..n-1). A map index that names no column, including a
missing column 0 for IsobaricAnalyzer data, raises
Exception::ElementNotFound instead of writing out of bounds. The
contract and the exceptions are documented in the Doxygen of split().

ConsensusMap_test gains two [EXTRA] sections: split() with the column
keys {0, 3} and {1, 2} (map 3 ends up in the second FeatureMap together
with its assigned and unassigned identifications), and ElementNotFound
for a handle, an assigned and an unassigned identification without a
column header, and for IsobaricAnalyzer data without columns. The first
section segfaults on the previous code.

Tracked in OpenMS#10148.


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
…penMS#10154)

MzIdentMLDOMHandler::parsePeptideSiblings_ read a Peptide's sequence by
inspecting the first child node of <PeptideSequence>. Xerces creates no
child for an element without content, so the schema-valid
<PeptideSequence></PeptideSequence> and <PeptideSequence/> (which our own
writer emits for a hit with an empty sequence) dereferenced a null pointer
and crashed MzIdentMLFile::load, FileHandler::loadIdentifications and
IDFileConverter. When the first child was a comment or a CDATA section the
code threw "Non Text Node" and a valid sequence was discarded.

Read the sequence with getTextContent(), which joins the text of all
children (CDATA included, comments excluded) and is empty without
children, as the file already does for <Seq>. Trim it once, before the
substitution positions are applied, and throw Exception::ParseError when
nothing is left so that parsePeptideElements_'s existing fallback logs
the problem and stores an empty sequence. Normal sequences parse
byte-identically.

Tests: MzIdentMLFile_test gets fixtures with an empty and a self-closing
PeptideSequence (load succeeds, referencing PSMs carry an empty sequence,
the others are intact), with a CDATA section, a leading comment and
whitespace padding (read like the plain spelling), and a store/load round
trip of a PeptideHit with an empty sequence. Before the fix the first
crashed the test binary and the second lost the sequences.

Tracked in OpenMS#10148.


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
…10149)

PR 10137 (pyOpenMS keyword-default fixes) and PR 10136 (libxml2
link-order fix) already had changelog prose but no (#NNNN) citation.


Claude-Session: https://claude.ai/code/session_01K9eGF6kU31qkokvuGYcPR8

Co-authored-by: Claude <[email protected]>
OpenMS#10152)

* [FIX] ExperimentalDesignFile: reject rows of the wrong width (CPP-059)

Lines of a design file are whitespace-trimmed before they are split, so
a row that ends in an empty cell comes out one cell short. The one-table
parser indexed such a row by header position before its late width check
ran, and the two-table parser stored sample rows without any width check
and later read them past their end in SampleSection::getFactorValue.
Depending on the row this crashed ProteomicsLFQ or MSstatsConverter, or
put garbage into the MSstats/Triqler condition and replicate columns.

Both parsers now check the number of cells of every data row against the
header as written in the file (before the Label/Sample columns that the
parser fills in are appended) and raise a ParseError that names the line,
its content and the expected/actual counts, including the trimming rule.
SampleSection::getFactorValue (both overloads) throws MissingInformation
for a row that has no value for the requested factor instead of reading
out of bounds. Doc comments of the two headers describe the behaviour.

Class tests cover a two-table design whose last sample cell is empty, a
label-free one-table design with an empty Condition cell, a row that is
too long, and the short-row case of getFactorValue.

Tracked in OpenMS#10148.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

* [FIX] ExperimentalDesignFile: say "cells" consistently in the row-width error

The load() documentation spoke of a row with the wrong number of
"records" while the check, its message and the CHANGELOG count
tab-separated cells. Use "cells" in the documentation, the message and
the helper name (review comment on OpenMS#10152).

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

---------

Co-authored-by: Claude <[email protected]>
…make (OpenMS#10158)

* [BUILD] Namespaced CMake exports and a component-based OpenMSConfig.cmake

Export the OpenMS targets under the OpenMS:: namespace (install(EXPORT) and
the build-tree export(TARGETS) alike) and define the same names in-tree via
aliases in openms_add_library(), so OpenMS::OpenMS, OpenMS::OpenSwathAlgo and
OpenMS::OpenMS_GUI mean the same thing for in-tree code, build-tree consumers
and consumers of an installation. OpenMSConfig.cmake adds the un-namespaced
names OpenMS, OpenSwathAlgo and OpenMS_GUI as aliases for existing projects;
the bundled third-party libraries (IsoSpec, Evergreen, eol-bspline,
opentims_cpp, openms_thermo_bridge) exist under the namespace only, so they
no longer collide with a consumer's own targets of the same name.

Rewrite OpenMSConfig.cmake.in:
- The OPENMS_*_DIR variables are evaluated before any dependency lookup.
  They expand PACKAGE_PREFIX_DIR, which every package configuration generated
  with configure_package_config_file() (Eigen3Config.cmake among them) resets
  to its own prefix when included, so with Eigen in another prefix the old
  file reported that prefix as the OpenMS data, lib and bin directory.
- find_dependency() only for the public link interface: header-only Boost and
  Eigen with the versions OpenMS was built against as the minimum, OpenMP when
  built with it. The unconditional Threads lookup, the CMAKE_MODULE_PATH
  prepend of a never-installed Modules/ directory, the empty
  _EXPORT_INCLUDE_BLOCK placeholder and the always-empty OPENMS_ADDCXX_FLAGS
  variable are gone.
- Components: Core and OpenSwathAlgo are always found; COMPONENTS GUI (or
  OPTIONAL_COMPONENTS GUI) finds the Qt6 modules the GUI library was built
  against, so core consumers never need Qt6 and GUI consumers get its link
  interface resolved. check_required_components() closes the file.
- The build options of an installation are reported as OpenMS_WITH_GUI,
  OpenMS_WITH_HDF5, OpenMS_WITH_OPENTIMS, OpenMS_WITH_THERMO_RAW,
  OpenMS_WITH_OPENMP and OpenMS_BUILD_TOPP_TOOLS. The unprefixed WITH_* and
  BUILD_TOPP_TOOLS variables, which shadowed options of the consuming
  project, are not set any more.
- Consuming projects need CMake 3.18 (aliases of imported targets); the file
  says so instead of failing inside add_library().

export(PACKAGE OpenMS) is removed: a no-op under CMP0090 with the 3.24
minimum, and consumers select an installation via OpenMS_DIR or
CMAKE_PREFIX_PATH. The unused cmake/OpenMSConfigVersion.cmake.in is deleted;
the version file has been written by write_basic_package_version_file().

The installed-consumer test project (src/tests/external) now checks the
package contract it relies on: namespaced imported targets, the compatibility
aliases (its static library deliberately still links the bare name OpenMS),
no leaked third-party names, no Qt6 in the core link interface, the data and
library directories pointing into the installation (the library directory is
compared with the imported location of libOpenMS), and, on an installation
built with WITH_GUI, the GUI component including a target linked against
OpenMS::OpenMS_GUI. The example project, the external-code manual page, the
TOPP tool template comment and AGENTS.md link OpenMS::OpenMS.

Verified with a mock installation: the real template configured into a fake
prefix with stub Boost, Eigen3 (using PACKAGE_INIT) and Qt6 packages in other
prefixes, then consumer scenarios for the core package, the GUI component
(required with and without Qt, optional without Qt), unknown components,
a repeated find_package() in one scope, the version file, and configure plus
generate of src/tests/external and the example project. The same mock with
the previous template reproduces the wrong OPENMS_DATA_DIR.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nte1YgbkdVeduzMNuR1hjz

* [BUILD] Stop installing the build's Find modules with the CMake package

cmake/Modules was installed next to OpenMSConfig.cmake and copied into the
build tree so the package's former module-mode lookups (FindLIBSVM, FindCOIN,
FindGLPK, FindHDF5) could run in consuming projects. Those dependencies are
PRIVATE now, the Config no longer prepends the directory to CMAKE_MODULE_PATH,
and the remaining lookups (Boost, Eigen3, OpenMP, Qt6) use package
configurations or CMake's own modules, so nothing reads the installed copy.

Reference OpenMS#10158 in the CHANGELOG entry.

Verified on Ubuntu 24.04 (GCC 13, apt dependencies, Release, WITH_GUI=ON):
the installed-consumer fixture passes from a clean scratch prefix, whose
cmake directory now holds only the four package files.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nte1YgbkdVeduzMNuR1hjz

* [BUILD] Require CMake 3.19 in consumers of the OpenMS package

The Eigen lookup in OpenMSConfig.cmake uses a version range, which
find_package() understands from CMake 3.19 on; the file claimed 3.18 (the
minimum for aliases of imported targets). Raise the check, the documentation
and the example project to 3.19.

Document why the Eigen lookup is shaped the way it is: the fallback stays a
plain minimum because a version file written with SameMajorVersion
compatibility rejects the range 3.4.0...<6 even for Eigen 3.4 itself (both
ends of a range must lie in the same major version; Ubuntu's Eigen 3.4.0
package behaves exactly like that), and an Eigen3::Eigen target that the
consuming project defines itself is accepted as is, like in the OpenMS build.

Wording: the CHANGELOG spells out CONFIG mode, and the test project's README
says when OpenMS::OpenMS_GUI exists (any WITH_GUI installation) and what the
GUI component adds (the Qt6 lookup and OpenMS_GUI_FOUND).

Verified: the installed-consumer fixture passes from a clean scratch prefix
and the example project builds and runs against the build tree.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Nte1YgbkdVeduzMNuR1hjz

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
* Remove the KNIME/GKN package build system

OpenMS no longer ships a KNIME plugin, so the machinery that assembled
one is dead weight. Remove cmake/knime_package_support.cmake and the
cmake/knime/ helper tree (plugin property templates, payload staging
scripts, binaries_*.ini, the mimetypes.xml/mime.types duplicate of
FileTypes, feature icons and license/description blurbs), together with
the 14 custom targets they defined (create_knime_folders, create_ctds,
final_ctds, prepare_knime_payload*, prepare_knime_package, ...).

Two follow-on simplifications in the top-level CMakeLists.txt:

- ENABLE_PREPARE_KNIME_PACKAGE and its BUILD_TOPP_TOOLS guard are gone.
  SEARCH_ENGINES_DIRECTORY stays: the installers use it
  (cmake/install_macros.cmake, cmake/package_general.cmake, and the
  release workflow), so only its KNIME-specific comment is dropped.
- CMAKE_BUILD_WITH_INSTALL_RPATH / CMAKE_BUILD_WITH_INSTALL_NAME_DIR are
  now unconditionally FALSE. They were TRUE only under
  ENABLE_PREPARE_KNIME_PACKAGE, which made a packaging flag change how
  every library in the build tree was linked and, as its own comment
  noted, could leave the build folder non-relocatable.

CTD generation itself is untouched: -write_ctd still feeds Galaxy and
-write_cwl, and remains covered by the TOPPWRITECTD tests.

Also drop two stale lines from cmake/messages.cmake that advertised a
doc_tutorials target and claimed the doc target builds tutorial PDFs;
neither has existed for some time.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Remove the KNIME workflow test CI job

knime_tests.yml installed a KNIME Analytics Platform, pulled the OpenMS
plugin from the abibuilder nightly update site and batch-ran the tutorial
workflows in doc/tutorials/Workflows. With the plugin and that update
site gone, it has nothing left to test.

It could not have passed in any case: executeBatch.sh globs
basic_peptide_*.knwf, and all three matching workflows drive
XTandemAdapter, which OpenMS no longer ships.

The job was workflow_dispatch-only, so nothing else is affected.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Remove the KNIME pages from the OpenMS documentation

Drop the KNIME user tutorial (tutorials/knime-user-tutorial.md plus its
nine sub-pages), the getting-started pages, the bundled
UntargetedMetabolomicsPreProcessing.knwf, and the artwork that only those
pages used: the KNIME-only subfolders of _images/openms-user-tutorial/,
the KNIME logos in _images/introduction/, and _images/advanced-resources/
(Eclipse/KNIME plugin-build screenshots that nothing referenced any more).
Only the three images the TOPPView tutorial shares are kept.

Update the pages that pointed at them: the workflow-editor grid and the
installation logo tables lose their KNIME entries (the five-column tables
become four), the glossary loses the KNIME term, and the developer FAQ
now links to the TOPPView tutorial instead of the removed one. The
adding-a-new-tool page keeps the CTD explanation but points at CWL
generation rather than Generic KNIME Nodes.

conf.py loses the knime_version substitution, which only the removed
tutorial used.

This also fixes a latent bug: index.rst listed
tutorials/knime-user-tutorial.rst while the file was .md.

`make html` builds clean with no warnings.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Remove the KNIME tutorial handout and workflows

doc/tutorials/ was the LaTeX handout and the .knwf workflow collection
used at user-meeting tutorial sessions. Both are KNIME material: ten of
the eleven handout chapters are KNIME walkthroughs (only pyopenms.tex is
not, and doc/pyopenms/ covers that ground in more depth), and all 24
workflows are KNIME workflows.

It was already unbuildable and unmaintained:

- Nothing in CMake built it; the README told you to run xelatex by hand,
  which is how the 2.3 MB TOPP_tutorial.pdf ended up committed.
- Nine of the 24 workflows drive XTandemAdapter, which OpenMS no longer
  ships, so they cannot run against a current build.
- Three handout chapters still walk through XTandem, OMSSA or Fido.
- Version strings in the chapters name KNIME 3.1/3.2 and OpenMS 1.10-2.7.
- Its artwork was a near-duplicate of the Sphinx tutorial's: 41 of 47
  PNG filenames matched, and the files themselves were byte-identical.

Nothing in the repository referenced it any more once the KNIME CI job
and the Sphinx KNIME pages were removed.

History is preserved: this tree was merged in by git subtree from
OpenMS/Tutorials (OpenMS#9024), and that repository still exists, public and
archived, at the commit this was taken from.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Drop the remaining KNIME mentions from prose and comments

Where KNIME was listed as one of several supported workflow systems,
drop it from the list (README, CONTRIBUTING, ARCHITECTURE,
copilot-instructions, the developer tutorial); where it was the only
example given, name Nextflow or Galaxy instead. Remove the KNIME
glossary term from the pyOpenMS docs and the two hub.knime.com /
update.knime.com entries from .lycheeignore.

In the sources these are comments and message text only:

- ToolHandler's categories are still written into CTDs and CWL and still
  group tools in TOPPAS, so only the "KNIME-style" wording changes.
- The macOS PATH hint in JavaInfo/PythonInfo no longer names KNIME.
- OpenNuXL's output_folder description says "workflow users".

No reference or generated file carries any of these strings, so no test
expectations change.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Note the KNIME removal in the 3.6.0 changelog

Flag it as BREAKING under General, point users at the archived
OpenMS/Tutorials repository for the handout and workflows, and state
explicitly that CTD/CWL generation is unaffected.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

* Remove the leftover KNIME screenshots from the docs images

Ten KNIME assets survived the earlier sweep because they live in shared
image directories rather than KNIME-specific ones, and their filenames
are the only place the word appears - a content grep for "knime" never
matched them:

  _images/tutorials/knime/ (9 files)
  _images/run-workflows-with-openms-tools/knime/node-repository.png
  _images/tutorials/metabolomics-preprocessing-knime-workflow.png

All ten were already unreferenced before this branch: no page linked
them at 3befd8e either, so they were dead weight independent of the KNIME
removal. Their parent directories keep their remaining, still-referenced
contents.

`make html` still builds clean with no warnings.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016EDkJ1y33ovdRzm3zJrgZ6

---------

Co-authored-by: Claude Opus 5 <[email protected]>
…penMS#10156)

The comparator of BaseFeature::sortPeptideIdentifications() guarded only
with PeptideIdentification::empty(), which is false for an identification
that carries an identifier or score type but no hits, and then indexed
getHits()[0] of an empty vector (CPP-089). It also sorted the hits of its
operands inside the comparator, so the hits of a feature's only
identification were never sorted (CPP-090), and it took the score
orientation from the left operand, so identifications with different
isHigherScoreBetter() made comp(a,b) and comp(b,a) both true (CPP-091).

The hits of every identification are now sorted in a separate pass, the
score orientation is read once from the first identification with hits
(default higher-is-better) and used for every comparison, and the
comparator takes const references and keys on hit presence:
identifications with hits are ordered best top hit first, hit-less
identifications are equivalent to each other and follow after all
identifications with hits. The sort is stable, so ties keep their order.
The Doxygen documents the resulting order.

BaseFeature_test gains three sections: a hit-less identification with
identifier and score type (segfaults on the old code), a single
identification with unsorted hits, and identifications with opposite
score orientations.

Tracked in OpenMS#10148 (CPP-089, CPP-090, CPP-091).


Claude-Session: https://claude.ai/code/session_01SbAkDNuqgYhqLn716cB3mU

Co-authored-by: Claude <[email protected]>
… (OpenMS#10127)

* Accept CWL file-list inputs in ParamJSONFile::load (OpenMS#10121)

A CWL runner serializes a 'File[]' input as an array of File objects, and the
generated descriptions hand the whole input set to the tool as
'<Tool> -ini cwl_inputs.json'. ParamJSONFile::load read a STRING_LIST tagged
'input file' as node["path"], i.e. one object holding a 'path' array, so an
array threw json::type_error. The tool then exited with INPUT_FILE_CORRUPT,
which made every TOPP tool with an input file list (33 of them) unusable
through its generated CWL description as soon as that list was set.

load() now takes a file list in any of the shapes that occur: an array of
File/Directory objects, an array of plain path strings, and the
{"path": [...]} object that ParamJSONFile::store writes. Single input files
accept an object or a plain string, which is what the 'is_executable' branch
already did for the tools it applies to. Output file lists go through the same
path, so a runner that passes them as File objects is understood too. A JSON
object is now recognized as a parameter section only when it is not a known
leaf, so a file object is read as a value whether or not it carries 'class';
previously '{"path": [...]}' without 'class' was descended into and reported
the non-existent parameter 'x:path'. A value that carries no path at all is
rejected with a message naming the parameter and the accepted shapes, instead
of the bare nlohmann type error.

Tests: ParamJSONFile_test covers the shape matrix (it previously only used an
untagged string list, which took the plain-array branch, which is why the gap
went unnoticed). TOPP_FileMerger_cwl_filelist runs FileMerger on a JSON INI
holding a CWL-shaped file list and compares against the expected output of
TOPP_FileMerger_1; it needs no TDL, because only writing CWL does.
TOPP_FileMerger_cwl_write/_cwl_run generate the description and execute it
with cwltool where ENABLE_TDL is on and cwltool is installed -- the existing
'cwltool --validate' in cwl_generation.cmake only checks that the description
is well-formed, which a description the tool cannot consume passes as well.
All three fail without this fix with the type error from the report.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015WXXaosC57ZViDneXrw3Mz

* Decide sections by the parameter tree alone, not by a 'class' key

Review follow-up on OpenMS#10121.

The traversal kept a 'class'-string test alongside the leaf-entry check when
deciding whether a JSON object is a nested section. That test can only fire
where param.exists(key) is already false, so it never affected a registered
file parameter -- but it did refuse to descend into a genuine section whose
JSON carries a child named 'class', reporting the section itself as an invalid
parameter. Dropping it leaves the leaf-entry check, which answers the question
for every shape a value can take. No non-vendored parameter is named 'class'
today, so this is forward-compatibility, and the check that replaces it is the
one the rest of the change already relies on.

The added test covers it: a section holding a parameter named 'class' loads as
a section. With the 'class' test in place it fails with "Parameter
test:1:section ... is invalid".

CHANGELOG: say which shapes belong to file lists and which to a single file
parameter, instead of listing all of them for both -- {"path": [...]} is a list
shape, a single file takes a path string or an object with a 'path' string.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015WXXaosC57ZViDneXrw3Mz

---------

Co-authored-by: Claude <[email protected]>
…penMS#10157)

* Fix charge-conflict continue in MapAlignmentAlgorithmKD::filterCCs_

The continue only escaped the inner charge-scanning loop, so a
connected component with mixed charge states never actually got
rejected: control fell through to the conflict check with passes
still true. Break the inner loop on conflict and continue the outer
loop explicitly so mixed-charge CCs are skipped.

Fixes OpenMS#9050

* Add regression test for mixed-charge CC rejection in filterCCs_

Builds three connected components across two maps and checks that only
the one mixing charge states 2 and 3 is filtered out, while a component
pairing a known charge with an unknown one (0) is kept. Before the fix
all three passed, so mixed-charge components could feed alignment
points into the LOWESS fit.
…penMS#10162)

* [BUILD] Move the TOPP tool framework into its own library OpenMS_CLI

TOPPBase, ToolHandler, INIUpdater, ParameterInformation, SearchEngineBase,
TOPPExternalToolBase, MapAlignerBase and OpenSwathBase leave libOpenMS and
form the new shared library libOpenMS_CLI (src/openms_cli; target OpenMS_CLI,
installed as OpenMS::OpenMS_CLI with the un-namespaced alias OpenMS_CLI,
package component CLI, export macro OPENMS_CLI_DLLAPI from the generated
OpenMS/APPLICATIONS/OpenMS_CLIConfig.h). Include paths are unchanged.
ConsoleUtils stays in libOpenMS, where IndentedStream uses it.

The only code in libOpenMS that reached into the framework were the CTD and
CWL parameter serializers, which read six tag strings from TOPPBase. Those
now live in the new core header OpenMS/DATASTRUCTURES/ParamTags.h; TOPPBase
keeps its TAG_* members as aliases of them. CalibrationWorkflow included
OpenSwathBase.h without using it. Nothing in libOpenMS depends on the tool
framework any more, so its exported interface is purely scientific and
changes to the framework no longer change the ABI of libOpenMS.

TOPP tools, ExecutePipeline and ImageCreator, the documentation programs and
the code examples link OpenMS_CLI; the GUI library links it publicly because
its applications derive from TOPPBase and discover tools via ToolHandler.
The class tests of the moved classes (and TransformationModelDefaults_test,
which compares against MapAlignerBase) move to
src/tests/class_tests/openms_cli, sharing fixtures and OpenMSTestSupport.cpp
with the core tests. The installed-consumer test installs the new header
component, checks the new target and alias, and builds TestExternalCodeCLI,
a TOPPBase-derived tool of an external project, against the installation.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

* [DOC] Point the developer tutorial's directory tables at OpenMS_CLI

The /src table gains the openms_cli directory, and the core-library table
no longer claims the tool base classes for /src/openms/include/OpenMS/
APPLICATIONS, where only ConsoleUtils remains. The external TOPP-style
consumer test documents its four functions.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

* [BUILD] Build OpenMS_CLI in the wheel workflow before installing the package

The wheel jobs build only the targets pyOpenMS links and then install the
library component and the CMake package. Since the tool framework is its own
library, the installed OpenMSTargets.cmake also describes OpenMS::OpenMS_CLI,
and CMake refuses a package whose imported target points at a missing file:
"The imported target OpenMS::OpenMS_CLI references the file
lib/libOpenMS_CLI.so but this file does not exist" (build-wheels-linux-arm).
Build the library alongside OpenMS and OpenSwathAlgo; it is eight sources
and the bindings still do not link it, so the wheels are unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

* [DOC] Drop the stale utils paths from the developer tutorial

The tool tutorial still created DatabaseFilter under src/utils and registered
it in src/utils/executables.cmake and getUtilList(); the utils were merged
into TOPP long ago, so the paths are src/topp and getTOPPToolList(). The
directory table loses its util row for the same reason.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

---------

Co-authored-by: Claude <[email protected]>
The nightly "Deploy to Bioconda" workflow has failed every run since at
least 2026-09-08 at the "Lint and build OpenMS Bioconda packages" step:

  Error: No such option: --pkg-dir (Possible options: --package-dir)

The installed bioconda-utils only accepts --package-dir; --pkg-dir was
never a valid option for the `build` subcommand. Fix both invocations
(openms-meta and pyopenms builds) to use --package-dir.


Claude-Session: https://claude.ai/code/session_01Jd3gtYfJkhCGy7ziGAZxUB

Co-authored-by: Claude <[email protected]>
…0168)

An empty peptide sequence reaching PeptideIndexing made the Aho-Corasick
search collect hits until memory was exhausted.

PeptideIndexing.cpp:413-430 adds every PeptideHit sequence as a needle,
deliberately: the annotation phase iterates pep_ids with a counter that must
equal the AC needle index ("do not skip over peptides here"). Two inputs end
up empty there -- an empty AASequence (AASequence::fromString("") returns
empty without throwing, so an idXML with sequence="" loads fine) and
StringUtils::remove(seq, '*') on an all-stop-codon sequence.

addNeedle() had no empty check: for "" the character loop never runs, so the
root node is flagged as a hit and the needle is registered there.
compressTrie() points the root's suffix link at itself, and addHits_() walks
the suffix chain with `while (collect()) i = trie_[i].suffix`, so at the root
with has_hit == 1 that never terminates, appending a hit per iteration. It
trips on virtually any protein: as soon as the primary falls back to the root,
addHits_ starts spinning. The original symptom in the report -- a flood of
"start of peptide is beyond end of protein" warnings from
EnzymaticDigestion::isValidProduct_() -- came from the same spurious root
hits; the process now dies before reaching them.

addNeedle() now returns early for an empty needle, warning once (identical
lines are collapsed by LogStream into "<...> occurred N times") and still
incrementing needle_count_, so the caller's 'i-th needle has index i'
invariant holds without a mapping vector and the annotation phase is
unchanged. An empty hit is simply reported as unmatched, i.e. pipelines keep
running and 'unmatched_action' decides what happens to it.

Tests: AhoCorasickAmbiguous_test covers addNeedle("") (accepted, consumes an
index) and searching a trie built with empty needles interleaved -- the same
hits as the equivalent trie without them, so the indices of the other needles
are unaffected -- plus an all-empty trie, which finds nothing instead of
running out of memory. PeptideIndexing_test maps a peptide list holding empty
sequences before, between and after the real ones, under both 'warn' and
'remove' unmatched_action. All of them hang or die on bad_alloc without this
fix.


Claude-Session: https://claude.ai/code/session_01Bi5ey4MEnTWT9gQTwZHKrk

Co-authored-by: Claude <[email protected]>
…d install components (OpenMS#10164)

* [BUILD] Layer the installed package: core, CLI and GUI export sets and install components

libOpenMS_CLI and libOpenMS_GUI get their own export sets (OpenMSCLITargets,
OpenMSGUITargets) and install components (library_cli/cmake_cli,
library_gui/cmake_gui) next to the core set OpenMSTargets (library/cmake),
selected with the new EXPORT_SET argument of openms_add_library(). Each
layer's target file refers to the layer below by its OpenMS:: names.
OpenMSConfig.cmake includes the target files of the layers an installation
contains, reports them with OpenMS_CLI_FOUND and OpenMS_WITH_GUI (true only
when the GUI library is installed) and refuses a required CLI or GUI
component that is missing. A core-only installation is therefore a
consistent package on its own: the pyOpenMS wheels build and install
libOpenMS and libOpenSwathAlgo only again.

- The installed-consumer fixture installs the full development package
  (core and CLI layer, plus the GUI layer of a WITH_GUI build) for
  src/tests/external, which now requests COMPONENTS CLI, and a core-only
  installation (the components of the wheel builds) for the new
  src/tests/external/core_only project, which checks that the package works
  without the other layers, reports them absent and rejects a required CLI
  component.
- deb/rpm packages list library_cli (and library_gui); the macOS
  productbuild installer fixes up and signs every library component; the
  new components have CPack descriptions.
- Docs, AGENTS.md and CHANGELOG updated.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

* [DOC] Qualify the CLI/GUI aliases by installed layer; REQUIRED in the component examples

Review on OpenMS#10164: the un-namespaced aliases OpenMS_CLI and OpenMS_GUI exist
only when their layers are installed, and the documented component requests
use REQUIRED so that a missing layer fails the consumer's configuration.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

* [BUILD] Drop stale layer export files on reconfiguration; export(EXPORT) for the build tree

Review on OpenMS#10164: openms_export_targets() skipped an empty export set but left
the file an earlier configuration of the same build directory had written, and
OpenMSConfig.cmake takes a layer's target file as that layer being available.
Reconfiguring a WITH_GUI=ON build directory with WITH_GUI=OFF therefore kept
OpenMSGUITargets.cmake, and a build-tree consumer saw a GUI target that is no
longer built, with a required GUI component wrongly satisfied.

An empty set's file is now removed, and the package config loads the GUI layer
only when this configuration built the GUI library, so neither a stale build-tree
file nor one left in an installation prefix can claim the layer.

The build-tree export now uses export(EXPORT <set>) instead of listing the
targets again, so it exports exactly the targets of the installation export set
(the generated files are unchanged); the registry of the macros only records
which sets have targets, since exporting an empty set is an error.

src/tests/package_layers is the regression test: a stub project that uses the
real macros and package template with stub libraries, so the layers of a build
tree can be checked in seconds. Its tests configure with WITH_GUI=ON, probe the
package, reconfigure the same directory with WITH_GUI=OFF, probe again (no GUI
target, no GUI claim) and check that a required GUI component is then refused.
Verified against the pre-fix macros: the second probe fails there.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GCuLiRb3zGghnZy7Gs1dR5

---------

Co-authored-by: Claude <[email protected]>
* [BUILD] Keep private dependencies and dev-tool headers out of the install

Docs: AGENTS.md said CMake 3.21 while the root CMakeLists.txt (and AGENTS.md
itself, 30 lines up) require 3.24. src/tests/external/README.md claimed
consumers need 3.19, but that fixture's own CMakeLists.txt requires 3.22 --
which is what the installed-consumer test actually exercises.

The class-test framework headers were installed by a plain `cmake --install`
although the archive they belong to is EXCLUDE_FROM_ALL and the target is not
exported, so an installation carried ClassTest.h and friends with no library
to link them against. install_headers() now takes an optional
EXCLUDE_FROM_ALL and src/testframework passes it, mirroring the flag already
on install(TARGETS ...). macOS productbuild enumerates components by name and
so ignores the flag; it now drops OpenMSTestFramework_headers the same way it
already dropped the archive. Explicit
`cmake --install . --component OpenMSTestFramework_headers` still works.

SIMDe.h and MatrixEigen.h move to the private (non-installed) header lists.
Both already documented themselves as internal, neither is included by
another installed header or by the nanobind bindings, and both are reached
only from .cpp files and class tests. They stay in include/, so the in-tree
build is unaffected; only installation changes. Eigen stays in
OpenMSConfig.cmake's find_dependency for now, since a static OpenMS can still
reference Eigen3::Eigen from its exported link interface.

GzipIfstream.h and Bzip2Ifstream.h no longer include <zlib.h>/<bzlib.h>. Each
needs exactly one type: BZFILE is `typedef void BZFILE`, so the handle becomes
a void*; gzFile is `struct gzFile_s *` in zlib and in zlib-ng's drop-in compat
header alike, so a forward declaration suffices. <cstdio> and <cstddef> replace
what the library headers used to drag in (FILE and size_t); the .cpp files
include the libraries themselves.

After this, no installed header includes Eigen, SIMDe, zlib or bzlib. Both
Ifstream headers and their .cpp files were checked to compile standalone with
gcc and clang, in either include order, and the generated install script
installs the test-framework headers only for an explicit --component.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [DOC] State CMake 3.22 as the consumer minimum everywhere

Follow-up to the previous commit, which changed src/tests/external/README.md
to 3.22 (the version its own fixture declares and the installed-consumer test
exercises) and left three other places claiming 3.19.

CHANGELOG, doc/.../link-external-code-to-openms.md and
share/OpenMS/examples/external_code/README.md now say 3.22 as well. The doc's
walkthrough snippet is a verbatim copy of
share/OpenMS/examples/external_code/CMakeLists.txt, so that file's
cmake_minimum_required moves to 3.22 together with the snippet rather than
letting the two drift apart. In practice this costs nothing: building OpenMS
already requires CMake 3.24.

Not changed: the hard guard in cmake/OpenMSConfig.cmake.in still rejects
consumers below 3.19, which is the package's technical floor (non-global
imported-target aliases need 3.18, the Eigen version range needs 3.19).
Raising it would stop OpenMS from being consumed on CMake 3.19-3.21, which is
a requirement change rather than a documentation fix.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [BUILD] Enforce the tested CMake 3.22 minimum in OpenMSConfig.cmake

find_package(OpenMS) rejected consuming projects below CMake 3.19, the
technical floor of the file: the aliases it creates are aliases of non-global
imported targets (3.18) and the Eigen lookup uses a version range (3.19).
Nothing configures a consumer below 3.22, though -- src/tests/external (the
installed-consumer test, on in the CI presets) and
share/OpenMS/examples/external_code both declare 3.22, and the documentation
promises it -- so 3.19 - 3.21 was support claimed for a configuration that is
never exercised. Enforce what is tested instead.

The comment keeps the derivation, so a later reader can tell that 3.18/3.19
are the real feature constraints and 3.22 is a policy choice that can be
lowered again if an older consumer has to be supported and tested.

Narrow in practice: building OpenMS needs CMake 3.24, so only consumers of a
prebuilt OpenMS fall in the window, and 3.22 is what the oldest currently
supported Ubuntu LTS ships. The rejection is the existing
OpenMS_NOT_FOUND_MESSAGE, so it fails immediately and explains itself.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [BUILD] Stop requiring Eigen in consumers of the shared OpenMS package

Review feedback on the PR: with MatrixEigen.h no longer installed, no installed
header includes Eigen, so a C++ consumer of the shared library has no reason to
need it -- yet OpenMSConfig.cmake still looked it up unconditionally, which made
find_package(OpenMS REQUIRED) fail outright when Eigen was absent.

The CHANGELOG justified that lookup with a static OpenMS referencing
Eigen3::Eigen from its exported link interface. That does not describe what
OpenMS ships: the top-level CMakeLists.txt sets BUILD_SHARED_LIBS
unconditionally and openms_add_library() adds no STATIC override, so the
release and wheel builds produce shared libraries on all three platforms (the
Windows static triplet governs third-party dependencies, not libOpenMS itself),
and Eigen is header-only, so there is no Eigen runtime to deploy either way.

Checked against CMake rather than assumed: for a SHARED library CMake omits the
PRIVATE dependencies from the exported link interface entirely, while a STATIC
one keeps them as $<LINK_ONLY:Eigen3::Eigen>, which must resolve to a target in
the consuming project. So the lookup is now gated on the library configuration
the producer records, in the new OpenMS_BUILT_SHARED_LIBS, instead of running
for every consumer; a static export stays consumable. Eigen discovery for
building OpenMS itself is untouched, and pyOpenMS already finds Eigen
explicitly. The stale comment citing MatrixEigen.h goes with it.

Two checks cover this. The consumer fixture asserts that a shared
OpenMS::OpenMS names no Eigen in its link interface, alongside the existing Qt6
assertion; and TestExternalCode_noeigen_configure/_build configure and build the
same consumer against the same installation with
CMAKE_DISABLE_FIND_PACKAGE_Eigen3=TRUE. A reintroduced find_dependency(Eigen3)
reports the package as not found there, and a dangling Eigen3::Eigen in
OpenMSTargets.cmake is diagnosed when the consumer's build system is generated.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [TEST] Run the Eigen-free consumer check only for shared builds

Review finding from CodeRabbit, and a real inconsistency in the previous commit:
the fixture assertion was gated on the recorded library configuration, but the
test registration was not.

TestExternalCode_noeigen_* passes CMAKE_DISABLE_FIND_PACKAGE_Eigen3=TRUE. That
is the right check for the shared libraries OpenMS ships, whose export names no
Eigen target. A static OpenMS keeps its private dependencies in the export, so
its OpenMSConfig.cmake does look Eigen up, and find_dependency() inherits
REQUIRED from the consumer's find_package(OpenMS CONFIG REQUIRED) -- disabling
Eigen would make the package not be found and fail the test by design, in
exactly the configuration the gating added in the previous commit exists to
support. Latent rather than live, since the top-level CMakeLists.txt sets
BUILD_SHARED_LIBS unconditionally, but the guard makes the test's precondition
explicit and matches the fixture.

The registered tests are collected in _consumer_tests so the LABELS call names
only tests that exist in either configuration; set_tests_properties() errors on
an unknown test name. The normal installed-consumer tests stay enabled for a
static build.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [BUILD] Keep the recorded library configuration private to OpenMSConfig.cmake

Answers the open question from the review: the shared/static flag the previous
commit introduced is now a private helper, not a documented OpenMS_* variable.

CMake already answers "is this installation shared or static" through the
imported target: get_target_property(OpenMS::OpenMS TYPE) reports
SHARED_LIBRARY or STATIC_LIBRARY on a target loaded from an installed export.
A public variable would be a second source of truth for a fact CMake reports
itself, and a permanent compatibility commitment for the package, so it has to
earn its place; it does not.

This keeps the distinction the config already draws. The public OpenMS_WITH_*
and OpenMS_BUILD_TOPP_TOOLS variables report semantic build options that
nothing else can tell a consumer -- whether HDF5 support was compiled in is not
visible from any target property. The library type is not in that category.
The recorded value survives only because OpenMSTargets.cmake is included after
the dependency lookups, so the property is not available at the point the Eigen
lookup has to decide; it is scoped to that lookup and unset afterwards, the way
CMake's own package-config example treats internal state
(_ClimbingStats_supported_components) and the way VTK unsets its helpers.

The consumer-side assertion in src/tests/external now reads TYPE off the
imported target instead of the variable. That is better independently of this
question: it checks what was actually installed rather than what the producer
recorded, and it demonstrates the idiom consuming projects should use. The
external-code page says so explicitly now that the variable is gone.

Verified: the Eigen lookup still runs only for a static installation and the
private variable does not escape into the consumer's scope; the assertion
passes for a shared export with private Eigen, correctly does not fire for a
static export carrying $<LINK_ONLY:Eigen3::Eigen>, and does fire for a shared
export that leaks Eigen through a PUBLIC link -- so it is not vacuous.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [TEST] Drop the build step of the Eigen-free consumer check

TestExternalCode_noeigen_configure carries the whole diagnostic value; the
build step that followed it carried none, so it is gone.

Measured on a minimal reproduction of this exact shape -- a shared library
linking an imported target privately, an installed package whose config gates
the lookup on a recorded flag, and a consumer project:

* Both regressions the check guards against are reported before anything is
  compiled. A find_dependency(Eigen3) reintroduced into OpenMSConfig.cmake is a
  hard error, since CMAKE_DISABLE_FIND_PACKAGE_Eigen3 refuses a REQUIRED lookup.
  An Eigen3::Eigen left dangling in an exported target file fails with "but the
  target was not found" while the consumer's build system is generated, which is
  part of the same cmake -S -B invocation the configure test already runs.

* Building the tree adds no coverage. Disabling the Eigen package changes
  CMake-level discovery, not compiler include paths, so for a shared
  installation the build system generated with the flag is identical to the one
  generated without it: same compile_commands.json, same link.txt. The build
  step therefore compiled and linked exactly what TestExternalCode_build already
  compiles and links, on every platform that enables
  OPENMS_TEST_INSTALLED_CONSUMER, on every push.

* The one regression that is genuinely compile-time -- an installed header
  including <Eigen/Core> again -- fails in the normal consumer build too, since
  Eigen is a PRIVATE dependency and its include directory reaches no consumer
  either way.

The comment records that reasoning so the step is not reinstated on the
assumption that it covered a link-time case. FIXTURES_SETUP
consumer_noeigen_configured goes with it, as nothing requires it any more.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

* [TEST] Assert the package exposes no Eigen include path either

An adversarial check of the previous commit's reasoning found a regression the
deleted build step did catch, and that nothing else did. It takes two faults at
once, which is why it escaped: an installed header regains an Eigen include,
AND OpenMSConfig.cmake regains a soft, non-fatal Eigen lookup that appends
Eigen's include directories to the imported target instead of naming
Eigen3::Eigen in its link interface. Then nothing dangles, so the configure step
passes; the link-interface assertion passes, because the leak is in
INTERFACE_INCLUDE_DIRECTORIES; and the normal consumer build passes, because
with Eigen findable that leaked path is exactly what resolves the header's
include. Only compiling with the Eigen package unfindable exposed it.

The gap was never configure-versus-build, though: it was that the assertion
inspected one property and the leak was in another. The fixture now also asks
whether <Eigen/Core> resolves from any include directory OpenMS::OpenMS exposes,
which catches the config-side half at TestExternalCode_configure -- earlier than
the build step did, on every platform, and naming the offending directory.

Asked functionally rather than by matching path names, so a build directory
whose path happens to contain "eigen" does not trip it. Verified against a
reproduction of the two-fault package: the assertion fires on it and names the
leaking directory, stays silent on a clean package, and stays silent when the
install prefix sits under a path containing "eigen" (where name matching would
have produced a false positive).

The comment justifying the dropped build step claimed Eigen's include directory
"reaches no consumer either way". That is what the two-fault case breaks, so it
now states the proviso and points at the assertion that covers it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QAxS5426U7wowbp6XZR5Mm

---------

Co-authored-by: Claude <[email protected]>
…penMS#10171)

* StringUtils: return size_t from the string_view whitespace scanners

skipWhitespace(string_view) and skipNonWhitespace(string_view) returned the
scanned length as int. For inputs longer than INT_MAX characters the value
wraps negative, and removeWhitespaces() then builds its iterators from it,
so it reads and writes before the start of the buffer.

Return size_t instead (the offset is never negative) and store it as
size_t in removeWhitespaces().

Tracked in OpenMS#10148 (X-09).

* StringUtils: bound the SIMD loop of the whitespace scanners by the remaining length

The pointer scanners looped with `p <= p_end - 16`. For ranges shorter than
16 characters `p_end - 16` points before the start of the buffer, which is
undefined behaviour (and for an empty std::string_view both pointers can be
null). Compare the remaining length instead; the result is unchanged for
all valid ranges.

Added checks for empty input to both class test sections.
…led (SILAC, Dimethyl) experiments (OpenMS#10047)

* [FEATURE,TEST,DOC] MS1LabeledWorkflow: one-command SILAC/Dimethyl quantification

Adds the MS1-labeling counterpart of ProteomicsLFQ and IsobaricWorkflow. Per run
it detects peptide multiplets (FeatureFinderMultiplexAlgorithm), maps the
identifications onto them, reduces them to one identification per multiplet and
completes/resolves the multiplets; per fraction it aligns and links the runs with
the channels kept as sub-features; fractions are combined column-wise; inference,
FDR and quantification follow ProteomicsLFQ; output is consensusXML, mzTab and/or
a QPX collection.

The tool enforces the constraints that make the hand-rolled pipeline fragile:
fractions are linked separately, a single-run fraction is passed through, the
labels have to be present as modifications in the search parameters of -ids
(hard error, -force overrides), one identification per multiplet and per
identification one multiplet before quantification, -out_qpx is refused up front
for labels outside the QPX vocabulary, and the design's Label column must
enumerate the channels of -labels. "Not quantifiable" (NaN) dummy channels are
reported as missing values, since NaN would poison every derived abundance and
the QPX writers refuse non-finite intensities.

The multiplet completion and quant/ID conflict resolution of MultiplexResolver
is extracted into the library class MultiplexResolverAlgorithm (with class test
and pyOpenMS binding), shared by the tool and the workflow; the MultiplexResolver
outputs are unchanged.

Tests use a synthetic SILAC duplex fixture on the existing MS1-only multiplex
test run: identifications consistent with its four doublets, a FASTA with
reversed decoys, a 2x2 fractionated design, plus the refusal paths.

Closes OpenMS#10044

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FEATURE,TEST] MS1LabeledWorkflow: optional match between runs

Adds -match_between_runs (default false). When set, complete multiplets without
an identification are kept after the resolver instead of being dropped, so that
the QT linking (use_identifications) can hand them the identification of a
multiplet at the same position in another run. Multiplets that stay unidentified
are still not quantified. This is the SILAC equivalent of ProteomicsLFQ's
-targeted_only false and of MaxQuant's MULTI-MATCH evidence.

The switch is refused together with -algorithm:knock_out: with knock-outs the
channel order of a multiplet is only established from its sequence, which an
unidentified multiplet does not have.

Tests: two runs of which one lacks the identification of a doublet, once with
and once without the switch (the doublet gains the second run's two channels
and the protein its abundances in that fraction group), plus the knock-out
refusal.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FEATURE,IO,TEST] MS1LabeledWorkflow: peptide identity without labels, label state in outputs

The linker compares identifications as full peptidoforms, so a multiplet identified
by its light spectrum in one run and by its heavy spectrum in another was treated as
two peptides: not linked, and reported twice at peptide level. The peptide identity
is now the unlabeled sequence, as in MaxQuant: once the resolver has used the label
set, the label modifications of -labels are removed from every identification of
the run (quantified and unassigned). Removing them can make a light and a heavy
match of one scan identical, which is also the QPX psm key, so such repeats are
reduced to the quantified, else the best-scoring one.

The label state stays documented: every PeptideHit carries labeled_sequence (as
searched), removed_labels (e.g. Lys8, or none) and label_channel (1-based, the
design's Label; 0 if undetermined); every quantified consensus feature carries the
same three values for the identification it is quantified under; every column
header describes its channel's labels in channel_description. mzTab reports the
values as opt_global columns of the peptide and PSM sections.

QPX: the feature and psm views write these values into the previously empty
cv_params column (ArrowIOHelpers::qpxCvParams, an explicit key list), so a PSM and
a feature's identification are traceable to their channel and, through run.parquet,
to their sample. Identifications without a label state keep a null cv_params; the
pinned QPX dumps of IsobaricWorkflow, ProteinQuantifier and ProteomicsLFQ are
unchanged.

Test: one run identifies a doublet light, the other heavy; they now link into one
consensus feature with four sub-features. The consensusXML, mzTab and QPX psm dump
are pinned.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FEATURE,IO,TEST] PSM-level output reports the peptidoform as searched (MS1LabelState)

MS1LabeledWorkflow reduces every identification to the unlabeled peptide identity.
PSM-level output describes the spectrum match, though, so it now reports the
peptidoform the hit was matched with: the mzTab PSM section (sequence,
modifications, calculated m/z, peptidoform column) and the QPX psm view (every
sequence-derived column and the psm identity), while feature-level output keeps
the peptide identity. The feature view derives its psm_ids from the same matched
peptidoform, so the feature<->psm links stay reciprocal. With distinct PSM
peptidoforms the light and heavy match of one scan no longer collide on the psm
key, so the workflow's reduction of such repeats is dropped again.

The new MS1LabelState header holds the three meta-value keys (labeled_sequence,
removed_labels, label_channel) and the matched-sequence accessor, shared by the
workflow, ArrowIOHelpers, MzTab and both QPX views. A hit without a label state is
exported exactly as before; the pinned dumps of the other tools are unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FIX,TEST,DOC] MS1LabeledWorkflow: keep a spectrum match on the closest multiplet and channel

The workflow reused IDConflictResolver's between-feature rule, which the standalone
tool keeps off by default: it keys on (peptide, charge) and keeps the most intense
feature. That discards a genuine second multiplet of a peptide (two elution peaks with
their own spectra) and, for one spectrum mapped onto neighbouring multiplets, "most
intense" is the wrong criterion. It ran after the per-multiplet choice, too, so a
multiplet could first take a neighbour's better-scoring spectrum and then lose it.

Now, right after ID mapping: every identification is attached to the channel closest
to its precursor (IDMapper records the first channel within tolerance, the resolver
reads the index as the channel the spectrum belongs to), and a spectrum mapped onto
several multiplets stays on the closest one only. Distinct spectra of one peptide on
distinct multiplets are all kept; their channel values add up per peptide and charge.

Test: with an absurd m/z tolerance every identification of doublets 2 and 3 lands on
both of them, and each spectrum also matches both channels of its own doublet. The
output has to equal the reference produced with the default tolerance.

Also documents how ratios relate to the per-channel abundances (ratio of aggregates
vs. median of peptide ratios), that zero-intensity dummy channels are left out of
the protein aggregation, and that consensus:normalize forces the median channel
ratio to 1.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FEATURE,IO,TEST,DOC] MS1LabeledWorkflow: MaxQuant-style channel ratios, computed by the tool

A labeled experiment measures its channels in one run, so its quantity is their
ratio, and the ratio of a multiplet is measured far better than either of its
channel intensities. The workflow now computes ratios the way MaxQuant does,
by default and without a ProteinQuantifier run:

  - evidence ratio, per multiplet and run: a channel over the reference channel
    (ratios:reference_channel, the light one by default). Only positive, finite
    channels take part; an absent (dummy) or not-quantifiable channel is no
    measurement of a ratio.
  - peptide ratio: the median of the evidence ratios within one fraction group.
  - protein group ratio: the median of the peptides' ratios, from
    ratios:min_ratio_count peptides upwards (MaxQuant's "min. ratio count", 2),
    with the number of contributing peptides.
  - every ratio also divided by the median peptide ratio of its (fraction group,
    channel), i.e. normalized on the assumption that most peptides do not change.

This is deliberately not the ratio of the abundances ProteinQuantifier reports,
which is a ratio of per-channel aggregates and weights peptides by intensity.
Both are now reported side by side, as MaxQuant does: the abundance columns
become plain summed intensities (top:N 0, top:aggregate sum) instead of the
label-free median of the top three.

The ratios are annotated on the consensus features and the protein groups, so
they reach the consensusXML, the mzTab peptide section as opt_global columns,
and the QPX pg view, whose previously empty cv_params column now carries the
ratio of that (protein group, fraction group, label).

The quantifier lives next to the tool in src/topp/MS1LabeledWorkflow/, using the
subfolder mode of the TOPP build; MS1LabeledWorkflow.cpp moved there unchanged.

Test: the fixture's doublets have known H/L ratios, so PROT_A's ratio is the
median of its two peptides and PROT_B's comes from a single peptide, which the
default minimum ratio count excludes and the new test admits.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [IO,TEST,DOC] QPX pg view: channel ratios as additional_intensities, reference channel at 1.0

The ratio of a channel is a further quantity of that channel, so it belongs in
the typed, label-keyed additional_intensities column that QPX provides for
exactly that, not in the free-form cv_params where it was first written. Each pg
row now carries one additional_intensities entry under its own channel label,
with ratio and ratio_normalized; cv_params keeps ratio_count, which is a count of
contributing peptides rather than an intensity. Rows of a producer that annotates
no ratios are written as before.

The reference channel is reported with the ratio 1.0 it has by construction, so a
consumer sees a complete set of channels (light/medium/heavy of a triplex, not
just the two non-reference ones). It is emitted only where another channel was
measured against it: a multiplet seen in the reference channel alone is no
measurement of a ratio, and a lone 1.0 would claim otherwise. Since the reference
entry is created at evidence level, the peptide and protein medians carry it
through on their own.

Test: the QPX pg dump of the ratio run is pinned, so the additional_intensities
of both channels of both protein groups are covered.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FIX,INTERNAL,TEST] MS1LabeledWorkflow review follow-ups

Findings of a review of the branch, most of them correctness rather than style:

- The blacklist handed to the resolver was not sorted after FAIMS data had been
  split by compensation voltage and its groups concatenated. The resolver looks
  peaks up through an RT range, so on FAIMS input a dummy channel could have been
  called absent (0) where it was in fact overlapped, silently inventing a ratio.
  Now sorted before use.
- '-ratios:reference_channel' was not validated against '-labels': a channel that
  does not exist yielded no ratios at all rather than an error. Rejected up front,
  with a test.
- The QPX pg view wrote ratio_normalized even when the producer had not
  normalized, repeating the raw ratio under a name that claims otherwise. Only
  written when it exists; the quantifier likewise writes no normalized arrays
  with 'normalize false', which is what the updated reference shows.
- Protein-group assignment was O(groups x peptides) with a set built per group;
  it now resolves each peptide once through an accession -> group index. A second
  run() replaces the ratio arrays instead of appending a second copy of them.
- The label-state meta values were looked up by name inside the per-row loops of
  the feature and psm exporters, taking the registry lock on every hit of every
  row. MS1LabelState::Keys resolves the three indices once per table, matching
  what the surrounding code does for its own keys.
- The mzTab PSM row copied the whole PeptideHit to swap in the matched
  peptidoform; it now sets the sequence on the copy the function already owns.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

* [FIX,IO,DOC] QPX feature view: no mass error where channel 1 carries a label

The feature view computed calculated_mz and mass_error_ppm from the hit's
sequence, which in MS1-labeled data is the label-free peptide identity: the
label belongs to the channel, so MS1LabeledWorkflow strips it and records the
matched peptidoform as a meta value. observed_mz on the other side of the
subtraction is the consensus centroid, which FeatureFinderMultiplex anchors on
channel 1. Where channel 1 is itself unlabeled the two agree, which is why
SILAC ([][Lys8,Arg10]) reported real errors of a few ppm. Where channel 1
carries a label the calculated mass is short by the whole label mass, and the
quotient was reported as if it were a measurement: for the tool's own documented
dimethyl example ([Dimethyl0][Dimethyl4][Dimethyl8]) a doubly dimethylated
tryptic peptide at charge 2 came out at +33879 ppm.

Dimethyl0 is stripped like any other label, because the generator maps its short
name to the long name "Dimethyl", so this is reachable through -out_qpx for every
dimethyl label set. It went unnoticed because every test uses SILAC and the
feature view is only schema- and row-count-checked, while the psm view is pinned.

Report no error rather than a fabricated one. sequence, peptidoform and
calculated_mz stay on the identity, which is the documented feature-level
contract and the psm view's join key; the psm view and the mzTab PSM section
already compare the matched peptidoform against each spectrum's own precursor
and are unaffected. Isobaric and label-free maps are unaffected too: the guard
requires an MS1-labeled experiment type and a hit that was actually reduced.

Also document the fixture's deliberately mass-inconsistent doublet 4, whose
-2354 ppm in MS1LabeledWorkflow_4_qpx_psm.tsv reads like a data error but is the
quant/ID conflict the case exists to exercise, and point from there to the
unit-level coverage of the same routing in MultiplexResolverAlgorithm_test.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [FIX] MS1LabeledWorkflow: keep Luciphor_global_flr, the mzTab localization score

loadAndCleanupIDFile_ strips PeptideHit meta values down to a whitelist copied
from ProteomicsLFQ, and the copy dropped this key. MzTab.cpp:2549 gates the
MS:1002380 false-localization-rate score on it, while the localized-modification
list it also checks comes from the search parameters, which are not stripped. A
phospho SILAC run (LuciphorAdapter -> MS1LabeledWorkflow) therefore reported the
modification as localized with an empty score, where ProteomicsLFQ on the same
input emits the real value.

The clause is ProteomicsLFQ.cpp:956 verbatim. CalcMass, the other key the
original whitelist keeps, is deliberately not restored: its only consumer is
FeatureFinderIdentificationAlgorithm, which this tool never uses.

No reference output changes; no test fixture carries the key.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [FIX,TEST,DOC] MS1LabelState: a bad labeled_sequence costs that hit, not the export

The accessors parsed the meta value with no error handling. The value survives
consensusXML and idXML as a plain UserParam, so it can arrive edited, foreign, or
stale, and the exporters stream: a throw abandoned a half-written file. Feeding
an edited MS1LabeledWorkflow_1_out.consensusXML to MzTabExporter left a truncated
mzTab holding 3 of 5 PSM rows. An empty value was worse, because it did not throw
at all -- AASequence::fromString returns an empty sequence for it, so the row was
silently dropped (5 rows became 4).

matchedSequence and withMatchedSequence now fall back to the hit's own sequence,
warning once per process. hasMatchedSequence additionally requires a non-empty
value, which is what fixes the dropped row.

Exception::BaseException is caught rather than the individual types: fromString
has three reachable ones and the least obvious is the likeliest here, since
square-bracket notation such as PEPTIDEK[UNIMOD:259] -- the form the QPX
peptidoform column emits -- raises ConversionError, not ParseError or
InvalidValue. The header documented ParseError alone, so that is corrected too,
along with the hasMatchedSequence docs, which claimed it reports a peptidoform
differing from the hit's sequence when it only reports presence.

After this, both exports complete on a corrupted input. One case still fails by
design: falling back to the identity can make the row collide with the sibling
that legitimately carries it, since the light and heavy match of one spectrum
share it, and the QPX psm identity check then refuses the table. Two rows really
do claim the same primary key, and the diagnostic now names that rather than a
parse error.

Tests cover the empty, unknown-modification, square-bracket and non-sequence
values, and add the first coverage of the two index overloads and the
"key not registered in this process" sentinel branch.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [FIX,DOC] MultiplexResolver: resolver tolerances are double, not int

algorithm:mz_tolerance and algorithm:rt_tolerance were registered as integers
although updateMembers_ reads both into double members. Two consequences, and the
second is the dangerous one:

  -algorithm:mz_tolerance 7.5   aborts with a ConversionError that never names
                                the parameter
  <ITEM value="7.5" type="int"> the XML handler reports a NON-FATAL error and
                                stores 0, so the run continues with a zero ppm
                                blacklist proximity check

MS1LabeledWorkflow re-exports both as -resolver:mz_tolerance and
-resolver:rt_tolerance, next to a -algorithm:mz_tolerance from
FeatureFinderMultiplex that has always accepted 6.5 in the same command line, so
a user tightening detection could not mirror it on the resolver.

Both now register as 10.0 / 5.0 with setMinFloat(0.0), matching
FeatureFinderMultiplexAlgorithm.cpp:64-65. The header already declared the
members as double with these values, so no other code changes.

BREAKING for INI files: an entry stored as type="int" now fails Param::update,
which TOPPBase calls with fail_on_invalid_values, so the tool refuses to start
until the entry is changed to type="double". MultiplexResolver_4_parameters.ini
is updated accordingly; it is the only fixture in the repo that carries either
parameter. This follows 63a9426, which changed CometAdapter's
minimum_intensity from int to double and hand-edited its one INI in the same
commit. The write-INI and write-CTD tests diff no checked-in expectation, so
nothing else needed regenerating.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [FIX] PeptideAndProteinQuant: address protein group data arrays by name

annotateQuantificationsToProteins resized the three data-array containers to a
fixed length and addressed slots by index. Two defects followed.

Any array another annotator had appended was truncated away. On this branch that
is MS1LabeledRatioQuantifier's five channel-ratio arrays, which sit at float [4]
and integer [4..6]: re-quantifying a consensusXML written by MS1LabeledWorkflow
silently dropped every ratio from the QPX protein-group view.

And resize() shrinks without clearing, so a second annotation pass appended to
values still holding what had been read from the file. ProteinQuantifier on an
already quantified consensusXML therefore produced a doubled
(fraction group, label) key and the QPX writers refused the whole collection,
writing nothing. That one predates this branch and reproduces with the ratio
arrays stripped out.

Both go away by getting each array by name, appending it when absent and
emptying it before it is filled, which is what the surrounding code already
assumes: ConsensusXMLHandler stores by name, and every reader outside this
function looks arrays up by name. The positional writer only worked because
non-canonical names happen to sort into the expected slots when the loader
appends them.

Reuses OpenMS::getDataArrayByName from KERNEL/SpectrumHelper.h. All ten arrays
are created before any reference is taken, since appending would invalidate one
taken earlier, and they are created in the order the consensusXML writer emits
them rather than the order they are filled, so output ordering is unchanged.

No reference output changes: the 20 checked-in consensusXML files that carry
these arrays and the class tests asserting container sizes of 4, 2 and 4 all
still pass, along with the rest of the ProteomicsLFQ, IsobaricWorkflow,
ProteinQuantifier and MS1LabeledWorkflow suites.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [DOC] Fix the three doxygen warnings this branch introduces

Doxygen_Warning_test is the only failing test on CI, on all five platforms, and
it fails on three warnings, all from this branch.

  MultiplexResolverAlgorithm.h:51: included file
      OpenMS_MultiplexResolverAlgorithm.parameters is not found

The new library class carries @htmlinclude for its parameter table but was never
registered with the documenter that generates those tables, so the file it
includes is never written. Registered next to MultiplexDeltaMassesGenerator.

  MS1LabeledWorkflow.cpp:115: unable to resolve reference to
      'TOPP_FeatureFinderMultiplex:' for \ref command

Doxygen takes a trailing colon as part of the reference target. The same page is
referenced four times earlier in the file followed by a comma and resolves, so
the sentence now uses that form.

  MS1LabeledWorkflow.cpp:169: unable to resolve reference to
      'MS1LabeledRatioQuantifier' for \ref command

That class is compiled only into this tool and is deliberately not part of the
library, so it has no page to link to. It is named in code font instead, which
also makes its scope explicit to the reader.

The doc targets are not configured in every build, so this was diagnosed from the
CI log rather than reproduced locally; the tool and resolver tests still pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [INTERNAL,TEST] Namespace the MS1-labeling meta values with an "MS1Label:" prefix

The eleven meta values this branch adds were unprefixed, so a foreign file
carrying a key called peptide_ratio or labeled_sequence would be read as this
workflow's own. That is not hypothetical: the parse guard in MS1LabelState
exists because an edited labeled_sequence already reached the exporters.

OpenMS already namespaces meta values with a colon (BetaPepEv:pre, OpenPepXL:score,
XFDR:FDR, Comet:db), and such keys demonstrably survive both the XML formats and
mzTab, which emits them as opt_global_<key>. This adopts that convention:

  MS1Label:labeled_sequence            MS1Label:evidence_ratio{,_run,_channel}
  MS1Label:removed_labels              MS1Label:peptide_ratio{,_channel,_count}
  MS1Label:label_channel               MS1Label:peptide_ratio_{fraction_group,normalized}

Only quoted literals and doxygen references were rewritten. The identically named
C++ members of MS1LabelState::Keys and MS1LabeledRatioQuantifier::peptide_ratios_
are untouched.

The five fraction_group_level_ratio* protein-group data arrays keep their names.
They are not meta values, they live in a per-group array namespace rather than the
global registry, they are already prefixed by their grain, and they sit in a family
with fraction_group_level_abundance which the library writes unprefixed.

Reference files were updated by applying the same rename rather than by
regenerating, so any difference beyond the key names would have shown up as a test
failure. Three mzTab references did need regenerating, because the optional
columns are emitted in sorted order and the prefix moves them relative to
opt_global_feature_id; those three were verified cell by cell against the previous
content to confirm nothing but the names and their order changed.

Left as a follow-up: MS1Label:label_channel stutters and would read better as
MS1Label:channel, but renaming and namespacing at once would have made the
reference diff impossible to check mechanically.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [INTERNAL,TEST] MS1Label:label_channel -> MS1Label:channel

The prefix made the old name stutter. Renamed the serialized key, and with it the
constant (MS1LabelState::CHANNEL) and the index-cache member (Keys::channel), so
the C++ names do not drift from the value they hold.

Kept separate from the namespacing commit on purpose: with the prefix already in
place this is a plain rename, so the same edit applies to sources and reference
files alike and any difference beyond the name shows up as a test failure.

The three mzTab references did need regenerating again, for the same reason as
before: optional columns are emitted in sorted order, and "channel" sorts ahead of
the evidence_ratio group where "label_channel" sorted behind it. Verified cell by
cell against the previous content; only the name and its column position moved.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JArjeecGUi7uWefnMEV7cj

* [FIX,TEST] Preserve MS1 label, run and FAIMS identities

Reject channel layouts that disagree with generated mass patterns and
ambiguous input/design basenames before processing. Keep reference-only
protein ratios out when no comparison passes the minimum peptide count.

Treat FAIMS CV as part of feature identity, following IonQuant's
peptide/charge/CV definition and DIA-NN's separate-CV processing guidance.
Recover CVs from spectrum metadata, repair missing references within the
known CV, and isolate ID mapping, blacklist checks and cross-run linking.
Retain the physical run/channel columns and its shared LC alignment.

Add focused class and TOPP regressions. Validated with a native Debug
build, 63 passing workflow/resolver tests, and an end-to-end two-CV mzML
case yielding three correctly identified multiplets per CV.

Research:
https://github.com/Nesvilab/IonQuant/blob/master/CHANGELOG.md#198---2023-05-31
vdemichev/DiaNN#67 (comment)

* [FEATURE,TEST] Support Thermo RAW in MS1 labeled workflow

Accept native Thermo RAW input when WITH_THERMO_RAW is enabled. Decode each RAW
file once, retaining scan metadata for FAIMS and spectrum-reference lookup and
only MS1 peaks for multiplet detection. Repair missing references from loaded
MS2 metadata instead of reopening the input through an XML-only helper.

Add mzML/RAW loading and reference-repair regressions. Native RAW coverage uses
the existing optional Angiotensin fixture via THERMO_RAW_TEST_DATA.

Validated Debug builds with Thermo disabled (65 tests) and enabled (66 tests).
A CLI smoke test with the unlabeled RAW standard matches its converted mzML
baseline, including missing-reference repair and the expected no-multiplet result.

---------

Co-authored-by: Claude Fable 5.1 <[email protected]>
…S#10184)

* [FIX] Packaging: the applications component depends on the library layer it links

Since the TOPP tool framework moved into its own library (OpenMS#10162) and the
installed package was split into core/CLI/GUI layers (OpenMS#10164), every TOPP tool
binary links libOpenMS_CLI, and TOPPView/TOPPAS link libOpenMS_GUI on top of
it. The 'applications' component that holds those binaries declared no
dependency on either, so a component-selectable installation could pick the
binaries without their libraries and end up with tools that fail at startup
with "libOpenMS_CLI.so: cannot open shared object file".

Declare the dependency the way the library layers already declare theirs
(library_cli DEPENDS library, library_gui DEPENDS library_cli): applications
DEPENDS library_gui in a WITH_GUI build, library_cli otherwise.

Refs OpenMS#10183

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KiE8zggiPmtbEWM2S1TWrH

* [DOC] CHANGELOG: record the applications component's library dependency

The 3.6.0 entry on the layered install package documents which components each
layer has; note there that the applications component pulls in the layer its
binaries link, so the layering cannot be selected into a broken combination.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KiE8zggiPmtbEWM2S1TWrH

---------

Co-authored-by: Claude <[email protected]>
…0185)

AASequence::getFormula() and AASequence::getMonoWeight() switch over
Residue::ResidueType but have no case for Residue::Zp1Ion (the radical
"z-dot" ion, the main electron-transfer fragment) or Residue::Zp2Ion, so
both fell through to the default branch: an error is logged and the plain
internal formula/mass is returned, i.e. a value with no ion offset at all
rather than a z ion plus one or two hydrogens.

Both functions also gate the C-terminal modification on an explicit list
of types that omits the two, so even with the offsets in place a modified
C terminus would not have reached them - they are C-terminal fragments and
must carry it exactly as the z ion does. All four sites are fixed together;
getAverageWeight() and getMZ() build on these two and are fixed with them.

Residue already provides getInternalToZp1Ion() and getInternalToZp2Ion();
TheoreticalSpectrumGenerator reaches for them directly rather than going
through AASequence, which is presumably why the gap was never noticed. It
surfaced while reviewing the glycan fragment generator in OpenMS#10181, which
needs z+1 masses for ETD and EThcD.


Claude-Session: https://claude.ai/code/session_01EFVyJ9RokduFiyEXbEoAJY

Co-authored-by: Claude <[email protected]>
* [BUILD,TEST] Migrate public headers to CMake file sets

Preserve CMake 3.22 consumer compatibility and component installation behavior. Add opt-in public-header verification, CI coverage and focused regression tests, and fix non-self-contained headers exposed by verification.

Fixes OpenMS#10177

* [TEST] Simplify header file-set regression coverage

Keep installed-consumer compatibility, generated headers, component exclusions and the JSON guard. Remove the synthetic AUTOMOC and private-dependency fixtures, redundant checksums and build-tree consumer, and reuse the existing CTest toolchain arguments. Accept wrapped JSON diagnostics in the negative check.

* [DOC] Document header file sets and verification

* [BUILD] Require CMake 3.24 for package consumers

* [DOC] Align external developer guide with CMake 3.24
* [CI] Give the build-and-test workflow a read-only token

"Build and Test" runs on pull_request and builds and runs code from the branch
under review, but declared no permissions and let actions/checkout persist its
credentials in .git/config. For a pull request from a branch of this repository
the default GITHUB_TOKEN is write-capable, so code under review could have read
that credential back out and written to the repository.

Nothing in this workflow needs it: no step and neither .github/actions/build
nor .github/actions/dependencies references GITHUB_TOKEN or github.token. The
rsync cache authenticates with its own SSH secrets, and the Actions cache uses
the runtime token, which permissions: does not govern.

The same action chain -- including the git submodule update --init calls for
THIRDPARTY and vcpkg, all three submodules being public over HTTPS -- already
runs with persist-credentials: false in release.yml, so anonymous submodule
fetches are known to work here.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AEjmTqnBURLeb5Xb15fFdx

* Update .github/workflows/test.yml

* [CI] Drop the checkout rationale comment

Second review suggestion from @timosachsenberg on OpenMS#10189. The workflow now
carries the two settings without commentary, matching release.yml; the
reasoning stays in the commit message and the pull request.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AEjmTqnBURLeb5Xb15fFdx

---------

Co-authored-by: Claude Opus 5 <[email protected]>
* [TEST] Check that an installed OpenMS package survives being relocated

The installed-consumer suite installs and consumes, but never moves an
installation, so the one property the relocatable OpenMSConfig.cmake exists
for (OpenMS#4603) was not covered: unpacking a binary package puts it at a prefix
that is never the one the release was built with.

Add TestExternalCodeRelocated_*, which installs into a staging prefix of its
own, renames it -- rather than copying it, so a path baked in at install time
cannot resolve against an original that is still there -- and configures,
builds and runs src/tests/external/relocated against the new location. The
destination has a space in its name, the way "C:\Program Files\OpenMS" does.

The consumer asserts that every directory the package reports lies below the
new prefix (the check that covers OPENMS_DATA_DIR, OPENMS_BIN_DIR and
OPENMS_DOC_DIR, which the component set does not install), that the imported
libraries and their include directories exist there, and that the library it
then loads is the one the package describes. The component set is the
core-only one without share: the shared data relocates through the same
PACKAGE_PREFIX_DIR arithmetic as the directory variables that are checked, so
a third ~200 MB copy would cost more than it proves, and the consumer program
accordingly stays off the shared data.

_openms_add_installed_consumer_tests() grows the keyword arguments COMPONENTS,
RELOCATE_TO and CONFIGURE_ARGS for this; without RELOCATE_TO it builds the
same chain as before.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbTygAEhdouMboSggp3etK

* [TEST] Relocation test: check which OpenMS library the loader actually picked

The run step compared the loaded library's version against the one the package
reports, which a *different* OpenMS of the same version satisfies just as well.
That is not hypothetical here: the build tree of this very build holds an
OpenMS of exactly this version, and the install RPATH of a macOS build names
that build tree outright (CMAKE_INSTALL_RPATH in the top-level CMakeLists.txt).
A relocation regression could therefore have gone unnoticed on the platform
where it is most likely.

Ask the loader which module it resolved -- dl_iterate_phdr(), the dyld image
list, GetModuleHandleA()/GetModuleFileNameA() -- and require its directory to
be the OPENMS_LIB_DIR the package reports, keeping the version check as the
second half. By module name rather than by the address of an exported
function: for a function defined in a shared library, taking its address in an
executable yields the PLT stub inside the executable, so dladdr() would report
the executable instead of the library.

Reported by CodeRabbit on OpenMS#10186.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbTygAEhdouMboSggp3etK

---------

Co-authored-by: Claude <[email protected]>
… them (OpenMS#10192)

* [FIX][TEST] Resolve the package's include directories before checking them

TestExternalCodeRelocated_configure fails on every platform on develop, so every
open PR's "Build and Test" is red:

  an include directory of OpenMS::OpenMS='$<BUILD_INTERFACE:.../relocated
  prefix/include>' is not below the prefix the installation was moved to

Two green PRs that never met in CI. OpenMS#10178 moved the public headers to a CMake
header file set, so the generated OpenMSTargets.cmake now re-creates that file
set on the imported target, and CMake records a file set's BASE_DIRS in
INTERFACE_INCLUDE_DIRECTORIES wrapped in $<BUILD_INTERFACE:...>. OpenMS#10186 then
added the relocation test, which reads that property and treats each entry as a
path. Each was correct against the develop it was tested on.

Nothing is wrong with the installation: the wrapper evaluates to the directory
in every context an imported target is used in -- it is dropped only where a
project exports targets of its own -- so consumers compile and relocate exactly
as before. Only a configure-time reader of the property sees it.

The same property is read a second time, in src/tests/external/CMakeLists.txt,
to assert that a shared installation does not hand consumers a path <Eigen/Core>
resolves from. That check does not fail on the wrapper, it passes on it: there
is no directory left to probe, so it has been vacuous since OpenMS#10178 and would not
have reported the regression it exists for.

openms_package_include_dirs() resolves what the package reports to plain paths
for both: it unwraps $<BUILD_INTERFACE:...>, drops the empty one
openms_add_library() writes for a library without external includes, and adds
the base directories the interface header sets report directly, so the checks
stay independent of how CMake chooses to surface them. Anything else with a
generator expression left in it is an error rather than an entry silently
skipped -- being skipped is how the Eigen check stopped checking.

Verified against a stand-in package built with the same export shape (a header
file set installed with FILE_SET HEADERS, a prefix installed, then renamed to
one with a space in it), driving the two consumer projects themselves:

  relocated/CMakeLists.txt at HEAD -> the CI error above, same wording, same
                                      line
  relocated/CMakeLists.txt patched -> configures
  external/CMakeLists.txt, Eigen/Core planted in the package's include dir:
                           at HEAD -> configures, i.e. the guard is dead
                          patched  -> "OpenMS::OpenMS exposes Eigen through its
                                      include directories"

and the helper itself over a plain path (what a CMake < 3.23 consumer gets from
the same export), a wrapped one, "$<BUILD_INTERFACE:>", a target with no include
directories, a named file set (HEADER_DIRS_<NAME>) and the default one
(HEADER_DIRS), plus a nested generator expression for the error path.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1XXUuHDwnLLqu5VGFgefc

* [FIX][TEST] Review follow-up: drop the file-set traversal, add the maintainer marker

Reviewed simplification: CMake appends the BASE_DIRS of a PUBLIC or INTERFACE
header set to INTERFACE_INCLUDE_DIRECTORIES itself, wrapped in
$<BUILD_INTERFACE:...>, for named and default file sets alike, so walking
INTERFACE_HEADER_SETS and HEADER_DIRS_* found nothing the property did not
already carry. Reading the property and unwrapping is enough, which
list(TRANSFORM)/list(FILTER) say in four lines.

Confirmed rather than taken on trust: the helper's case for a *named* file set
was the one the traversal existed for, and it still resolves to the same
directory without it.

Also adds the $Maintainer:$ preamble marker AGENTS.md requires of every file,
matching TestExternalCodeRelocated.cpp and cmake/install_macros.cmake, the
sibling file of this test family and the install machinery this helper is about.

Validated against a real build this time, not a stand-in: OpenMS configured with
OPENMS_TEST_INSTALLED_CONSUMER=ON against system dependencies (Arrow 25, Boost
1.83, Xerces, CoinOR, libsvm, Eigen), libOpenMS/libOpenSwathAlgo/libOpenMS_CLI
built, ctest -L installed_consumer:

  develop HEAD           -> TestExternalCodeRelocated_configure fails with the
                            CI message verbatim, _build and _run not run
  with this branch       -> 38/38 pass, relocated chain included

and the Eigen guard, with an Eigen/Core planted in the installed package's
include directory so a real installation exposes it:

  develop HEAD           -> 9/9 pass; the guard never fires
  with this branch       -> "OpenMS::OpenMS exposes Eigen through its include
                            directories"

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1XXUuHDwnLLqu5VGFgefc

---------

Co-authored-by: Claude <[email protected]>
Parse and serialize d/v/w ions and da/db/wa/wb subtypes. Preserve the subtype
in annotation equality, peak annotation conversion and Python bindings, and
reject invalid subtype combinations. Add C++ and Python regression coverage.

Addresses the mzPAF stage of OpenMS#10175. Satellite mass calculation and theoretical
spectrum generation remain separate follow-up work.
poshul added 28 commits October 8, 2026 11:32
- Fix EmpiricalFormula::operator< to use atomic numbers instead of pointer addresses for deterministic ordering across platforms
- Update FileTypes_test.cpp for new file count (67) after adding BEDRMOD format
- Add missing FileHandler_bedrmod.bedrmod test file

This resolves CI test failures due to non-deterministic adduct ordering in NucleicAcidSearchEngine tests.
…e safety

Changed BedRModFile to use const Ribonucleotide* instead of String for
modification tracking. This provides:

1. Type safety - compile-time checks instead of runtime string parsing
2. Direct access to origin base via ribonucleotide->getOrigin()
3. Removed inferBase_() function - no longer needed

BedRMod output now shows actual origin bases (e.g., "U" for Um modification)
instead of inferred/unknown bases ("N").

Updated test reference to expect actual origin base instead of "N".
…ith parent. make coverage requirement sclable rather than boolean. disable consecutive scoring bonus,. Change fragment mass delta penalty to gaussian rather than linear
- Introduced 'use_mass_accuracy' flag to apply mass accuracy-based distance weighting in both hyperscore and MVH scoring methods.
- Updated relevant function signatures and implementations to accommodate the new parameter.
…tide preservation in DecoyDatabase; refine preprocessing options in NucleicAcidSearchEngine
…base handling

- Updated output files (idXML, mzTab, bed, JSON) to reflect new scoring and sequence modifications.
- Changed database paths to absolute paths for consistency.
- Adjusted peptide scores in output files to match new calculations.
- Enhanced BED file modification names to include additional modifications.
- Improved JSON structure for search parameters and parent matches.
- Refactored DecoyDatabase to support RNA digestion with RNase options.
- Added handling for q-values in NucleicAcidSearchEngine to indicate FDR status.
…ucleicAcidSearchEngine for deterministic hit ordering
@poshul
poshul merged commit c914a70 into OpenMS:add_bedrmod Oct 8, 2026
2 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.