Repository navigation
New feature finder for proteomics DDA-LFQ based on biosaur2 implementation - #8385
Conversation
WalkthroughAdds a new Biosaur2 feature-finder (implementation, tests, pyOpenMS bindings) and a TOPP tool FeatureFinderLFQ; refactors FAIMS/IM splitting to return (CV, MSExperiment) pairs with caller updates; updates build, tests, and docs. No public APIs removed. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant TOPP as FeatureFinderLFQ (TOPP)
participant MS as MSExperiment
participant B2 as Biosaur2Algorithm
participant FM as FeatureMap
U->>TOPP: run with mzML + params
TOPP->>MS: load mzML
TOPP->>B2: setMSData(MSExperiment)
TOPP->>B2: run(FeatureMap&, Hills&, PeptideFeatures&)
B2->>B2: preprocess (centroid / TOF / filtering)
B2->>B2: splitByFAIMSCV -> (CV, MSExperiment) pairs
loop per CV group
B2->>B2: detect hills
B2->>B2: split/process hills
B2->>B2: detect isotope patterns
end
B2->>FM: convertToFeatureMap_
TOPP->>TOPP: write featureXML (± hills TSV ± features TSV)
TOPP->>U: return outputs
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (7)
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.h (1)
16-78: Add Doxygen for the new public API (class, structs, and methods).For headers under
include/OpenMS, new public classes and methods should have Doxygen. Here,Biosaur2Algorithmand its public nested structs (Hill,IsotopeCandidate,PeptideFeature), plus the publicrun,writeTSV, andwriteHillsmethods, are essentially undocumented (apart from a single briefruncomment). This makes the API hard to discover and under-documented in the generated TOPP/OpenMS docs.Consider adding at least brief
@briefclass/struct descriptions and parameter/return docs for the public methods, including what spectra are expected (MS1, centroid/profile), what “hills” and “peptide features” represent, and what is written by the TSV/hills exporters. Based on learningssrc/openms/include/OpenMS/FEATUREFINDER/sources.cmake (1)
5-27: Consider keeping the header list alphabetically ordered.
Biosaur2Algorithm.his currently placed among theFeatureFinder*headers, which breaks the otherwise roughly alphabetical ordering of this list. Consider moving it up to the otherB*entries to keep the list sorted and easier to maintain.src/openms/source/FEATUREFINDER/sources.cmake (1)
20-20: Consider maintaining alphabetical order in the source list.The entry
Biosaur2Algorithm.cppappears out of alphabetical order. For consistency and easier maintenance, it should be placed afterBiGaussModel.cpp(line 8) and beforeEGHTraceFitter.cpp(line 9).Apply this diff to maintain alphabetical ordering:
BiGaussFitter1D.cpp BiGaussModel.cpp +Biosaur2Algorithm.cpp EGHTraceFitter.cpp ElutionModelFitter.cpp ElutionPeakDetection.cpp EmgFitter1D.cpp EmgModel.cpp EmgScoring.cpp ExtendedIsotopeFitter1D.cpp ExtendedIsotopeModel.cpp FeatureFinderAlgorithmPicked.cpp FeatureFinderAlgorithmPickedHelperStructs.cpp FeatureFinderIdentificationAlgorithm.cpp -Biosaur2Algorithm.cpp FeatureFinderAlgorithmMetaboIdent.cppsrc/topp/Biosaur2.cpp (1)
105-158: Main tool flow is sound; consider minor polish on parameter reuse and loggingThe sequence “load mzML → configure Biosaur2Algorithm from
getParam_().copySubset(...)→ run → set primary MS run path → add QUANTITATION processing → store featureXML/TSV/hills” is correct and aligned with other TOPP tools.Two optional polish points:
- You can avoid constructing an extra temporary
Biosaur2Algorithm()incopySubset(...)by reusing thealgorithminstance’s defaults.- The log line
peptide_features.size()should always matchfeature_map.size(), but loggingfeature_map.size()might be slightly clearer to users consuming featureXML directly.Both are non-blocking.
As per coding guidelines
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (3)
456-597:detectHills: behaviour is reasonable but algorithm is O(#peaks × #hills)The hill-building logic (extending only hills with
scan_indices.back() == scan_idx - 1and ppm-filtering againsthill.mz_median) is coherent and matches the Biosaur-style design. However, for each peak you iterate over all existing hills until a match is found, which in dense data sets can grow to O(N²) in the number of peaks.If this becomes a bottleneck in practice, consider:
- Bucketing hills by last scan index and/or m/z bins to narrow the candidate set.
- Or maintaining an index of “active hills in previous scan” keyed by m/z.
Not urgent for a first port, but worth keeping in mind.
As per coding guidelines
729-995:detectIsotopePatternsis correct but very complex; hill reuse semantics depend onhill_idxfixFunctionally the isotope pattern detection:
- Sorts hills by
mz_median.- Optionally calibrates isotope mass errors per isotope number and charge.
- Searches for isotope series for each mono-hill and charge.
- Filters by cosine correlation and optional isotope calibration.
- Applies valley-splitting (
checkIsotopeValleySplit) and intensity re-aggregation (iuse).This is a faithful, but quite dense, translation of the Biosaur2 logic. Two notes:
- Correctness of
used_hillsand calibration maps depends onhill_idxbeing unique per hill; otherwise multiple segments can be marked “used” or looked up inconsistently.- From a maintainability standpoint, this would benefit from being split into smaller helpers (e.g., “collectIsotopeErrorsForCalibration”, “findIsotopeCandidatesForMonoHill”, “applyIsotopeCalibrationAndValleySplit”), which would also address the static analysis “Complex Method” warning.
No immediate blocker once the
hill_idx/splitHillsissues are fixed, but refactoring later would make future changes safer.As per coding guidelines
1039-1125: Cosine correlation and TSV/hill writers are straightforward and safe
cosineCorrelationaligns intensities via maps keyed by scan index and handles zero norms gracefully by returning 0.writeTSV/writeHillsuse tab-separated output with sensible headers and log the number of records written.You might optionally check
ofstreamopen-state for robustness, but given existing patterns in OpenMS this is acceptable as-is.As per coding guidelines
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
doc/doxygen/public/TOPP.doxygen(1 hunks)src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.h(1 hunks)src/openms/include/OpenMS/FEATUREFINDER/sources.cmake(1 hunks)src/openms/source/APPLICATIONS/ToolHandler.cpp(1 hunks)src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp(1 hunks)src/openms/source/FEATUREFINDER/sources.cmake(1 hunks)src/pyOpenMS/pxds/Biosaur2Algorithm.pxd(1 hunks)src/tests/topp/Biosaur2_1_output.featureXML(1 hunks)src/tests/topp/CMakeLists.txt(1 hunks)src/topp/Biosaur2.cpp(1 hunks)src/topp/executables.cmake(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/openms/**/*.{cpp,h,hpp,cc,cxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/openms/**/*.{cpp,h,hpp,cc,cxx}: Follow the existing C++ coding conventions in the codebase
Use the established naming patterns for classes, methods, and variables
Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Follow the established error handling patterns
Utilize OpenMS logging mechanisms
Be mindful of memory usage when processing large datasets
Consider algorithmic complexity for data processing operations
Use appropriate OpenMS containers and algorithms
Files:
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.hsrc/openms/source/APPLICATIONS/ToolHandler.cppsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
src/openms/include/OpenMS/**/*.h
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Add Doxygen comments for new public methods and classes
Files:
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.h
🧠 Learnings (11)
📚 Learning: 2025-09-03T12:58:20.032Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.
Applied to files:
src/topp/executables.cmakesrc/tests/topp/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Applied to files:
src/openms/source/FEATUREFINDER/sources.cmakesrc/openms/include/OpenMS/FEATUREFINDER/sources.cmakesrc/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.hsrc/topp/Biosaur2.cppsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cppsrc/pyOpenMS/pxds/Biosaur2Algorithm.pxd
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes
Applied to files:
src/openms/include/OpenMS/FEATUREFINDER/sources.cmakesrc/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.hsrc/topp/Biosaur2.cppsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Consider algorithmic complexity for data processing operations
Applied to files:
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.hsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms
Applied to files:
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.hsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Applied to files:
src/tests/topp/CMakeLists.txtsrc/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`
Applied to files:
src/tests/topp/CMakeLists.txt
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cppsrc/pyOpenMS/pxds/Biosaur2Algorithm.pxd
📚 Learning: 2025-11-18T20:08:08.900Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8374
File: src/pyOpenMS/pxds/SimpleSVM.pxd:0-0
Timestamp: 2025-11-18T20:08:08.900Z
Learning: In pyOpenMS .pxd files, copy constructors should be declared for wrapped C++ classes (e.g., `ClassName(ClassName&) except + nogil`) even when the C++ class has a deleted copy constructor. This is a standard pyOpenMS/Cython convention required for proper wrapper generation and Python object semantics.
Applied to files:
src/pyOpenMS/pxds/Biosaur2Algorithm.pxd
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Applied to files:
src/pyOpenMS/pxds/Biosaur2Algorithm.pxd
📚 Learning: 2025-06-16T15:49:26.504Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:1-3
Timestamp: 2025-06-16T15:49:26.504Z
Learning: In OpenMS Python bindings (.pxd files), derived quantitation method classes like TMTThirtyTwoPlexQuantitationMethod only need to declare their constructors. All other public methods (getName, getChannelInformation, getNumberOfChannels, getIsotopeCorrectionMatrix, getReferenceChannel) are inherited from the base IsobaricQuantitationMethod class and don't need to be redeclared explicitly.
Applied to files:
src/pyOpenMS/pxds/Biosaur2Algorithm.pxd
🧬 Code graph analysis (4)
src/openms/include/OpenMS/FEATUREFINDER/Biosaur2Algorithm.h (1)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (33)
Biosaur2Algorithm(27-83)run(106-111)run(106-106)run(113-214)run(113-116)updateMembers_(85-104)updateMembers_(85-85)calculatePPM(216-223)calculatePPM(216-216)calculateMedian(225-241)calculateMedian(225-225)meanFilter(243-262)meanFilter(243-243)calibrateMass(264-329)calibrateMass(264-264)processTOF(331-411)processTOF(331-331)centroidProfileSpectra(413-454)centroidProfileSpectra(413-413)detectHills(456-597)detectHills(456-461)processHills(599-613)processHills(599-599)splitHills(615-692)splitHills(615-615)checkIsotopeValleySplit(694-727)checkIsotopeValleySplit(694-696)detectIsotopePatterns(729-994)detectIsotopePatterns(729-736)convertToFeatureMap(996-1037)convertToFeatureMap(996-996)cosineCorrelation(1039-1080)cosineCorrelation(1039-1042)
src/openms/source/APPLICATIONS/ToolHandler.cpp (1)
src/openms/include/OpenMS/DATASTRUCTURES/ToolDescription.h (1)
ToolDescription(110-131)
src/topp/Biosaur2.cpp (1)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (1)
Biosaur2Algorithm(27-83)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (1)
src/openms/source/CONCEPT/Exception.cpp (2)
InvalidValue(224-228)MissingInformation(257-260)
🪛 GitHub Check: CodeFactor
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
[notice] 456-598: src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp#L456-L598
Complex Method
[notice] 729-995: src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp#L729-L995
Complex Method
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
- GitHub Check: build-and-test (ubuntu-22.04-arm, g++, 11)
- GitHub Check: build-and-test (macos-26, xcode, 26.0)
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
- GitHub Check: build-and-test (macos-15-intel, xcode, 16.0.0)
- GitHub Check: build-lnx-arm
- GitHub Check: build-macos-arm
- GitHub Check: build-lnx
- GitHub Check: build-macos
- GitHub Check: build-win
🔇 Additional comments (7)
doc/doxygen/public/TOPP.doxygen (1)
82-90: TOPP entry looks consistent; ensure matching subpage exists.The new Quantitation entry for
TOPP_Biosaur2is in the right section and naming matches the tool. Just make sure there is a corresponding@page TOPP_Biosaur2(e.g. aTOPP_Biosaur2.doxygenfile) so Doxygen doesn’t emit a missing-subpage warning.src/openms/source/APPLICATIONS/ToolHandler.cpp (1)
47-62: Tool registration is correct and in the right category.
Biosaur2is added in alphabetical order and mapped tocat_quant, matching the Quantitation section in TOPP.doxygen. This aligns with the ToolHandler comments about ordering and doc mirroring.src/topp/executables.cmake (1)
5-20: Executable list integration looks good.
Biosaur2is correctly added toTOPP_executablesin alphabetical order and matches the registered tool/documentation. No issues from the CMake side here.src/tests/topp/Biosaur2_1_output.featureXML (1)
1-934: Test output file is well-structured and appropriate.This featureXML test fixture contains 54 well-formed feature entries with realistic LC-MS data (RT, m/z, charge, intensities) and proper metadata. The placeholder timestamps and test-mode parameter values are standard practice for expected-output files used in regression testing.
src/tests/topp/CMakeLists.txt (1)
261-266: All verification checks pass; code is correct.
- Reference files present: Biosaur2_1_output.featureXML, Biosaur2_2_output.featureXML ✅
- No duplicate test names across CMakeLists.txt ✅
- CLI flags all valid:
-mini(line 30),-minlh(line 51),-cmax(line 57) are registered parameters in Biosaur2Algorithm.cpp ✅- Dependencies correctly set via set_tests_properties ✅
src/topp/Biosaur2.cpp (1)
82-103: Parameter registration and algorithm defaults look consistentOptions
in,out,out_tsv,out_hills, andwrite_hillsare registered in the usual TOPP style andregisterFullParam_(defaults)correctly exposes the Biosaur2Algorithm parameters. You might consider adding brief parameter descriptions for any non-obvious algorithm parameters in the header/INI docs to aid users, but the wiring itself is fine.As per coding guidelines
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (1)
996-1037: FeatureMap conversion looks consistent with OpenMS conventions
convertToFeatureMapcorrectly:
- Sets MZ/RT/intensity/charge from
PeptideFeature.- Builds a simple convex hull in (RT, m/z) space.
- Propagates calibrated mass, isotope count, scan count, and summed intensity as meta values.
- Stores FAIMS and ion mobility meta values only when non-negative.
- Ensures unique IDs on all features and the map and creates one empty
ProteinIdentification.This matches other feature finder outputs; no changes needed.
As per coding guidelines
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (4)
119-119: Expensive deep copy of MSExperiment for large datasets.
MSExperiment exp = input;creates a full copy of the entire experiment, which can be costly for large LC-MS datasets (hundreds of MB to GB). While modification requires a copy, consider documenting this overhead or exploring in-place modification strategies if memory becomes a bottleneck in production use.
963-971: Use OpenMS constant instead of hardcoded proton mass.Line 963 hardcodes
proton_mass = 1.007276. OpenMS providesConstants::PROTON_MASS_Ufor this value. Using the framework constant ensures consistency across the codebase and simplifies maintenance.Apply this diff:
- double proton_mass = 1.007276; + double proton_mass = Constants::PROTON_MASS_U; if (negative_mode) { feature.mass_calib = mono_mz * charge + proton_mass * charge;Based on learnings
1003-1008: Convex hull contains only two points at the same m/z.The convex hull is constructed with only two points
(rt_start, mz)and(rt_end, mz), creating a degenerate 1D line segment rather than a true 2D hull. If downstream analysis expects proper 2D hulls capturing the feature's extent in both RT and m/z dimensions, consider including additional points representing the m/z range (e.g., isotopic peak positions or m/z tolerance boundaries).If this simplified representation is intentional for performance or compatibility reasons, the current implementation is acceptable.
1078-1078: Add error handling for file output operations.Both
writeTSVandwriteHillsopen output files without checking whether the operation succeeded. If the file cannot be opened (due to permissions, invalid path, disk full, etc.), the functions will silently fail to write data.Consider adding checks:
void Biosaur2Algorithm::writeTSV(const vector<PeptideFeature>& features, const String& filename) const { ofstream out(filename); + if (!out.is_open()) + { + throw Exception::FileNotWritable(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, filename); + } out << "massCalib\trtApex\t...As per coding guidelines
Also applies to: 1103-1103
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/openms/**/*.{cpp,h,hpp,cc,cxx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/openms/**/*.{cpp,h,hpp,cc,cxx}: Follow the existing C++ coding conventions in the codebase
Use the established naming patterns for classes, methods, and variables
Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Follow the established error handling patterns
Utilize OpenMS logging mechanisms
Be mindful of memory usage when processing large datasets
Consider algorithmic complexity for data processing operations
Use appropriate OpenMS containers and algorithms
Files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
🧠 Learnings (12)
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Consider algorithmic complexity for data processing operations
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/**/*.h : Add Doxygen comments for new public methods and classes in pyOpenMS bindings
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Be mindful of memory usage when processing large datasets
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Follow the established error handling patterns
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Follow the existing C++ coding conventions in the codebase
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-06-16T15:48:09.667Z
Learnt from: FreezB11
Repo: OpenMS/OpenMS PR: 7969
File: src/pyOpenMS/pxds/TMTThirtyTwoPlexQuantitationMethod.pxd:4-4
Timestamp: 2025-06-16T15:48:09.667Z
Learning: In OpenMS .pxd files, the established pattern for extern from statements is to include angle brackets inside the string literal, like `cdef extern from "<OpenMS/PATH/TO/FILE.h>" namespace "OpenMS":`. This is consistent across all existing quantitation method .pxd files and other .pxd files in the OpenMS codebase.
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-08-14T10:19:54.371Z
Learnt from: jpfeuffer
Repo: OpenMS/OpenMS PR: 8167
File: src/topp/Digestor.cpp:200-226
Timestamp: 2025-08-14T10:19:54.371Z
Learning: In OpenMS (C++ bioinformatics framework), use boost random libraries instead of std library random distributions for cross-platform reproducible random number generation, as std library distributions are not reproducible across platforms.
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
📚 Learning: 2025-09-03T12:58:20.032Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.
Applied to files:
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
🧬 Code graph analysis (1)
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp (1)
src/openms/source/CONCEPT/Exception.cpp (2)
InvalidValue(224-228)MissingInformation(257-260)
🪛 GitHub Check: CodeFactor
src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp
[notice] 456-598: src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp#L456-L598
Complex Method
[notice] 729-995: src/openms/source/FEATUREFINDER/Biosaur2Algorithm.cpp#L729-L995
Complex Method
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build-lnx
- GitHub Check: build-lnx-arm
- GitHub Check: build-macos
- GitHub Check: build-and-test (ubuntu-22.04, g++, 11)
- GitHub Check: build-win
- GitHub Check: build-and-test (macos-26, xcode, 26.0)
- GitHub Check: build-and-test (ubuntu-22.04, clang++, 15)
- GitHub Check: build-and-test (ubuntu-22.04-arm, g++, 11)
- GitHub Check: build-and-test (macos-15-intel, xcode, 16.0.0)
- GitHub Check: build-and-test (windows-2022, cl.exe, 14.36)
- GitHub Check: cppcheck-test
|
@timosachsenberg I've opened a new pull request, #8387, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Fix FAIMS validation to only throw for true ion mobility Co-authored-by: timosachsenberg <[email protected]> * Refactor: extract shouldThrowForMissingIM helper method Co-authored-by: timosachsenberg <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
|
@timosachsenberg I've opened a new pull request, #8388, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot MSExperiment exp = input; creates a full copy of the entire experiment, which can be costly for large LC-MS datasets (hundreds of MB to GB). |
|
@timosachsenberg I've opened a new pull request, #8389, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot Add error handling for file output operations. Both writeTSV and writeHills open output files without checking whether the operation succeeded. If the file cannot be opened (due to permissions, invalid path, disk full, etc.), the functions will silently fail to write data. Consider adding checks |
|
@timosachsenberg I've opened a new pull request, #8390, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot Use OpenMS constant instead of hardcoded proton mass. Line 963 hardcodes proton_mass = 1.007276. OpenMS provides Constants::PROTON_MASS_U |
|
@timosachsenberg I've opened a new pull request, #8391, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Replace hardcoded proton mass with Constants::PROTON_MASS_U Co-authored-by: timosachsenberg <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
…8390) * Initial plan * Add error handling for file output operations in writeTSV and writeHills Co-authored-by: timosachsenberg <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp (3)
44-116: Isotope calibration test is good; consider asserting the intended behavior more directlyThe synthetic setup with a correct isotope and a nearby lower‑intensity “noise” peak is a solid way to stress the isotope selection and tolerance handling. The current assertions (single feature at m/z ~1000, charge 1,
n_isotopes == 2) verify a plausible outcome but don’t fully guarantee that the higher‑intensity isotope candidate was chosen over the nearby noise peak.If the Biosaur2Algorithm exposes which peak was selected for the isotope (e.g., via hull content, additional meta values, or through the
Hillrepresentation), consider adding an assertion that would fail if the low‑intensity peak at 1000.993355 were used instead of 1001.003355. This would make the test guard the calibration bias behavior it documents rather than just the aggregate feature count.
119-144: setMSData tests cover both const and move overloads; confirm move‑from semantics are intentionalThe tests nicely exercise both
setMSData(const MSExperiment&)andsetMSData(MSExperiment&&)and verify that data are available viagetMSData()afterward. The additional checkTEST_EQUAL(exp.size(), 0);in the rvalue test effectively constrains the move overload to leave the sourceMSExperimentempty.That’s reasonable for this API, but it also turns this into a contractual behavior (rather than relying on generic “valid but unspecified” moved‑from state). If that’s the intended guarantee, the test is perfect; if not, you might relax this assertion (e.g., just checking that
algo.getMSData().size() == 1).
168-203: Full‑pipeline run(hills, peptide_features) test could assert a bit more, if behavior is knownThe test validates that at least one hill is produced for a simple, clean signal, which is a useful smoke check. However,
feature_mapandpeptide_featuresremain unchecked, and even forhillsyou only assertsize() >= 1.If the intended behavior for this simple case is better understood (e.g., exactly one hill, or at least one feature with specific RT/m/z span), consider tightening the expectations slightly to catch regressions in the full pipeline (hill building → feature extraction). If behavior is deliberately left flexible, adding a short comment to that effect next to the minimal assertion would clarify the intent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/tests/class_tests/openms/executables.cmake(1 hunks)src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
src/tests/class_tests/openms/**/*.cpp
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Write unit tests for new functionality
Files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
🧠 Learnings (9)
📓 Common learnings
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.
📚 Learning: 2025-09-03T12:58:20.032Z
Learnt from: timosachsenberg
Repo: OpenMS/OpenMS PR: 8177
File: src/tests/topp/CMakeLists.txt:1857-1865
Timestamp: 2025-09-03T12:58:20.032Z
Learning: OpenMS tests: When adding new TOPP tests in src/tests/topp/CMakeLists.txt that compare outputs via FuzzyDiff, always add set_tests_properties("<tool>_<n>_out<m>" PROPERTIES DEPENDS "<tool>_<n>") to avoid flakiness under parallel CTest runs.
Applied to files:
src/tests/class_tests/openms/executables.cmakesrc/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/**/*.cpp : Write unit tests for new functionality
Applied to files:
src/tests/class_tests/openms/executables.cmakesrc/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/tests/class_tests/openms/*Test.cpp : Follow naming convention: `ClassNameTest.cpp` for `ClassName`
Applied to files:
src/tests/class_tests/openms/executables.cmakesrc/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use OpenMS data structures (e.g., MSExperiment, FeatureMap, PeptideIdentification)
Applied to files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/include/OpenMS/**/*.h : Add Doxygen comments for new public methods and classes
Applied to files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Consider algorithmic complexity for data processing operations
Applied to files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/openms/**/*.{cpp,h,hpp,cc,cxx} : Use appropriate OpenMS containers and algorithms
Applied to files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
📚 Learning: 2025-08-05T12:43:11.681Z
Learnt from: CR
Repo: OpenMS/OpenMS PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-05T12:43:11.681Z
Learning: Applies to src/pyOpenMS/tests/**/*.py : Write pyOpenMS tests for new Python bindings
Applied to files:
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp
🔇 Additional comments (3)
src/tests/class_tests/openms/source/Biosaur2Algorithm_test.cpp (2)
29-42: Lifecycle tests for constructor/destructor are fineBasic allocation/deallocation checks match existing ClassTest patterns and are sufficient here.
146-166: getMSData const and non‑const accessors are adequately exercisedThe non‑const accessor test correctly verifies that modifying the returned reference affects the internal MSExperiment, and the const accessor test ensures a const object can be queried without side effects. This gives good coverage for the basic data‑access API.
src/tests/class_tests/openms/executables.cmake (1)
310-354: Including Biosaur2Algorithm_test in the filtering test suite looks correctAdding
Biosaur2Algorithm_testtofiltering_executables_listis consistent with existing naming and ensures the new class test is built and executed with the rest of the filtering/feature‑finding tests.
|
@copilot in topp.doxygen there is still the old tool name |
|
@timosachsenberg I've opened a new pull request, #8397, to work on those changes. Once the pull request is ready, I'll request review from you. |
#8397) * Initial plan * Fix tool name in TOPP.doxygen from TOPP_Biosaur2 to TOPP_FeatureFinderLFQ Co-authored-by: timosachsenberg <[email protected]> * Fix TOPP_Biosaur2 reference in Biosaur2Algorithm.h to TOPP_FeatureFinderLFQ Co-authored-by: timosachsenberg <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
|
@copilot D:\a\OpenMS\OpenMS\OpenMS\src\openms\source\FEATUREFINDER\Biosaur2Algorithm.cpp(314): error C7660: 'simd': requires '-openmp:experimental' command line option(s) can you add this to the compiler flags on windows? if openmp is enabled |
|
@timosachsenberg I've opened a new pull request, #8402, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Add /openmp:experimental flag for MSVC to support #pragma omp simd Co-authored-by: timosachsenberg <[email protected]> * Improve comments explaining /openmp:experimental as superset of /openmp Co-authored-by: timosachsenberg <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: timosachsenberg <[email protected]>
|
I think this can be merged. I tested it on larger datasets and it is marked as experimental anyway. If you have time a reviewer or further optimizations could be useful. |
This pull request introduces the Biosaur2 peptide feature detection algorithm to OpenMS featuring support for FAIMS and timstof PASEF data.
Biosaur2 algorithm integration:
Biosaur2Algorithmto OpenMS, including header/source files, Python bindings (Biosaur2Algorithm.pxd), and a comprehensive unit test (Biosaur2Algorithm_test.cpp). This enables peptide feature detection in centroided LC-MS1 data using the Biosaur2 algorithm. [1] [2] [3] [4] [5]FAIMS compensation voltage splitting refactor:
Refactored
IMDataConverter::splitByFAIMSCVto return a vector of(CV, MSExperiment)pairs instead of separatePeakMapobjects, improving clarity and handling of non-FAIMS datasets (now returning a single-element group with a NaN key instead of throwing an exception). [1] [2] [3]Updated related unit tests (
IMDataConverter_test.cpp) to reflect the new return type and behavior, including checks for correct assignment of MS2 spectra and handling of non-FAIMS data. [1] [2] [3] [4]Tool registration:
FeatureFinderLFQin the OpenMS tool handler, making it available as a quantification tool.Minor improvements:
<utility>inIMDataConverter.hto support new return type.Meta and documentation:
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI buildsSummary by CodeRabbit
New Features
Changes
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.