Skip to content

M2: scoring profiles — the triage policy becomes a choice (#93) - #102

Merged
Jiahuic merged 2 commits into
mainfrom
feat/93-scoring-profiles
Nov 15, 2026
Merged

Jiahuic merged 2 commits into
mainfrom
feat/93-scoring-profiles

Conversation

@Jiahuic

@Jiahuic Jiahuic commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Merge order: after #98 → #99 → #100 → #101, using a merge commit (not squash or rebase). Base is main; until the earlier PRs merge, this diff also shows their changes.

Part of #93 and #87.

WEIGHTS encodes an antibacterial target-selection policy. That is wrong for viral proteins, single hypotheticals or human targets, and the weights do not transfer between bacterial genomes either: G37 and HS11286 put 32 and 10 hypotheticals in the top 50 under identical weights (#61).

What changes

  • Profiles (s2f/m2_triage/profiles.py):
    • bacterial-target is the default and is exactly today's WEIGHTS, so no ranking changes.
    • evidence-only uses structural evidence alone, with no penalties and no human-homolog disqualification. It is provisional and uncalibrated.
  • --weights FILE: the JSON must name every component, so a typo cannot silently drop one to 0.
  • Recorded: run.json stores the profile and its weights, and each protein's weights_version reads <profile>@<version>.
  • Rescore with no re-querying: python -m s2f.m2_triage.rescore --run runs/<id> --profile evidence-only writes m2_pdb/rescored/<profile>.tsv and leaves the run's own ranking untouched.
  • The runner forwards --profile and --weights. Docs are in docs/02a-m2-pdb-evidence.md under "Scoring profiles".

Verified

  • Rescoring an M2 dry-run under the default profile reproduces M2's ranking exactly: 0 rank and 0 score mismatches. This is also pinned by a test.
  • Could not rescore the recorded G37 and HS11286 runs. Their proteins.tsv predates three components (surface_bonus, ligandable_homolog, membrane_penalty), and the tool refuses them rather than guessing zeros. They need a fresh M2 run to compare profiles.

Not done from #93

  • Below a minimum proteome size, skipping ranking and reporting evidence only. The issue stays open for that.

Tests: 10 new (tests/test_m2_profiles.py), 452 total.

🤖 Generated with Claude Code

WEIGHTS encodes an antibacterial target-selection policy, wrong for
viral proteins, single hypotheticals or human targets, and not portable
between bacterial genomes either (#61). The weights are now a named
profile (bacterial-target, the unchanged default; evidence-only,
provisional) or a JSON file naming every component. run.json records
the profile and its weights, and python -m s2f.m2_triage.rescore
re-ranks recorded proteins.tsv under another profile with no
re-querying, reproducing M2 exactly under the default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jiahuic
Jiahuic merged commit b281356 into main Nov 15, 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.

1 participant