Skip to content

fix(benchmark): use SoCe-only entrapment FASTA for PXD028735 - #34

Merged
poshul merged 1 commit into
mainfrom
fix/pxd028735-soce-entrapment
Nov 26, 2026
Merged

poshul merged 1 commit into
mainfrom
fix/pxd028735-soce-entrapment

Conversation

@nej1gotnochill

Copy link
Copy Markdown
Collaborator

Description

The PXD028735 (ProteoBench HYE) benchmark arm uses an entrapment (decoy) FASTA that is supposed to contain only an organism provably absent from the sample. The generator assembled that FASTA from the entire in-tree SoCe file, doc/pyopenms/src/data/18Protein_SoCe_Tr_detergents_trace.fasta. That file has 9,439 entries, but only 9,320 of them are Sorangium cellulosum So ce56 proteins: 119 entries are contaminant or foreign — 104 are bare ACC|NAME headers with no OS= annotation at all (human keratins, trypsins, BSA, ...) and 15 carry a different organism.

Those 119 entries are exactly the ones that can share sequence with the HYE targets, so the previous entrapment set was not a clean absent-organism control: an entrapment hit could come from a protein that is genuinely present in the sample. This PR makes the entrapment FASTA SoCe-only and makes the generator refuse anything it cannot verify.

Design intent and rationale

  • Exact-organism retention (benchmark/make_hye_entrapment_fasta.py): an entry is retained only when its header carries OS=Sorangium cellulosum (strain So ce56) exactly. The 119 excluded entries are excluded for that one reason — they are not annotated as the exact So ce56 organism — and not because of any per-entry claim about overlap. A separate audit of the source against the HYE target FASTA found 39 normalized-accession, 37 protein-name and 29 exact-sequence matches, which is evidence that excluded entries would have collided with targets; it is not a claim that each of the 119 overlaps in all three ways.
  • Verbatim output: retained entries keep their source order and sequences unchanged; accessions are prefixed with ENTRAPMENT_ so the arm is identifiable downstream. No sequence is rewritten, trimmed or re-derived.
  • Collision and integrity checks: the generator fails closed on an empty retained set, on any accession, protein-name or sequence overlap between the retained entrapment set and the target FASTA (reporting the overlap per criterion), and on duplicate identifiers. The organism must remain provably absent from the sample or nothing is written.
  • Decoy handling: it refuses any source carrying decoy markers (rev_/DECOY_/REV_/decoy_ prefixes, _rev/_REV identifier suffixes) and points at the targets-only file. The target_decoy variant marks decoys with a _rev suffix, which a prefix check misses; copying that file would silently put reversed sequences into the entrapment set.
  • Summary output: --summary emits key=value counts so the shell wrapper can assert the result numerically instead of trusting a log line.
  • Input preparation (benchmark/prepare_pxd028735_inputs.sh): writes entrapment_hye_soce.fasta, validates the summary numerically and by sum and overlap (exit 4 on mismatch), and records the new provenance lines describing the source, the retention rule and the measurement convention used for the shared-peptide check.
  • Workflow wiring (.github/workflows/benchmark.yml): the two PXD028735 arm references that pointed at the mixed entrapment FASTA now point at entrapment_hye_soce.fasta. The unrelated generic prose arm is untouched, and no search parameters, scoring settings, metric classification or decoy-generation logic were changed.
  • Tests: 11 regression tests cover organism filtering, verbatim retention, prefixing, decoy refusal, empty-set and overlap refusal, duplicate-identifier refusal and deterministic output. The suite is registered in the Run Python test suites step of pr-checks.yml, so the repository's CI test-coverage guard accounts for it.

Validation and test evidence

Run by the author on the Windows development environment against this branch's content, before the commit was created:

  • python -m pytest benchmark/test_make_hye_entrapment_fasta.py -q — 11 passed (1.45 s), exit 0.
  • python -m py_compile benchmark/make_hye_entrapment_fasta.py — passed.
  • python tests/validate_ci_test_coverage.py — discovered: 8 / configured: 8 / excluded: 0, RESULT: OK, exit 0.
  • git diff --cached --check — clean, exit 0.
  • Staged change verified as exactly five paths (M benchmark.yml, M pr-checks.yml, M make_hye_entrapment_fasta.py, M prepare_pxd028735_inputs.sh, A test_make_hye_entrapment_fasta.py), 576 insertions / 38 deletions, with no unstaged or untracked files and the branch 0 behind main.

A documentation-only correction was applied during review and is included here: the module docstring originally stated that all 119 excluded entries "overlap the HYE target FASTA by normalized accession, protein name and sequence", which overstates the evidence. It now separates the exclusion reason from the independent overlap-audit figures. No filtering, collision or classification logic was touched by that correction.

Known limitations

  • The 39 / 37 / 29 overlap-audit figures are transcribed from an earlier audit of the source against the HYE target FASTA; they were not recomputed in the final validation pass, because that requires the pinned HYE FASTA and SoCe source, which are not present locally.
  • benchmark/prepare_pxd028735_inputs.sh was not executed end to end: it needs the pinned input files (HYE target FASTA and the PXD028735 mzML), which are unavailable here and were not fetched over the network. Its new guards and provenance lines are therefore reviewed by inspection, not exercised against real inputs.
  • No full benchmark run was performed for this change, and no end-to-end input preparation is claimed to have been validated. The retained/excluded counts above (9,320 / 119) come from the earlier source audit, not from a run in this final pass.
  • The workflow change is limited to the two FASTA references; it does not alter how the arms are executed.

Checklist

  • Make sure that you are listed in the AUTHORS file
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes
  • Updated or added python bindings for changed or new classes (Tick if no updates were necessary.)

This repository has no AUTHORS file, so the first item is not applicable. There are no Python bindings here, so the last item is ticked as not necessary.

AI use (see the OpenMS AI Policy)

  • 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
  • AI use in this PR (tick one):
    • None
    • Assisted (e.g. completion, suggestions, small edits); commits carry an Assisted-by: trailer
    • Substantial (e.g. agentic tools wrote significant parts); commits carry a Co-authored-by: trailer, and the description above explains the design intent and rationale

Substantial agentic AI assistance was used for the implementation and testing of this contribution.

  • Implementation and test development: an agentic coding assistant (Freebuff) wrote the generator changes, the shell-wrapper guards, the workflow edits and the 11 regression tests.
  • Design input and review: ChatGPT provided design discussion and independent review of the diff; it did not author the code.
  • Human responsibility: the author directed the work, reviewed and tested the changes, and takes responsibility for understanding and maintaining the contribution.

The commit carries a Co-authored-by: trailer for the agentic tool and an Assisted-by: ChatGPT trailer, per the policy. No AI tool produced benchmark results for this PR, and no dataset was downloaded or processed by an AI tool.

No need to edit the CHANGELOG file: entries are generated automatically once per week from merged changes.

How can I get additional information on failed tests during CI

Click to expand If your PR is failing you can check out
  • The details of the action statuses at the end of the PR or the "Checks" tab.
  • http://cdash.seqan.de/index.php?project=OpenMS and look for your PR. Use the "Show filters" capability on the top right to search for your PR number.
    If 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.

⚠️ Note: Once you opened a PR try to minimize the number of pushes to it as every push will trigger CI (automated builds and test) and is rather heavy on our infrastructure (e.g., if several pushes per day are performed).

The PXD028735 (ProteoBench HYE) arm decoyed against an entrapment FASTA built
from the whole in-tree SoCe file, which carries 119 contaminant and foreign
entries (104 bare ACC|NAME headers without any OS= annotation, 15 from other
organisms) alongside the 9,320 S. cellulosum So ce56 proteins. Those entries can
collide with HYE targets, so the entrapment set was not a clean
absent-organism control.

- make_hye_entrapment_fasta.py: retain only entries annotated exactly
  "Sorangium cellulosum (strain So ce56)", preserving source order and
  sequences verbatim and prefixing accessions with ENTRAPMENT_; fail closed on
  decoy-marked sources (the _rev suffix of the target_decoy variant), on an
  empty retained set, and on accession/name/sequence overlap with the target
  FASTA or duplicate identifiers; emit a machine-readable --summary.
- prepare_pxd028735_inputs.sh: write entrapment_hye_soce.fasta, guard the
  summary numerically and by sum and overlap (exit 4), and record the new
  provenance lines.
- benchmark.yml: both PXD028735 workflow references point at the SoCe-only
  FASTA; the generic prose arm is unchanged.
- tests: 11 regression tests for the generator, registered in the pr-checks
  test list so the coverage guard sees them.

Co-authored-by: Codebuff <noreply@codebuff.com>
Assisted-by: ChatGPT
@nej1gotnochill
nej1gotnochill requested review from a team and a balanced review from Copilot November 26, 2026 16:48
@coderabbitai

coderabbitai Bot commented Nov 26, 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: 35e01a21-78a2-4d28-b09a-762e469decdb
  • 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.

@poshul
poshul merged commit 86ea502 into main Nov 26, 2026
2 checks 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.

3 participants