Skip to content

feat(proteins): today's UniProt entry, stamped with its release, shown and never used on a cut - #1290

Merged
frapercan merged 1 commit into
integration/three-familiesfrom
feat/current-metadata-for-display
Nov 22, 2026
Merged

frapercan merged 1 commit into
integration/three-familiesfrom
feat/current-metadata-for-display

Conversation

@frapercan

Copy link
Copy Markdown
Owner

What

  • New operation resolve_protein_metadata (on protea.jobs). It fetches each canonical protein's current UniProt entry through the plugin's fetch_accessions, in batches of a thousand.
    • Every row is stamped with the UniProt release and date that served it; an answer that names no release is refused.
    • It writes protein_uniprot_metadata only, never the protein row.
    • Its population is a query: no row, or a row with no release.
    • Accessions UniProt no longer serves are counted as absent.
  • Migration 5d2e8c1b4a73 adds uniprot_release, uniprot_release_date and the entry's descriptive fields: entry name, reviewed, protein and gene names, organism and its identifier, length.
  • The protein route returns them, and the protein page shows them in a card that names the release and says the entry is today's knowledge: shown, never used to predict or evaluate on an earlier cut.
  • protea-sources is pinned at 696533ba (feat(services): F2D embeddings predict-request validation #42, fetch_accessions with the release).

Why

The knowledge in a UniProt entry changes from one release to the next, so what an entry says today was not known at an earlier cut. The platform wants today's entries to show proteins and annotate them today, without any of it reaching a model, a feature, an export or an evaluation on a cut.

fetch_uniprot_metadata can also backfill the protein row's organism and gene, which feature code reads. The new operation never touches that row. A protein's organism at a cut comes from that cut's photo (cut_photo_member.taxon_id).

Tests

  • tests/test_resolve_protein_metadata.py:
    • the population is a query;
    • transport only through the plugin;
    • every row names its release;
    • the protein row is never written;
    • an answer without a release is refused;
    • absent accessions are counted;
    • a second run asks only for what has no release;
    • a dry run writes nothing.
  • tests/test_current_metadata_stays_out_of_experiments.py: only the model, the two fetch operations and the protein route may name the table.
  • apps/web/tests/theCurrentEntrySaysItsRelease.test.tsx: the card names the release, or says it is not recorded.
  • Local runs:
    • full suite against Postgres: 7826 passed, 78 skipped, 11 xfailed, 2 xpassed;
    • lint gates: ruff format and check, smells, sets, openapi-refs;
    • mypy on the changed modules;
    • tsc;
    • vitest for the card and the message parity checks.

…n and never used on a cut

A protein page shows UniProt functional metadata from protein_uniprot_metadata,
which nothing in dev had filled, and the operation that fills it
(fetch_uniprot_metadata) can also backfill the protein row's organism and
gene, which feature code reads. Filling them from today's entry would hand
that code knowledge from after its cut.

resolve_protein_metadata fetches each canonical protein's current entry
through the protea-sources plugin's fetch_accessions, which now names the
UniProt release that served each batch (protea-sources #42, pinned here).
Every row is stamped with that release and its date, and an answer that
names no release is refused. It writes protein_uniprot_metadata only, never
the protein row; its population is a query (no row, or a row with no
release), and accessions UniProt no longer serves are counted as absent.

Migration 5d2e8c1b4a73 adds the release, its date and the entry's
descriptive fields (entry name, reviewed, protein and gene names, organism
and its identifier, length). The protein route returns them, and the page
shows the entry under a card that names its release and says it is today's
knowledge: shown, never used to predict or evaluate on an earlier cut.

tests/test_current_metadata_stays_out_of_experiments.py pins the boundary:
only the model, the two fetch operations and the protein route may name the
table. A protein's organism at a cut comes from that cut's photo
(cut_photo_member.taxon_id).
@frapercan
frapercan marked this pull request as ready for review November 22, 2026 11:13
@frapercan
frapercan merged commit 3a520eb into integration/three-families Nov 22, 2026
21 checks passed
@frapercan
frapercan deleted the feat/current-metadata-for-display branch November 22, 2026 11:13
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