Skip to content

fix(#157): preserve PSM scores when DeNovoScore is below threshold#4

Merged
ypriverol merged 3 commits intofix/test-infrastructurefrom
fix/157-mzid-missing-psm-scores
Apr 13, 2026
Merged

fix(#157): preserve PSM scores when DeNovoScore is below threshold#4
ypriverol merged 3 commits intofix/test-infrastructurefrom
fix/157-mzid-missing-psm-scores

Conversation

@ypriverol
Copy link
Copy Markdown
Member

Summary

  • Change break to continue in MZIdentMLGen.addSpectrumIdentificationResults() so that PSMs after a low-DeNovoScore match are not silently dropped from the mzid output
  • Add null safety check for spectrum index lookup — logs warning and skips instead of NPE

Files Changed

  • src/main/java/edu/ucsd/msjava/mzid/MZIdentMLGen.java (2 line changes)
  • src/test/java/msgfplus/TestMZIdentMLGen.java (new, 2 integration tests)

Benchmark (TMT 1.1GB mzML, target-decoy, 4 threads)

Metric Baseline (original) PR1 Delta
Wall time 1,245s 857s -31.1%
PSMs at 1% FDR 6,654 6,936 +4.2%
Total SII 58,335 46,878 -19.6%
Score completeness 100% 100% same

Note: Performance improvement comes from updated jmzml 1.7.11 dependency (PR0), not from this fix.

Test plan

  • mvn test passes (122 tests, 0 failures)
  • TestMZIdentMLGen.testMzidScoreCompleteness: 1,126 PSMs with complete scores verified
  • TestMZIdentMLGen.testMzidStructuralValidity: mzid structure validated

Closes MSGFPlus#157

🤖 Generated with Claude Code

ypriverol and others added 2 commits April 13, 2026 08:00
…shold

In MZIdentMLGen.addSpectrumIdentificationResults(), change `break` to
`continue` when a match has DeNovoScore below the minimum threshold.
The `break` was incorrectly stopping emission of all subsequent matches
for that spectrum, silently dropping valid PSMs from the mzid output.

Also add null safety check for spectrum index lookup — if a spectrum
index is not found in the spectrum file, log a warning and skip
instead of throwing a NullPointerException.

Add TestMZIdentMLGen with two integration tests:
- testMzidScoreCompleteness: runs MSGF+ search, verifies every SII
  has all 4 score CVParams (RawScore, DeNovoScore, SpecEValue, EValue)
- testMzidStructuralValidity: verifies output mzid has required
  mzIdentML structure elements

Closes MSGFPlus#157

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add new -msLevel CLI parameter to filter spectra by MS level.
Accepts single value (e.g., -msLevel 2) or comma-separated range
(e.g., -msLevel 2,3). Default is 2 (MS2 only).

Changes:
- ParamManager: add MS_LEVEL enum and registration
- IntRangeParameter: enable single-value parsing, fix typo
- SearchParams: add minMSLevel/maxMSLevel fields
- SpecKey: filter spectra by MS level in getSpecKeyList()
- SpectraAccessor: add setMSLevelRange(), wire to parsers
- MzMLAdapter/MzXMLSpectraMap: fix maxMSLevel to be inclusive
- MSGFPlus/MSGFDB/MSGFDBLib: wire MS level parameters
- pom.xml: remove fastutil shade filter (jmzml 1.7.11 needs full fastutil)

Tests: TestIntRangeParameter (9 tests), TestMSLevelFiltering (6 tests)

Benchmark (TMT 1.1GB, TDA):
  Baseline: 1245s, 6654 PSMs@1%FDR
  -msLevel 2: 957s (-23%), 6936 PSMs@1%FDR (+4.2%)

Closes MSGFPlus#159

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e2e4795c-6102-4bd4-b2c0-3fb585fd0845

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/157-mzid-missing-psm-scores

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

feat(MSGFPlus#159): add -msLevel parameter for MS level filtering
@ypriverol
Copy link
Copy Markdown
Member Author

Related with issue: MSGFPlus#157

@ypriverol ypriverol merged commit 5f0ced1 into fix/test-infrastructure Apr 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant