Repository navigation
[FIX] ANALYSIS/ID: signal unknown target_decoy; NeighborSeq owns its peptides (#9488 ANID-10, ANID-34) - #9613
Conversation
…peptides (OpenMS#9488 ANID-10, ANID-34) Part of OpenMS#9488 (POLS high-severity checklist — **ANALYSIS/ID**). ### [ANID-10] `IDBoostGraph` — missing `target_decoy` silently treated as decoy Six sites used `getMetaValue("target_decoy").toString()[0] == 't'`. When the key is absent, `toString()` is `""` and `""[0]` is `'\0'`, so a hit with **unknown** target/decoy status was silently classified as a **decoy** (score 0) instead of being flagged. **Fix:** use the existing `getTargetDecoyType()` API and throw `Exception::MissingInformation` on `UNKNOWN` — the same contract `FalseDiscoveryRate` already enforces. The four `.cpp` sites share a small `isTargetProteinOrThrow_()` helper; the two header visitor overloads inline the check. ### [ANID-34] `NeighborSeq` — rvalue-ref ctor stored a dangling const-reference The constructor takes `std::vector<AASequence>&&` (promising ownership) but the member was `const std::vector<AASequence>&`, so `std::move(...)` merely aliased the argument; passing a temporary (which `&&` invites) dangled immediately and every later call was UB. **Fix:** make the member an owning `std::vector<AASequence>`. The init-list `std::move(...)` now genuinely moves; no call site changes. Stale `@note` corrected. **ABI:** ANID-10 none; ANID-34 changes a private member type (class layout) — **ABI-breaking**, but no source/signature change. **Tests:** `IDBoostGraph_test` — `getProteinScores_` throws on missing `target_decoy` and labels targets correctly; `NeighborSeq_test` — construct-from-temporary is safe and correct. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughIDBoostGraph now uses typed target/decoy annotations and throws on unknown protein or peptide status. NeighborSeq now owns its moved peptide vector, with tests covering temporary-vector construction and missing annotation handling. ChangesIDBoostGraph: Strongly-Typed Target/Decoy Classification
NeighborSeq: Owned Vector Lifetime Fix
Sequence Diagram(s)sequenceDiagram
participant Resolver as resolveGraphPeptideCentric
participant Validator as validateTargetDecoyAnnotations_
participant Protein as ProteinHit
participant Scoring as Protein scoring
Resolver->>Validator: validate protein annotations
Validator->>Protein: getTargetDecoyType()
Validator-->>Resolver: continue or throw MissingInformation
Resolver->>Scoring: compute groups, scores, and fractions
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
|
Adversarial review result: no blocking behavioral issue found in this pass. Required source cleanup before merge: the added Doxygen/test comments include tracker references. Please remove those references from source comments and keep the comments focused on the missing target/decoy contract and owned-vector lifetime fix. I did not run the tests locally. |
|
@jpfeuffer false positive? |
|
yes in the sense that an absent metavalue throws in OpenMS |
|
Actually the single-arg If |
|
To clarify the "throws" point: it's the The catch is that these six sites don't convert — they call |
|
Interesting. Not a great intuitive API. But then this PR is obviously valid. |
|
yeah the API is not great. I will look into a better one for the future |
Keep the comments focused on the missing target/decoy contract and the owned-vector lifetime fix. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Validate protein target/decoy annotations before parallel graph resolution so exceptions remain catchable. Make the NeighborSeq ownership regression deterministic and document the accepted ABI break.
* docs(changelog): add entries for #9492, #9752 Backfills two CHANGELOG entries for recently merged PRs that landed without their own entry: - #9752: new BUILD_TOPP_TOOLS / INSTALL_OPENMS_EXAMPLES CMake options enabling a core-only OpenMS SDK build - #9492: null-dereference guards in TargetedExperiment::get*ByRef and ReactionMonitoringTransition::getPrediction All other PRs merged since the last CHANGELOG update (#9613, #9750, #9738) already carried their own entries; #9572 is test-only and follows the existing convention of not adding a changelog entry for test-only PRs in this series. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcFv1tmBLzroCNJFjoqhZt * Update CHANGELOG Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…S#9753) * docs(changelog): add entries for OpenMS#9492, OpenMS#9752 Backfills two CHANGELOG entries for recently merged PRs that landed without their own entry: - OpenMS#9752: new BUILD_TOPP_TOOLS / INSTALL_OPENMS_EXAMPLES CMake options enabling a core-only OpenMS SDK build - OpenMS#9492: null-dereference guards in TargetedExperiment::get*ByRef and ReactionMonitoringTransition::getPrediction All other PRs merged since the last CHANGELOG update (OpenMS#9613, OpenMS#9750, OpenMS#9738) already carried their own entries; OpenMS#9572 is test-only and follows the existing convention of not adding a changelog entry for test-only PRs in this series. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcFv1tmBLzroCNJFjoqhZt * Update CHANGELOG Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
…S#9753) * docs(changelog): add entries for OpenMS#9492, OpenMS#9752 Backfills two CHANGELOG entries for recently merged PRs that landed without their own entry: - OpenMS#9752: new BUILD_TOPP_TOOLS / INSTALL_OPENMS_EXAMPLES CMake options enabling a core-only OpenMS SDK build - OpenMS#9492: null-dereference guards in TargetedExperiment::get*ByRef and ReactionMonitoringTransition::getPrediction All other PRs merged since the last CHANGELOG update (OpenMS#9613, OpenMS#9750, follows the existing convention of not adding a changelog entry for test-only PRs in this series. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01QcFv1tmBLzroCNJFjoqhZt * Update CHANGELOG Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Part of #9488 (POLS high-severity checklist — ANALYSIS/ID).
[ANID-10]
IDBoostGraph— missingtarget_decoysilently treated as decoySix sites used
getMetaValue("target_decoy").toString()[0] == 't'. When the key is absent,toString()is""and""[0]is'\0', so a hit with unknown target/decoy status was silently classified as a decoy (score 0) instead of being flagged.Fix: use the existing
getTargetDecoyType()API and throwException::MissingInformationonUNKNOWN— the same contractFalseDiscoveryRatealready enforces. The four.cppsites share a smallisTargetProteinOrThrow_()helper; the two header visitor overloads inline the check.[ANID-34]
NeighborSeq— rvalue-ref ctor stored a dangling const-referenceThe constructor takes
std::vector<AASequence>&&(promising ownership) but the member wasconst std::vector<AASequence>&, sostd::move(...)merely aliased the argument; passing a temporary (which&&invites) dangled immediately and every later call was UB.Fix: make the member an owning
std::vector<AASequence>. The init-liststd::move(...)now genuinely moves; no call site changes. Stale@notecorrected.ABI: ANID-10 none; ANID-34 changes a private member type (class layout) — ABI-breaking, but no source/signature change.
Tests:
IDBoostGraph_test—getProteinScores_throws on missingtarget_decoyand labels targets correctly;NeighborSeq_test— construct-from-temporary is safe and correct.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Breaking Changes
Bug Fixes
Tests