Repository navigation
[ProSE] Extensive end-of-search command-line report + YAML summary - #9642
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthrough
ChangesProSE End-of-Search Reporting
Possibly Related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 3
🧹 Nitpick comments (5)
src/topp/ProSE.cpp (2)
958-958: 💤 Low valuePrefer
"\n"overendlper coding guidelines.The guidelines state: "Avoid
std::endlfor performance; prefer\n". While the performance impact is negligible for one-time reporting, consistency with the codebase convention is preferred.♻️ Suggested fix
- OPENMS_LOG_INFO << r.str() << endl; + OPENMS_LOG_INFO << r.str() << "\n";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` at line 958, The OPENMS_LOG_INFO logging statement uses `endl` instead of `"\n"`, which violates the project's coding guidelines that prefer `"\n"` for performance consistency. Locate the line with `OPENMS_LOG_INFO << r.str() << endl;` and replace `endl` with `"\n"` to align with the established codebase conventions.Source: Coding guidelines
1037-1053: 💤 Low valueConsider checking file open status before writing.
The current flow writes to
ofsand then checks!ofs.good(), which catches open failures but conflates them with write failures in the error message. For clearer diagnostics, check immediately after construction.Also, per coding guidelines, prefer
"\n"overstd::endlfor the single flush that's redundant when the stream closes immediately after.♻️ Suggested improvement
try { std::ofstream ofs(summary_out); + if (!ofs) + { + OPENMS_LOG_ERROR << "[ProSE] Failed to open summary JSON -> " << summary_out << "\n"; + return CANNOT_WRITE_OUTPUT_FILE; + } - ofs << root.dump(2) << std::endl; + ofs << root.dump(2) << "\n"; if (!ofs.good()) { OPENMS_LOG_ERROR << "[ProSE] Failed to write summary JSON -> " << summary_out - << " (stream error)." << endl; + << " (stream error).\n"; return CANNOT_WRITE_OUTPUT_FILE; } - OPENMS_LOG_INFO << "[ProSE] Wrote summary JSON -> " << summary_out << endl; + OPENMS_LOG_INFO << "[ProSE] Wrote summary JSON -> " << summary_out << "\n"; } catch (const std::exception& e) { - OPENMS_LOG_ERROR << "[ProSE] Failed to write summary JSON -> " << summary_out << ": " << e.what() << endl; + OPENMS_LOG_ERROR << "[ProSE] Failed to write summary JSON -> " << summary_out << ": " << e.what() << "\n"; return CANNOT_WRITE_OUTPUT_FILE; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` around lines 1037 - 1053, In the ofstream block for writing the summary JSON, check if the file opened successfully immediately after the ofstream construction using ofs.fail() or ofs.is_open() before attempting any write operations, rather than only checking ofs.good() after writing. This clarifies whether failures are due to open failures versus write failures. Additionally, replace the std::endl with "\n" since the redundant buffer flush is unnecessary when the stream closes immediately after the write operation completes.Source: Coding guidelines
src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h (1)
155-156: ⚡ Quick winAdd the required Doxygen
@briefform.This new public header accessor is documented, but not in the required OpenMS Doxygen shape.
Proposed documentation tweak
- /// Number of theoretical fragments stored in the index (0 before build()). + /// `@brief` Number of theoretical fragments stored in the index. + /// + /// Returns 0 before build(). Size getNumFragments() const noexcept { return fi_fragments_.size(); }As per coding guidelines,
**/*.{h,.doxygen}requires Doxygen documentation with@briefplus a blank line before details.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h` around lines 155 - 156, The getNumFragments() method documentation needs to follow OpenMS Doxygen guidelines. Refactor the documentation comment to include a `@brief` tag on the first line, followed by a blank line (///) separating it from additional details. The current single-line comment format should be expanded to use the proper Doxygen `@brief` structure as required by the coding guidelines for public header accessors in *.h files.Source: Coding guidelines
src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h (1)
741-769: ⚡ Quick winUse
@brieffor the new public reporting API docs.These public methods are documented, but the header guideline requires the Doxygen
@briefform.Proposed documentation shape
- /// Recompute result-level statistics (matched count, unique peptide/protein + /// `@brief` Recompute result-level statistics. + /// + /// Recomputes matched count, unique peptide/protein /// counts, charge & missed-cleavage histograms, target/decoy counts and ... - /// Render a human-readable single-run summary block (configuration recap, + /// `@brief` Render a human-readable single-run summary block. + /// + /// Includes configuration recap, /// database/index stats, identification results, tolerance estimate, timing ... - /// Render the modification-discovery section (top PTMs, unknown delta masses) - /// to `@p` os. Shared by the per-file and aggregate report blocks. + /// `@brief` Render the modification-discovery section. + /// + /// Includes top PTMs and unknown delta masses. Shared by the per-file and + /// aggregate report blocks.As per coding guidelines,
**/*.{h,.doxygen}requires Doxygen documentation with@briefplus a blank line before details.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h` around lines 741 - 769, Update the Doxygen documentation for the three public methods updateFinalStats, renderRunSummary, and renderModificationSummary to conform to the coding guidelines. Each method's documentation comment should use the `@brief` tag for the initial summary, followed by a blank line before the detailed description. Convert the current multi-line comments starting with /// to use the proper `@brief` format, ensuring the first sentence after `@brief` is a concise summary, then a blank line, then the remaining detailed documentation.Source: Coding guidelines
src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp (1)
2892-2917: ⚡ Quick winUse OpenMS
Sizefor local container indices/ranks.These loops/ranks are driven by OpenMS container sizes; keep them on
Sizerather thansize_tto match the project convention.Proposed type cleanup
- size_t rank = 1; + Size rank = 1; ... - size_t rank = 1; + Size rank = 1; ... - for (size_t i = 0; i < v.size(); ++i) { out += (i ? ", " : "") + v[i]; } + for (Size i = 0; i < v.size(); ++i) { out += (i ? ", " : "") + v[i]; } ... - for (size_t i = 0; i < v.size(); ++i) { out += (i ? "," : "") + v[i]; } + for (Size i = 0; i < v.size(); ++i) { out += (i ? "," : "") + v[i]; }As per coding guidelines,
**/*.{h,cpp}requires usingSize/SignedSizefor STL.size()values.Also applies to: 2936-2945
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp` around lines 2892 - 2917, Replace the `size_t` type with OpenMS `Size` type for rank variables in the PTM statistics output loops. In the first loop where rank is initialized before the PTM entries iteration and in the second loop where rank is initialized before the unknown_dm iteration, change `size_t rank = 1;` to `Size rank = 1;` to comply with OpenMS coding guidelines that require using `Size` for values driven by container sizes, and apply the same change to the additional code sections mentioned at lines 2936-2945.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h`:
- Around line 77-80: The fields target_psms and decoy_psms in the struct are
documented as "BEFORE FDR" (pre-FDR values) on lines 77-78, but the
updateFinalStats() method (around lines 742-754) recomputes these same fields
from the final post-processed list, creating a semantic inconsistency. To fix
this, either create separate fields to distinguish pre-FDR counts from final
counts (keeping the original target_psms and decoy_psms for one type and adding
new fields for the other), or refactor all code paths to consistently store only
final post-FDR counts in target_psms and decoy_psms while using a different
field (such as HyperScore-related metrics) to capture pre-FDR statistics. Ensure
the documentation comments accurately reflect which counts are stored in each
field and that all callers and consumers of these fields are updated
accordingly.
In `@src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp`:
- Line 1364: The collectRunStatistics_ method call is not populating timing
fields for chunked runs, leaving seconds_search and calibration timing at zero.
Ensure that when collectRunStatistics_ is invoked for chunked execution paths,
the timing statistics structures are properly initialized and populated with
actual measured timing values instead of defaulting to zero. Additionally,
review and update the related code around lines 2173-2176 that explicitly sets
per-file search time to zero, and replace it with logic that captures and
assigns the actual search duration for chunked single-file and chunk-major runs
so that console reports and JSON output correctly reflect per-phase timing
information.
- Around line 2488-2499: The matched_spectra counter in the stats object is
being set to the total size of peptide_ids without accounting for the fact that
empty PeptideIdentifications are skipped in the loop (those with
pid.getHits().empty() returning true). This inflates the matched spectra count.
Instead of setting stats.matched_spectra = peptide_ids.size() upfront,
initialize it to zero and increment the counter only when processing non-empty
peptide identifications (after checking that pid.getHits().empty() is false).
This ensures matched_spectra accurately reflects only the identifications that
contribute to the statistics. Apply the same fix to the second location
mentioned in the comment range (2546-2562).
---
Nitpick comments:
In `@src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h`:
- Around line 155-156: The getNumFragments() method documentation needs to
follow OpenMS Doxygen guidelines. Refactor the documentation comment to include
a `@brief` tag on the first line, followed by a blank line (///) separating it
from additional details. The current single-line comment format should be
expanded to use the proper Doxygen `@brief` structure as required by the coding
guidelines for public header accessors in *.h files.
In `@src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h`:
- Around line 741-769: Update the Doxygen documentation for the three public
methods updateFinalStats, renderRunSummary, and renderModificationSummary to
conform to the coding guidelines. Each method's documentation comment should use
the `@brief` tag for the initial summary, followed by a blank line before the
detailed description. Convert the current multi-line comments starting with ///
to use the proper `@brief` format, ensuring the first sentence after `@brief` is a
concise summary, then a blank line, then the remaining detailed documentation.
In `@src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp`:
- Around line 2892-2917: Replace the `size_t` type with OpenMS `Size` type for
rank variables in the PTM statistics output loops. In the first loop where rank
is initialized before the PTM entries iteration and in the second loop where
rank is initialized before the unknown_dm iteration, change `size_t rank = 1;`
to `Size rank = 1;` to comply with OpenMS coding guidelines that require using
`Size` for values driven by container sizes, and apply the same change to the
additional code sections mentioned at lines 2936-2945.
In `@src/topp/ProSE.cpp`:
- Line 958: The OPENMS_LOG_INFO logging statement uses `endl` instead of `"\n"`,
which violates the project's coding guidelines that prefer `"\n"` for
performance consistency. Locate the line with `OPENMS_LOG_INFO << r.str() <<
endl;` and replace `endl` with `"\n"` to align with the established codebase
conventions.
- Around line 1037-1053: In the ofstream block for writing the summary JSON,
check if the file opened successfully immediately after the ofstream
construction using ofs.fail() or ofs.is_open() before attempting any write
operations, rather than only checking ofs.good() after writing. This clarifies
whether failures are due to open failures versus write failures. Additionally,
replace the std::endl with "\n" since the redundant buffer flush is unnecessary
when the stream closes immediately after the write operation completes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 02b0bf81-aa32-4370-99d7-cb7f9b3db23e
📒 Files selected for processing (6)
CHANGELOGsrc/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.hsrc/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hsrc/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ProSE.cpp
|
CI failure root cause:
Fix: add one line to target_link_libraries(ProSE nlohmann_json::nlohmann_json)This is consistent with how Generated by Claude Code |
Print a consolidated "Search Report" when a ProSE run completes, covering all run modes: configuration recap, database/fragment-index stats, per-file identification results (matched/ID-rate, unique peptides+proteins, target/decoy counts, achieved PSM FDR, charge & missed-cleavage histograms, HyperScore distribution), per-run tolerance estimation, per-phase timing, open-search modification discovery, and an output-file manifest. Multi-file runs render a per-file table with totals. New -summary_out writes the same data as machine-readable JSON; -no_summary suppresses the console block. Per-run stats are exposed on ProSEAlgorithm::SearchResult::stats / MultiFileSearchResult::shared, with static renderRunSummary()/renderModificationSummary() helpers; the algorithm no longer auto-prints the old diagnostic/modification-summary log blocks (rendering moved to the TOPP tool). Stats are recomputed after Percolator/deferred-FDR so the report reflects the final identifications. Adds FragmentIndex::getNumFragments() and a TOPP_ProSE_6_summary test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
… the library The end-of-search JSON summary included <nlohmann/json.hpp> directly in the ProSE TOPP tool. nlohmann_json is linked PRIVATE on the OpenMS library, so its include directory is not propagated to consumers: the tool compiled only on Linux (where Arrow's transitive CMake config leaks the path) and failed on macOS/Windows with "'nlohmann/json.hpp' file not found". Move the serialization into the new static ProSEAlgorithm::renderRunSummaryJson() in the OpenMS library (which links nlohmann), returning the JSON string; the TOPP tool just writes it. Mirrors the existing in-library JSON pattern (ProFormaDataJson.h) and keeps nlohmann an implementation detail. No change to the JSON content. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…der self-containment opus+codex review of the rebase found one report-only bug: the end-of-search report's db_target_proteins/db_decoy_proteins counts used the hardcoded decoy_prefix_ (prefix-only) instead of the resolved DecoyStrategy_. Generated decoys (always DECOY_ prefix) counted correctly, but reused EXTERNAL decoys with a suffix or non-default marker (decoy_mode "external") were all miscounted as targets -> a self-contradictory "N target proteins, decoys: external" with db_decoy_proteins=0. Count by strategy.decoy_string/is_prefix (guarded by have_decoys so target-only/ignore stays all-target). Report/JSON only; search, PSM target/decoy classification (TARGET_DECOY meta) and FDR were unaffected. Also add <string>/<utility> includes to ProSEAlgorithm.h for the new renderRunSummaryJson signature (std::string / std::pair were only transitively available). Co-Authored-By: Claude Opus 4.8 <[email protected]>
ed195f6 to
91b5435
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/topp/ProSE.cpp`:
- Line 167: Replace all instances of std::endl with '\n' in the OPENMS_LOG_ERROR
logging statements and other logging messages throughout the file to follow the
coding guidelines that avoid std::endl for performance reasons. This applies to
the error message about output specifications in the logging statement and all
other OPENMS_LOG_ERROR, OPENMS_LOG_WARN, or similar logging calls where
std::endl is currently used. Simply substitute '\n' in place of std::endl while
keeping all other text and message content unchanged.
- Around line 165-167: The output validation check at the condition on line 165
currently rejects runs that only specify -summary_out as output, even though
this is a valid output option introduced elsewhere in the file. Add the
summary_out output parameter (the variable that stores the -summary_out
command-line argument value) to the empty check condition alongside
out_idxml_list, out_pin_list, out_qpx_dir, out_parquet_dir, and out_merged so
that the error is only raised when all output options including summary_out are
empty.
- Around line 989-993: The comment at lines 989-993 in the ProSE.cpp file
incorrectly states that the tool does not need nlohmann on its include path
because it is not exported as a consumer library. This comment is inaccurate
because nlohmann_json is a header-only library, and even though OpenMS links it
as PRIVATE, the headers are transitively included during compilation on all
platforms. Update the comment to clarify that while the serialization logic
resides in the OpenMS library (ProSEAlgorithm::renderRunSummaryJson), the ProSE
TOPP tool still requires nlohmann_json availability at compile time due to its
header-only nature. Additionally, add explicit linkage of
nlohmann_json::nlohmann_json target to the ProSE target in
src/topp/CMakeLists.txt to ensure the include paths are reliably available
across macOS/Windows/Linux platforms.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c822648a-f8d4-4e34-8def-c504f053e994
📒 Files selected for processing (6)
CHANGELOGsrc/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.hsrc/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hsrc/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ProSE.cpp
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG
🚧 Files skipped from review as they are similar to previous changes (3)
- src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h
- src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h
- src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/topp/ProSE.cpp`:
- Line 167: Replace all instances of std::endl with '\n' in the OPENMS_LOG_ERROR
logging statements and other logging messages throughout the file to follow the
coding guidelines that avoid std::endl for performance reasons. This applies to
the error message about output specifications in the logging statement and all
other OPENMS_LOG_ERROR, OPENMS_LOG_WARN, or similar logging calls where
std::endl is currently used. Simply substitute '\n' in place of std::endl while
keeping all other text and message content unchanged.
- Around line 165-167: The output validation check at the condition on line 165
currently rejects runs that only specify -summary_out as output, even though
this is a valid output option introduced elsewhere in the file. Add the
summary_out output parameter (the variable that stores the -summary_out
command-line argument value) to the empty check condition alongside
out_idxml_list, out_pin_list, out_qpx_dir, out_parquet_dir, and out_merged so
that the error is only raised when all output options including summary_out are
empty.
- Around line 989-993: The comment at lines 989-993 in the ProSE.cpp file
incorrectly states that the tool does not need nlohmann on its include path
because it is not exported as a consumer library. This comment is inaccurate
because nlohmann_json is a header-only library, and even though OpenMS links it
as PRIVATE, the headers are transitively included during compilation on all
platforms. Update the comment to clarify that while the serialization logic
resides in the OpenMS library (ProSEAlgorithm::renderRunSummaryJson), the ProSE
TOPP tool still requires nlohmann_json availability at compile time due to its
header-only nature. Additionally, add explicit linkage of
nlohmann_json::nlohmann_json target to the ProSE target in
src/topp/CMakeLists.txt to ensure the include paths are reliably available
across macOS/Windows/Linux platforms.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c822648a-f8d4-4e34-8def-c504f053e994
📒 Files selected for processing (6)
CHANGELOGsrc/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.hsrc/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hsrc/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ProSE.cpp
✅ Files skipped from review due to trivial changes (1)
- CHANGELOG
🚧 Files skipped from review as they are similar to previous changes (3)
- src/openms/include/OpenMS/ANALYSIS/ID/FragmentIndex.h
- src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h
- src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
🛑 Comments failed to post (3)
src/topp/ProSE.cpp (3)
165-167:
⚠️ Potential issue | 🟠 Major | ⚡ Quick winAllow
-summary_outto satisfy the required-output guard.Line 165 currently rejects runs that request only
-summary_out, even though Line 127 introduces it as an output artifact. That blocks JSON-only report workflows.💡 Proposed fix
- if (out_idxml_list.empty() && out_pin_list.empty() && out_qpx_dir.empty() && out_parquet_dir.empty() && out_merged.empty()) + const String summary_out = getStringOption_("summary_out"); + if (out_idxml_list.empty() && out_pin_list.empty() && out_qpx_dir.empty() && out_parquet_dir.empty() && out_merged.empty() && summary_out.empty()) { - OPENMS_LOG_ERROR << "No output specified. Provide at least one of -out_idxml, -out_pin, -out_qpx, -out_parquet, or -out_merged." << endl; + OPENMS_LOG_ERROR << "No output specified. Provide at least one of -out_idxml, -out_pin, -out_qpx, -out_parquet, -out_merged, or -summary_out.\n"; return ILLEGAL_PARAMETERS; }Also applies to: 127-131
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` around lines 165 - 167, The output validation check at the condition on line 165 currently rejects runs that only specify -summary_out as output, even though this is a valid output option introduced elsewhere in the file. Add the summary_out output parameter (the variable that stores the -summary_out command-line argument value) to the empty check condition alongside out_idxml_list, out_pin_list, out_qpx_dir, out_parquet_dir, and out_merged so that the error is only raised when all output options including summary_out are empty.
167-167:
⚠️ Potential issue | 🟡 Minor | ⚡ Quick winReplace new
std::endlusage with'\n'.The newly added logging/output paths flush on every line via
std::endl; use'\n'to avoid unnecessary flush overhead.As per coding guidelines,
**/*.{h,cpp}should avoidstd::endlfor performance and prefer\n.Also applies to: 307-307, 338-339, 986-986, 998-998
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` at line 167, Replace all instances of std::endl with '\n' in the OPENMS_LOG_ERROR logging statements and other logging messages throughout the file to follow the coding guidelines that avoid std::endl for performance reasons. This applies to the error message about output specifications in the logging statement and all other OPENMS_LOG_ERROR, OPENMS_LOG_WARN, or similar logging calls where std::endl is currently used. Simply substitute '\n' in place of std::endl while keeping all other text and message content unchanged.Source: Coding guidelines
989-993:
⚠️ Potential issue | 🟠 Major🧩 Analysis chain
🏁 Script executed:
#!/bin/bash # Verify whether ProSE target links nlohmann_json directly and whether OpenMS keeps it PRIVATE. rg -n -C2 'target_link_libraries\s*\(\s*OpenMS|nlohmann_json::nlohmann_json' src/openms/CMakeLists.txt rg -n -C3 'add_executable\s*\(\s*ProSE|target_link_libraries\s*\(\s*ProSE|nlohmann_json::nlohmann_json' src/topp/CMakeLists.txtRepository: OpenMS/OpenMS
Length of output: 462
🏁 Script executed:
#!/bin/bash # Search for ProSE CMakeLists configuration more directly fd -n CMakeLists.txt src/topp/ | head -5Repository: OpenMS/OpenMS
Length of output: 288
🏁 Script executed:
#!/bin/bash # Look at the actual topp CMakeLists.txt to find ProSE configuration grep -n "ProSE\|prose" src/topp/CMakeLists.txt -i | head -20Repository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Search all topp CMakeLists for nlohmann references rg -n "nlohmann" src/topp/Repository: OpenMS/OpenMS
Length of output: 280
🏁 Script executed:
#!/bin/bash # Search for ProSE in all CMakeLists and cmake files rg -n "ProSE" src/ -g "*.cmake" -g "CMakeLists.txt"Repository: OpenMS/OpenMS
Length of output: 14515
🏁 Script executed:
#!/bin/bash # Check executables.cmake as mentioned in guidelines cat src/topp/executables.cmake | grep -A5 -B5 "ProSE"Repository: OpenMS/OpenMS
Length of output: 231
🏁 Script executed:
#!/bin/bash # Look at the topp CMakeLists.txt to understand how executables are added head -100 src/topp/CMakeLists.txtRepository: OpenMS/OpenMS
Length of output: 2419
🏁 Script executed:
#!/bin/bash # Look at the context around nlohmann_json linkage in OpenMS CMakeLists.txt sed -n '70,100p' src/openms/CMakeLists.txtRepository: OpenMS/OpenMS
Length of output: 842
🏁 Script executed:
#!/bin/bash # Find where OPENMS_DEP_PRIVATE_LIBRARIES is defined rg -n "OPENMS_DEP_PRIVATE_LIBRARIES" src/openms/CMakeLists.txt | head -20Repository: OpenMS/OpenMS
Length of output: 698
🏁 Script executed:
#!/bin/bash # Check if nlohmann_json is exposed in public headers grep -r "nlohmann/json" src/openms/include/ | head -10Repository: OpenMS/OpenMS
Length of output: 396
🏁 Script executed:
#!/bin/bash # Check what headers ProSE.cpp includes head -60 src/topp/ProSE.cpp | grep -E "^`#include`"Repository: OpenMS/OpenMS
Length of output: 1122
🏁 Script executed:
#!/bin/bash # Search for ProFormaDataJson in ProSE or related code rg -n "ProFormaDataJson" src/topp/ src/openms/source/ANALYSIS/ID/Repository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Check if any included header in ProSE transitively includes nlohmann rg -l "ProFormaDataJson|nlohmann" src/openms/include/OpenMS/ANALYSIS/ID/*.h | head -10Repository: OpenMS/OpenMS
Length of output: 112
🏁 Script executed:
#!/bin/bash # Check ProSEAlgorithm.h for nlohmann usage and what it actually includes head -100 src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hRepository: OpenMS/OpenMS
Length of output: 4618
🏁 Script executed:
#!/bin/bash # Search for nlohmann includes in ProSEAlgorithm.h grep -n "nlohmann\|ProFormaDataJson" src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hRepository: OpenMS/OpenMS
Length of output: 250
🏁 Script executed:
#!/bin/bash # Check if ProSEAlgorithm.h includes ProFormaDataJson indirectly rg -A10 "`#include`.*ProFormaDataJson" src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hRepository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Check which headers transitively include nlohmann by checking key ProSE dependencies grep -r "nlohmann" src/openms/include/OpenMS/METADATA/ src/openms/include/OpenMS/FORMAT/ | grep -v "\.cpp" | head -20Repository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Specifically check ProteinIdentification.h which ProSE includes grep -n "nlohmann\|ProFormaDataJson" src/openms/include/OpenMS/METADATA/ProteinIdentification.hRepository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Check if ProteinGroupArrowExport.h (included by ProSE) uses ProFormaDataJson grep -n "nlohmann\|ProFormaDataJson" src/openms/include/OpenMS/FORMAT/ProteinGroupArrowExport.hRepository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Look at lines around the comment in ProSE.cpp to understand what it's doing with JSON sed -n '985,1010p' src/topp/ProSE.cppRepository: OpenMS/OpenMS
Length of output: 1372
🏁 Script executed:
#!/bin/bash # Check renderRunSummaryJson to see if it's truly self-contained in ProSEAlgorithm grep -n "renderRunSummaryJson" src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hRepository: OpenMS/OpenMS
Length of output: 259
🏁 Script executed:
#!/bin/bash # Look for the implementation of renderRunSummaryJson grep -n "renderRunSummaryJson" src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp | head -5Repository: OpenMS/OpenMS
Length of output: 114
🏁 Script executed:
#!/bin/bash # Check the actual implementation of renderRunSummaryJson - does it include nlohmann? sed -n '3094,3150p' src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppRepository: OpenMS/OpenMS
Length of output: 3061
🏁 Script executed:
#!/bin/bash # Look for nlohmann includes at the top of ProSEAlgorithm.cpp head -50 src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp | grep -E "^`#include`"Repository: OpenMS/OpenMS
Length of output: 1873
🏁 Script executed:
#!/bin/bash # Check if there's a special target_link_libraries for ProSE that was added grep -B5 -A5 "ProSE" src/topp/CMakeLists.txt | tail -30Repository: OpenMS/OpenMS
Length of output: 39
🏁 Script executed:
#!/bin/bash # Check the entire topp CMakeLists.txt for any ProSE-specific linking after line 51 tail -20 src/topp/CMakeLists.txtRepository: OpenMS/OpenMS
Length of output: 636
🏁 Script executed:
#!/bin/bash # Look for any recent changes or TODOs about ProSE nlohmann linkage rg -n "ProSE.*nlohmann|nlohmann.*ProSE" src/Repository: OpenMS/OpenMS
Length of output: 39
Update comment to reflect actual nlohmann_json linkage requirement across all platforms.
The code comment is inaccurate: ProSE DOES require explicit
nlohmann_json::nlohmann_jsonlinkage on macOS/Windows. Althoughnlohmann_jsonis linked to OpenMS as PRIVATE, it is a header-only library. Since OpenMS's implementation headers (ProSEAlgorithm.cpp) directly use#include <nlohmann/json.hpp>, and these headers are transitively included during compilation of dependent targets, the nlohmann headers must be available. PRIVATE linkage of header-only libraries does not propagate include paths reliably across all platforms.The CMake configuration in
src/topp/CMakeLists.txtlacks an explicit linkage:target_link_libraries(ProSE nlohmann_json::nlohmann_json)should be added to the "special requirements" section (or equivalent location) to ensure ProSE compiles on macOS/Windows. Additionally, the code comment at lines 989–993 should be corrected to note that while the serialization logic lives in the library, the TOPP tool still requires nlohmann availability at compile time due to the header-only nature of the dependency.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` around lines 989 - 993, The comment at lines 989-993 in the ProSE.cpp file incorrectly states that the tool does not need nlohmann on its include path because it is not exported as a consumer library. This comment is inaccurate because nlohmann_json is a header-only library, and even though OpenMS links it as PRIVATE, the headers are transitively included during compilation on all platforms. Update the comment to clarify that while the serialization logic resides in the OpenMS library (ProSEAlgorithm::renderRunSummaryJson), the ProSE TOPP tool still requires nlohmann_json availability at compile time due to its header-only nature. Additionally, add explicit linkage of nlohmann_json::nlohmann_json target to the ProSE target in src/topp/CMakeLists.txt to ensure the include paths are reliably available across macOS/Windows/Linux platforms.
…hmann)
Replace the -summary_out JSON with hand-rolled YAML, removing the nlohmann/json
dependency from this feature entirely — which dissolves the macOS/Windows build
problem at its root (no library include-path to propagate) rather than working
around it. YAML is also more idiomatic for OpenMS (CWL tool descriptions are YAML).
- renderRunSummaryJson -> renderRunSummaryYaml (still in the library): a small
emitter that double-quotes every string scalar and escapes all control chars as
\xNN (so paths/accessions containing ':' , quotes or control bytes round-trip
safely), emits non-finite numbers as null, forces the classic locale, and writes
a mantissa dot on bare exponentials ("8e-05" -> "8.0e-05") so YAML 1.1 parsers
read them as numbers. Same field set / structure as the previous JSON.
- ProSEAlgorithm.cpp no longer includes <nlohmann/json.hpp>.
- Register YAML as a first-class, WRITEABLE FileTypes entry so
setValidFormats_("yaml") is valid (OpenMS already emits YAML for CWL).
- -summary_out description/format/log messages, the ProSE_9_summary test
(.json -> .yaml) and the CHANGELOG updated accordingly.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h (1)
846-856: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAdd the required
@briefDoxygen shape for this new public API.This is a public header method, but the new documentation block does not use the project-required
@brief+ blank-line + details layout.Proposed documentation update
- /// Serialize the complete end-of-search report to a machine-readable YAML string: - /// shared configuration/database/index facts, per-file identification statistics, - /// the output-file `@p` manifest (label -> written paths) and failed/total file counts. - /// Hand-rolled (no YAML library dependency); every string scalar is double-quoted so - /// values containing ':' (e.g. Windows paths) or other YAML metacharacters round-trip - /// safely, and non-finite numbers are emitted as null. + /** + * `@brief` Serialize the complete end-of-search report to a machine-readable YAML string. + * + * Includes shared configuration/database/index facts, per-file identification + * statistics, the output-file `@p` manifest (label -> written paths), and + * failed/total file counts. Hand-rolled (no YAML library dependency); every + * string scalar is double-quoted so values containing ':' (e.g. Windows paths) + * or other YAML metacharacters round-trip safely, and non-finite numbers are + * emitted as null. + */ static std::string renderRunSummaryYaml(As per coding guidelines,
**/*.{h,.doxygen}must use Doxygen documentation with@briefrequired, followed by a blank line and details.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h` around lines 846 - 856, The Doxygen documentation for the public method renderRunSummaryYaml is missing the required `@brief` tag and proper documentation layout. Refactor the documentation block to follow the project standard: start with a `@brief` tag containing a concise one-line summary of the method's purpose, followed by a blank line (/// with no text), and then the detailed description. The current multi-line description should be reorganized so the first sentence or key idea becomes the brief, and the remaining details follow after the blank line separator.Source: Coding guidelines
src/topp/ProSE.cpp (1)
996-998: 🧹 Nitpick | 🔵 Trivial | ⚡ Quick winAvoid flushing the YAML file stream with
std::endl.Line 997 only needs a trailing newline;
std::endlalso flushes and violates the OpenMS C++ style guidance.Proposed write tweak
- ofs << ProSEAlgorithm::renderRunSummaryYaml(mfres, manifest, failed_count, in_list.size()) << std::endl; + ofs << ProSEAlgorithm::renderRunSummaryYaml(mfres, manifest, failed_count, in_list.size()) << '\n';As per coding guidelines,
**/*.{h,cpp}should avoidstd::endlfor performance and prefer\n.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/topp/ProSE.cpp` around lines 996 - 998, Replace the std::endl with a newline character \n in the line where ProSEAlgorithm::renderRunSummaryYaml output is written to the ofs stream. The std::endl flushes the stream buffer unnecessarily, which impacts performance. Using \n instead provides the same trailing newline without the flush operation, aligning with OpenMS C++ coding guidelines.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.h`:
- Around line 846-856: The Doxygen documentation for the public method
renderRunSummaryYaml is missing the required `@brief` tag and proper documentation
layout. Refactor the documentation block to follow the project standard: start
with a `@brief` tag containing a concise one-line summary of the method's purpose,
followed by a blank line (/// with no text), and then the detailed description.
The current multi-line description should be reorganized so the first sentence
or key idea becomes the brief, and the remaining details follow after the blank
line separator.
In `@src/topp/ProSE.cpp`:
- Around line 996-998: Replace the std::endl with a newline character \n in the
line where ProSEAlgorithm::renderRunSummaryYaml output is written to the ofs
stream. The std::endl flushes the stream buffer unnecessarily, which impacts
performance. Using \n instead provides the same trailing newline without the
flush operation, aligning with OpenMS C++ coding guidelines.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 26272cd9-3f2e-40ae-8b6c-9969e9d98926
📒 Files selected for processing (8)
CHANGELOGsrc/openms/include/OpenMS/ANALYSIS/ID/ProSEAlgorithm.hsrc/openms/include/OpenMS/FORMAT/FileTypes.hsrc/openms/source/ANALYSIS/ID/ProSEAlgorithm.cppsrc/openms/source/FORMAT/FileTypes.cppsrc/tests/class_tests/openms/source/FileTypes_test.cppsrc/tests/topp/CMakeLists.txtsrc/topp/ProSE.cpp
✅ Files skipped from review due to trivial changes (2)
- src/tests/class_tests/openms/source/FileTypes_test.cpp
- src/openms/source/FORMAT/FileTypes.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
- src/tests/topp/CMakeLists.txt
- CHANGELOG
- src/openms/source/ANALYSIS/ID/ProSEAlgorithm.cpp
… docs - matched_spectra: count only identifications that retained a hit, not peptide_ids.size(). ProSE pushes one PeptideIdentification per searched spectrum (incl. empty non-matches); a caller that collects stats before stripping empties (the single-file library path) would over-count matched spectra / ID rate. count_if(non-empty) is correct in every path (unchanged where empties were already absent, e.g. the multi-file TOPP path: 896/2789 stays 896/2789). - Docs: target_psms/decoy_psms/matched_spectra are recomputed from the FINAL identifications (post-FDR) by collectRunStatistics_/updateFinalStats; the header said "BEFORE FDR". Corrected to "final IDs (after FDR, if applied)". Not changed: CodeRabbit also flagged per-file seconds_search=0 on chunked runs. That is intentional and documented (~ProSEAlgorithm.cpp:2387): chunk-major scores one shared index against all files, so per-file search time is not separable; the console omits the line rather than misreporting, and the cost shows under index(shared) + the whole-run total. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tics_; YAML scope doc opus+codex final pre-merge review. Two fixes: - collectRunStatistics_ now computes target_psms/decoy_psms from the (post-FDR) hits it is given. Previously only capturePreFdrStats_ (pre-FDR) and updateFinalStats (post-FDR) set them, so a library caller reading SearchResult::stats without calling updateFinalStats saw PRE-FDR counts despite the "final IDs" doc. The TOPP tool was already correct (it calls updateFinalStats); this makes every caller consistent. - CHANGELOG: the YAML -summary_out omits the console-only modification-discovery section, so drop the "same information" claim and list the actual contents. Confirmed correct by both reviewers (no change): matched_spectra count_if at both sites, HyperScore pre-FDR capture not overwritten, db target/decoy by resolved marker, chunked seconds_search=0 intentional + console-omitted, hand-rolled YAML valid across all shapes (control-char escaping, YAML-1.1 floats), FileTypes WRITEABLE-only, OpenMS#9644 reconciliation intact. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ng gaps) The FileType enum binding was non-exhaustive: it omitted YAML (added on this branch) and 9 pre-existing types (ZIP, IDPARQUET, FEATUREPARQUET, CONSENSUSPARQUET, CHROMPARQUET, MOBILPARQUET, OSWPQ, BRUKER_TDF, PEFF). Bind all of them so the Python enum matches C++ (72 real values). test_FileTypes.py: complete the expected list and add an exhaustiveness assertion (len(real types) == int(SIZE_OF_TYPE)) so a future FileTypes::Type added in C++ forces the binding + test to be updated. Verified directly: all 72 values accessible with correct ints, typeToName(YAML) == 'yaml'. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…9650, #9651 (#9652) - Add PR reference (#9650) to the error-message improvement entry (was issue #9636 only) - Add PR reference (#9642) to ProSE end-of-search report entry - Add PR reference (#9643) to PSMFeatureExtractor andes support entry - Add PR reference (#9649) to UniPEFF new-tool entry - Add Build System entry for #9648: Boost.Spirit → charconv, 30-40% faster build - Add Build System entry for #9651: missing <thread> header fix for clang 21+ Claude-Session: https://claude.ai/code/session_01DdyZmN6J65umScGRherQ9W Co-authored-by: Claude <[email protected]>
Summary
Adds an extensive end-of-search Search Report to the ProSE TOPP tool, printed on completion and optionally serialized as YAML (
-summary_out), covering all run modes (single/multi-file, open/closed search, target-only vs target+decoy, with/without Percolator, with/without calibration, SNES, chunked, failures).What it reports
Console (printed unless
-no_summary)-summary_out report.yaml(machine-readable, same data)New options
-summary_out <file.yaml>— machine-readable summary (per-file stats + shared config/db/index + output manifest) for pipeline ingestion.-no_summary— suppress the console report (the YAML is still written if requested).Implementation
ProSEAlgorithm::SearchResult::stats; shared config/db/index facts onMultiFileSearchResult::shared(computed once — the index is built once and reused, so shared costs are never summed per file).renderRunSummary()/renderModificationSummary()console renderers +renderRunSummaryYaml();updateFinalStats()recomputes result-level stats after Percolator rescoring / deferred PSM-FDR / protein-FDR finalization so the report reflects the final identifications.FragmentIndex::getNumFragments()accessor.\xNN, so file paths / accessions round-trip safely; non-finite numbers →null; locale-independent, YAML-1.1-safe floats). This drops thenlohmann/jsondependency entirely:nlohmann_jsonisPRIVATE-linked to the OpenMS library and not exported to TOPP tools, so an in-tool JSON include compiled only on Linux (via Arrow's transitive config) and failed the macOS/Windows build with'nlohmann/json.hpp' file not found. YAML is also more idiomatic for OpenMS (CWL tool descriptions are YAML).YAMLis registered as a first-class (writeable)FileTypesentry.Behavior change: the algorithm class no longer auto-prints the old per-run diagnostic / modification-summary log blocks — rendering moved to the TOPP tool. Library callers that want the summary now call the static
renderRunSummary()/renderModificationSummary()/renderRunSummaryYaml()helpers on the returned structs. Noted in the CHANGELOG.Testing
TOPP_ProSE_9_summaryintegration test (writes the YAML under-no_summary, existence-checked).FileTypes_test/FileHandler_testgreen (44 tests, incl. Bruker.dDDA and external-FDR workflows).🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
-summary_out <file>to export the report as machine-readable YAML for pipeline ingestion.-no_summaryto suppress the console report while still producing YAML.Tests