Skip to content

docs: clarify ProSE vs Sage PSM comparison across scoring regimes - #35

Open
nej1gotnochill wants to merge 5 commits into
mainfrom
docs/prose-sage-reproducible-report
Open

nej1gotnochill wants to merge 5 commits into
mainfrom
docs/prose-sage-reproducible-report

Conversation

@nej1gotnochill

@nej1gotnochill nej1gotnochill commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

What this changes

The first version of this report compared raw ProSE against stock Sage, which unconditionally applies its built-in 20-feature LDA before assigning q-values. The resulting ~20% gap (45,723 vs 54,830 in A; 47,252 vs 55,756 in B) was read as "Sage recovers more target identifications". That interpretation is withdrawn: the two arms differ in post-scoring, so the gap measures the LDA step at least as much as the search. Nothing in the revised report depends on it.

Section 9 is rewritten around scoring regimes instead of engines, and Section 8.5 replaces the ProSE entrapment count with a mapping that is independent of the protein references ProSE's protein-FDR finalization removes. Documentation and reproducibility tooling only: frozen results, inputs, configurations, logs, binaries and hashes are unchanged, and neither engine was rerun.

What the report now compares

Arm A B Basis
ProSE, raw ln(hyperscore) 45,723 47,252 this run
Sage, raw hyperscore 29,538 31,019 derived re-ranking of the frozen Sage tables
ProSE + common rescorer 56,103 57,482 core team, entrapment FDP 0.9-1.2%
Sage + common rescorer 55,716 57,240 core team, entrapment FDP 0.9-1.2%
Sage built-in LDA 58,766 59,646 core team, looser FDP-based cut

Three distinctions are kept explicit:

  • The derived Sage raw arm is not an independent Sage run. The pinned 0.15.0-beta.2 binary exposes no switch to disable post-scoring, so the arm is the frozen Sage PSM table re-ranked on Sage's pre-LDA hyperscore with Sage's q-value procedure. The core team's independent extraction of the same raw counts is 29,524 / 31,121, within 14 / 102 of the derived values.
  • Raw scores and post-scoring are different regimes. ProSE has no counterpart to Sage's built-in LDA in these runs, so the two groups in Figure 1 are not read across.
  • The built-in LDA row is not the common-rescorer result, and not a 1% spectrum_q cut. 58,766 / 59,646 exceeds the all-label counts at spectrum_q <= 0.01 (55,377 / 56,312) in both conditions, so it cannot be the same operating point; its exact definition is not available from the frozen run. The common-rescorer arms and the Sage + RT row come from the core team's investigation and are reported as supplied; the ProSE common-rescorer arm had no retention-time features, so the RT row has no ProSE counterpart.

Entrapment analysis (Section 8.5)

FDR:protein 0.01 makes ProSE drop protein references for PSMs whose proteins fail protein FDR, and entrapment hits are concentrated in exactly those rows, so the first version's 19 / 18 entrapment-only count was a downward-biased lower bound. The revised count maps every identified peptide back to the FASTA independently of the serialized references: 110 / 116 entrapment-only PSMs, with 0 unmapped sequences in both conditions.

The shared class (peptide mapping to both entrapment and non-entrapment proteins) is 33 / 33 PSMs, of which 31 / 25 carry a surviving entrapment reference (the Table 1 basis), 1 / 3 carry no surviving reference, and 1 / 5 carry only non-entrapment references. Those PSMs stay outside the entrapment-only class because they also reference non-entrapment proteins.

The core team's 123 / 129 is not reproduced here, and this report does not claim it is false. The 13-per-condition shortfall is localized to protein assignment rather than peptide mapping, and the route through 13 shared-class PSMs losing a non-entrapment reference is stated as a hypothesis, not a reconciliation. Adjudication needs the core team's intermediate assignment or a rerun with protein inference retained.

Reproducibility

13/13 frozen-artifact hashes verified
tables identical to the report's tables, 18/18 log-to-output assertions passed, 0 failed
rebuilt report byte-identical
verify_entrapment.py: CONSISTENT for the entrapment-only counts 110/116
plot_psm_yield.py --verify: all 10 values re-derived from the frozen outputs
git diff --check: clean

reproduce.sh runs these checks and exits non-zero on any mismatch. It requires the external frozen run root and the two pinned binaries, which are not redistributed here.

The shared-class subcategory counts in Section 8.5 were checked against the frozen idXML in a separate audit; they are reported in the report but are not independently asserted by verify_entrapment.py.

Limitations

  • One injection per condition, no repeats. A and B are different pooled samples, not replicates; results are observed yields, not a run-to-run reproducibility claim.
  • No ground truth for the endogenous peptides. These are yields, not correctness measurements, and the two nominal 1% cuts are not equally stringent.
  • The derived Sage raw arm is a re-ranking, not an independent execution.
  • Core-team-supplied values are not regenerated here. The Sage raw hyperscore difference (14 / 102) and the built-in LDA difference against the locally measured spectrum_q count (3,936 / 3,890) are unresolved and left visible.
  • No general ranking of the engines or of their pipelines is established.

Report

docs/prose-sage-pxd028735/EXPERIMENT_REPORT.md - read the report

Relevant sections: Section 8.5 (entrapment), Section 9.0 (withdrawn comparison), Sections 9.1-9.2 (raw and common-rescorer arms), Section 10 (limitations), Section 11 (reproduction).

AI assistance

Codebuff and ChatGPT provided AI-assisted support during development, auditing, analysis, documentation and reproducibility review. The project author reviewed and approved the changes and retains responsibility for the research decisions, interpretation and final results.

The commits retain human-only author and committer metadata; the latest commit carries an Assisted-by: Codebuff trailer and no Co-authored-by: trailer. Whether that satisfies the template's trailer requirement for substantial AI use is unresolved and remains pending maintainer guidance.

  • New and existing unit tests pass locally - this is a documentation and reproducibility-tooling change; the reproduce.sh validation above was run instead, and no unit-test suite applies
  • I have read the OpenMS AI Policy, and I understand, have reviewed and tested every change in this PR and can explain it in my own words
  • Substantial AI use in PR (agentic tools wrote significant parts); commits carry a Co-authored-by: trailer - awaiting maintainer guidance on whether the Assisted-by: trailer is acceptable

@nej1gotnochill
nej1gotnochill requested review from a team and a balanced review from Copilot November 28, 2026 13:12
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4aa781d5-b8e6-461d-8d39-f01070548782
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Clarify the common nominal 1% PSM FDR comparison, document methodological differences, and qualify peptide and score-ordering interpretations. Preserve frozen experimental results and reproducibility checks.

Assisted-by: ChatGPT
Assisted-by: Codebuff
Add Figure 1 (target PSM yield at 1% nominal PSM FDR for ProSE against stock Sage and a derived hyperscore re-ranking of the frozen Sage tables) with its plotting script and PNG, PDF and SVG outputs, and let build_report.py splice tables around the figure.

Correct the reproduction section to name the script behind each artifact, state that reproduce.sh does not regenerate Figure 1, and list plot_psm_yield.py and figures/ in the artifact inventory. Frozen outputs, hashes and experimental values are unchanged.

Assisted-by: Codebuff
@nej1gotnochill

nej1gotnochill commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator Author

@timosachsenberg a final review pass is ready on this branch if you have time.

c4b1184 adds Figure 1 (target PSM yield at 1% nominal PSM FDR: ProSE, stock Sage, and a derived hyperscore re-ranking of the frozen Sage tables) together with its plotting script and PNG/PDF/SVG outputs.

  • The ProSE and Sage (LDA) bars are independently executed searches, and that pair is the like-for-like comparison the report draws its conclusions from. The third bar is a re-ranking of Sage's frozen TSV on its own pre-LDA hyperscore, not a Sage run with post-scoring disabled — the pinned 0.15.0-beta.2 binary exposes no such switch, so the binary could not be run that way. The figure, its caption and Section 7 all state this.
  • Frozen outputs, hashes.sha256 and every experimental value are unchanged. reproduce.sh passes against the frozen run (13/13 hashes, 18/18 identity checks, regenerated report byte-identical), and plot_psm_yield.py --verify re-derives all six plotted values from the frozen outputs.
  • The remaining text changes are documentation only: Section 11 now names the script behind each artifact and records that reproduce.sh does not regenerate Figure 1, and Section 12 lists plot_psm_yield.py and figures/ in the artifact inventory.

Two things need your view before this can merge, and I am holding off on merging until they are settled:

  1. Scientific interpretation. Whether the Section 9 claim is the one you are comfortable publishing: more target PSMs and target peptides at a common nominal 1% FDR, explicitly not a general ranking of the engines, with the digestion (proline rule, ~1.0% of Sage PSMs), fragment-window, score-basis and estimator differences stated as qualifications rather than used to disqualify the numbers.

Happy to adjust the figure, the caption or any of the qualifying language. Have a nice day (;

@timosachsenberg

Copy link
Copy Markdown

why are there figures in the PR? Is this just to show the results because the idea of the benchmarking server would be to create plots from the recorded metrics?

@nej1gotnochill

Copy link
Copy Markdown
Collaborator Author

why are there figures in the PR? Is this just to show the results because the idea of the benchmarking server would be to create plots from the recorded metrics?

I have attached the figure in this PR as it is mainly intended to visualize the results of this particular experiment and make the effect of Sage's post scoring easier to understand. As of now this figure is part of the reproducible report for now and not as the final visualization approach for the benchmarking infrastructure for now (suggestions are always welcome for the same)...

@timosachsenberg

Copy link
Copy Markdown

Yeah, I don't know. These numbers are way off. If someone of the core team has time to look into that - would be great.

@nej1gotnochill

Copy link
Copy Markdown
Collaborator Author

Uh oh , well it would be really helpful if someone from the core team would could independently check the configs and results particularly the scoring and FDR handling. I am happy to provide the run configs , logs and intermediate outputs to help with that. Till then I feel that we should hold off on merging this until we have a better understanding of the discrepancy, on my side I can work on searching where are things going wrong. Thanks a ton for the feedback on the same (;

@okohlbacher

Copy link
Copy Markdown

I reproduced both conditions locally (same mzML hashes, same 41,209-entry FASTA). ProSE output is identical to the report: 45,723 / 47,252 target PSMs at 1%. Sage's raw-hyperscore result also matches (29,524 / 31,121 vs. 29,538 / 31,019 in the report), so the searches are equivalent.

The gap is entirely post-scoring. The report compares Sage with its built-in LDA rescoring against ProSE without any rescoring. When the same Percolator-style linear SVM (3-fold CV by spectrum) is applied to each engine's .pin output, the engines are on par:

Target PSMs at 1% FDR A B
ProSE, raw score 45,723 47,252
Sage, raw hyperscore 29,524 31,121
ProSE + common rescorer 56,103 57,482
Sage + common rescorer 55,716 57,240
Sage + common rescorer + RT features 57,532 58,593
Sage built-in LDA 58,766 59,646

The remaining ~4–5% edge of Sage's built-in pipeline comes from features ProSE does not export, mainly predicted retention time. Entrapment-estimated FDP is 0.9–1.2% for every row, so no arm is anti-conservative or overly strict.

The spectrum-level comparison points the same way. Of the ~15k / 14.5k spectra Sage accepts and ProSE does not, ProSE has the same peptide as top hit in ~11k / 10.6k, just above the 1% cut (median q ≈ 3.3%). Only ~800 per run receive no ProSE PSM at all. Spectrum filtering, charge handling and the proline rule are therefore not the cause.

The ProSE entrapment counts in Table 1 are not valid. With FDR:protein 0.01, ProSE removes the protein references of PSMs whose protein fails protein FDR (the 862 / 856 "no surviving protein reference" rows). Entrapment hits end up there. With protein references kept, ProSE has 123 / 129 entrapment-only PSMs at 1%, against the 19 / 18 reported.

Suggested changes before this can be merged:

  1. Compare like with like: ProSE + Percolator vs. Sage (LDA), and/or raw ProSE vs. raw Sage hyperscore. Do not compare ProSE raw against Sage LDA.
  2. Count entrapment from PSMs with protein references intact (FDR:protein 0) or from an independent peptide→FASTA mapping.
  3. Rewrite Section 9 and drop or redo Figure 1 accordingly. As written, "Sage recovers more target identifications" is a statement about Sage's rescoring, not about the search.

@nej1gotnochill

Copy link
Copy Markdown
Collaborator Author

Thanks a ton @okohlbacher for the thorough investigation on the same. This clarifies the discrepancy and confirms that the comparison which I did was not like for like. I agree with all the proposed changes particularly correcting the entrapment counts and revisiting Section 9 and Figure before merging. I will update the report accordingly , thank you and have a nice day (;

Rewrite Section 9 around the scoring regime instead of the engines: the ~20% gap
compared raw ProSE against LDA-rescored Sage, so the claim that Sage recovers more
target identifications is withdrawn. Figure 1 is regrouped into "no post-scoring"
(ProSE raw, derived Sage hyperscore) and "Sage post-scoring", and Table 6 reports
the core team's common-rescorer arms with each row's operating point, since the
built-in LDA count exceeds the all-label count at spectrum_q <= 0.01.

Replace the ProSE entrapment counts, which were computed from protein references
that protein-FDR finalization had already removed, with an independent
peptide-to-FASTA mapping: 110 / 116 entrapment-only PSMs, asserted by the new
verify_entrapment.py and run from reproduce.sh. Section 8.5 bounds the remaining
110/116-versus-123/129 gap at protein assignment rather than peptide mapping and
records the shared-class split (31/25 with a surviving entrapment reference, 1/3
with none, 1/5 with only non-entrapment references); the 13-per-condition route is
stated as a hypothesis, and 123/129 is not claimed to be false.

Relabel the entrapment rows as lower bounds, drop the asymmetric ProSE-versus-Sage
entrapment contrast, mark the core team's spectrum-level figures as supplied, and
strip trailing whitespace from the generated SVG so git diff --check stays clean.
Frozen outputs, hashes and experimental values are unchanged.

Assisted-by: Codebuff
@nej1gotnochill nej1gotnochill changed the title docs: add reproducible ProSE vs Sage experimental report docs: clarify ProSE vs Sage PSM comparison across scoring regimes Dec 2, 2026
@nej1gotnochill

Copy link
Copy Markdown
Collaborator Author

@timosachsenberg and @okohlbacher Once again thanks a ton for the feedback and constant support on this PR and for sharing the additional measurements. I have updated the PR to reflect the like to like comparison and in particular I have withdrawn the original interpretation that Sage intrinsically recovers around 20% more target PSMs , separated the raw score and post scoring regimes and included the common rescorer results you provided.

I have also revised the entrapment analysis using an independent peptide to FASTA mapping. This gives 110/116 entrapment only PSMs rather than the 123/129 you reported. I havent been able to reproduce the remaining difference so I have documented it explicitly rather than claiming it is resolved. The report describes what we checked and what additional intermediate data or an FDR:protein 0 rerun would help settle it. The updated report and the reproducibility checks have been addressed in the latest commit. Thank you and have a wonderful day ahead (; !

This branch has not been deployed

No deployments
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.

4 participants