Repository navigation
[FIX] OpenNuXL: NuXL:oligo_fragment_adducts only takes cross-linkable nucleotides; consistent names of the larger fragment adducts - #10972
Conversation
… nucleotides; consistent names of the larger fragment adducts Follow-up to #10957: - NuXL:oligo_fragment_adducts: refuse nucleotides that are not in NuXL:can_cross_link (ILLEGAL_PARAMETERS). They would get none of their forms (only cross-linked nucleotides get fragment adducts), while the complete adducts would still be added for the other nucleotides. - The complete adduct after loss of water is named like the precursor adducts ("UU-H2O1" instead of "UU-H2O"), so the same shift has the same name for the precursor adducts UU and UU-H2O1. - Tests: the preset value of oligo_fragment_adducts (and none for a preset without it), the names across precursor adducts, and a TOPP test for the refused nucleotide. - share/OpenMS/NUXL/README.md: the oligo_fragment_adducts key. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0149aXmXyW2qWHB36dRtdmSw
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix Merge Risk:
|
timosachsenberg
left a comment
There was a problem hiding this comment.
AI-generated initial review
This is an automated, AI-generated first review. It looks only for high- and medium-priority issues (no nits) and checks whether the PR has tests and measurements. Please double-check anything before acting on it; a maintainer will follow up.
This PR was merged at 18:39 UTC, before this review ran. Anything below that needs a change would go into a follow-up PR. I reviewed 7834220 (merged as 01540e6) against its base ddf4cee (#10957).
There are two changes. NuXL:oligo_fragment_adducts now refuses a nucleotide that is not in can_cross_link, with ILLEGAL_PARAMETERS. The complete adduct after loss of water is now named like the precursor adducts (UU-H2O1 instead of UU-H2O). There are also new unit tests, a TOPP test and the README entry.
What I ran:
- No build: there is no OpenMS build in this environment, and a build from scratch (vcpkg dependencies) wasn't worth it for a merged 46-line change. Its new tests already passed in CI on Linux (g++, clang++, arm) and macOS. So I did not run the tests or the tool myself.
- Code reading:
- the new check in
OpenNuXL.cpp, and howcan_cross_link/can_xl_are filled with and without a preset; getFeasibleFragmentAdducts()andgetAllFeasibleFragmentAdducts();- how precursor adducts are named in
NuXLModificationsGenerator.cpp; - every place that consumes fragment-adduct names:
NuXLAnnotateAndLocate.cpp,NuXLFragmentIonGenerator.cpp, andgetAdductMass2Name()/getMapAAPlusAdductMassToResidueToAdductName()inOpenNuXL.cpp; check_exit_code.cmake.
- the new check in
- Presets: checked
share/OpenMS/NUXL/nuxl_presets.jsonwith a script against the new rule.
Verdict:
- High priority: none found.
- Medium priority: none found.
Tests and measurements
- Tests: provided, and they cover both changes.
NuXLParameterParsing_test:- the preset's
oligo_fragment_adductsvalue; - a preset without the key resets a pre-filled output to empty;
- all expected names updated to
-H2O1; - a direct check that the shift
C18H22N4O16P2is namedUU-H2O1both for the precursor adductUUand forUU-H2O1.
- the preset's
TOPP_OpenNuXL_oligo_fragment_adducts_not_xl: requires exit code 6 (ILLEGAL_PARAMETERS), the new message, and no output file.- No gap: a custom
-NuXL:presets_filewhoseoligo_fragment_adductsnames a non-cross-linkable nucleotide isn't tested separately. It goes through the same check after the preset is loaded, so this isn't needed.
- Measurements: none needed. Scoring is unchanged: larger fragment adducts are deduplicated by formula, so the rename changes no formula or mass that gets added. The new check only affects configurations that are now refused.
- Real data: none reported. Not needed here: no built-in preset is affected (see below), and the rename only changes annotation strings of RNA-UV hits with oligonucleotide adducts.
- CI at merge time: passed on the Linux jobs (g++, clang++, arm), macOS, all three Linux/macOS wheel builds, cppcheck and the header check.
build-and-test (windows-2025, cl.exe)andbuild-wheels-windowswere still running. The new TOPP test sits insideif (NOT MSVC), so Windows doesn't run it, butNuXLParameterParsing_testdoes. Please check the Windows result ondevelop. - PR checklist: "New and existing unit tests pass locally" and the first AI-policy box ("I have read the OpenMS AI Policy, … reviewed and tested every change") are unticked. The description says no local build was possible.
Checked and fine
- No default configuration is refused: all four built-in presets with
oligo_fragment_adductshaveUand listUincan_cross_link. They areRNA-UV (U),RNA-UV (UCGA),RNA-UV Extended (U)andRNA-UV Extended (UCGA). With a preset,can_cross_linkcomes from the preset.can_xl_is filled from it before the check, so the check validates the effective set. - Refused before any work: the check runs before the spectra are loaded and before any output is opened, which the TOPP test's
ABSENT_FILEconfirms. - Names now agree with precursor adducts: precursor adducts are named from
EmpiricalFormula::toString()of each loss (e.g.U-H2O1,C-H3N1-H2O1), so"-" + water.toString()matches. This also holds for the Extended presets. For example, precursorUC-H3N1minus water givesUC-H3N1-H2O1, which is exactly the name of the precursor adduct fromC:-NH3-H2O. - Nothing parses the old suffix: fragment-adduct names are only used as annotation text.
NuXLAnnotateAndLocate.cppsplits on the space between ion and shift, and marker ions get theMI:prefix. Nothing looks for a trailing-H2O. The ambiguity tables are built from the per-nucleotide fragment adducts only and don't contain the larger ones, as the description notes. - No compatibility break: #10957 was merged the same day and is not in a release, so the old
UU-H2O-style names never shipped.
Generated by Claude Code
Description
Follow-up to #10957 (
NuXL:oligo_fragment_adducts), fixing points from a review after it was merged:NuXL:oligo_fragment_adductsonly takes cross-linkable nucleotides. Only cross-linked nucleotides get fragment adducts, so a listed nucleotide that is not inNuXL:can_cross_linkgot none of its forms. Because a non-empty list also turns on the complete adducts, the search still changed for the other nucleotides, silently. Example:-NuXL:presets "RNA-UV (U)" -NuXL:oligo_fragment_adducts Adropped the preset'spUp/U-H2O-H2Oand still addedUU/UU-H2Ofor U. Such a value is now refused withILLEGAL_PARAMETERS, and the parameter description says so.<precursor adduct> + "-H2O", but precursor adducts carry normalised formulas (UU-H2O1). So the same 612.05 Da shift was calledUU-H2Ofor the precursor adductUUandUU-H2O1for the precursor adductUU-H2O1. It is now named like the precursor adducts (UU-H2O1), as the header already says ("named like the precursor adduct").NuXLParameterParsing_test: asserts the preset'soligo_fragment_adductsvalue ("U"forRNA-UV (U), empty forRNA-UV (4SU), which has no such key, even if the output had a value before). It also checks that the shift has one name across the precursor adductsUUandUU-H2O1.TOPP_OpenNuXL_oligo_fragment_adducts_not_xl:CunderRNA-UV (U)is refused with exit code 6 and the error message, and no output is written.share/OpenMS/NUXL/README.mddocuments the optionaloligo_fragment_adductspreset key.Not changed here, and worth separate PRs if wanted:
calculateNucleotideTags_/fragment_adduct2block_if_masses_present). There is no collision for the U forms at 20 ppm, so this is latent.C4H8S2O2) is parsed as an oligonucleotide bygetFeasibleFragmentAdducts. This predates [FEATURE] OpenNuXL: larger fragment adducts for oligonucleotide adducts (NuXL:oligo_fragment_adducts) #10957.Output of the existing TOPP tests is unaffected: only
TOPP_OpenNuXL_7uses an RNA-UV preset, and it checks no fragment adduct names.Testing: this was written where OpenMS could not be built, so locally only syntax-only compiles (
g++ -std=c++20 -fopenmp -fsyntax-only -Wall, stub config headers) ofOpenNuXL.cpp,NuXLParameterParsing.cppandNuXLParameterParsing_test.cppwere run (clean). CI on 7834220:build-and-test (ubuntu-24.04, g++)ran all 3602 tests, all passed, includingNuXLParameterParsing_test,TOPP_OpenNuXL_oligo_fragment_adducts_not_xlandTOPP_OpenNuXL_7; the clang++, ubuntu-arm and macOS builds, the Linux/macOS wheels,cppcheck-testandheader-set-compatibilitypassed too. The Windows build and wheel were still running when this was written.Checklist
AI use (see the OpenMS AI Policy)
Co-authored-by:trailer, and the description above explains the design intent and rationaleGenerated by Claude Code
Summary by CodeRabbit
Bug Fixes
H2O1.Documentation