Repository navigation
feat(operations): link_protein_sequences links each protein to its photo's sequence - #1303
Merged
github-actions[bot] merged 1 commit intoNov 24, 2026
Merged
Conversation
…oto's sequence protein.sequence_id was empty for every protein in the clean store and in dev (0 of 2,758,480), so the instrument counted no embeddings while the eight banks held 20,191,896 vectors. The operation that fills it, resolve_protein_sequences, asks today's UniProt and had never run. The author chose the photos (2026-11-24). Every photo keeps each member's sequence at its cut by md5, and the banks were built from exactly those sequences. link_protein_sequences sets each unlinked protein's sequence_id to the sequence of the latest cut that records one, with no network call. The population is read when the job runs, a protein already linked is left alone, and a dry run counts without writing. Registered as a derived job on protea.jobs, documented in the reference and the operations page, and listed in the spec, payload and autodoc gates.
Codecov Report❌ Patch coverage is
❌ Your project check has failed because the head coverage (83.92%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #1303 +/- ##
===========================================
- Coverage 85.69% 85.65% -0.04%
===========================================
Files 471 472 +1
Lines 37374 37442 +68
===========================================
+ Hits 32026 32070 +44
- Misses 5348 5372 +24
🚀 New features to boost your workflow:
|
frapercan
marked this pull request as ready for review
November 24, 2026 16:57
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 24, 2026
…rom its entry metadata (#1304) ## The gap In the store now serving the public site, and in dev, `entry_name`, `organism`, `taxonomy_id`, `length` and `reviewed` are NULL in `protein` for all 2,758,480 proteins. No operation fills them there; `resolve_protein_metadata` writes them to `protein_uniprot_metadata`. So a protein page showed empty top-level fields next to a `metadata` object holding the values, and `/proteins/stats` reported 0 reviewed proteins. ## The change The author chose that the API read the metadata (2026-11-24). - **Detail and listing:** each field is the protein's own, else its canonical entry's metadata. An isoform takes the entry's name, organism and review status, never its length. - **The `reviewed` filter and the stats:** a protein counts as reviewed when its own row or its entry's metadata says so. On dev's data this counts 574,058 reviewed proteins, matching the 573,661 Swiss-Prot entries of cut 227 within the gap between the two releases. - **The search** also matches the entry's name and organism. - **The listing** reads the metadata of its page in one query. - `_matches` and `_metadata_of` keep `list_proteins` under the 60-line smells limit. A store that does fill the columns, as the previous one did, keeps showing them, because the protein's own value wins. ## Tests - `test_empty_core_fields_come_from_the_entry_metadata`: a protein with every core field empty shows its entry's name, organism, taxon, length and review status. - Locally, `tests/test_proteins_router.py`, `tests/test_proteins_stats_router.py` and `tests/test_endpoint_gating_sweep.py` pass. `lint-gates.sh` is green. ## Not in this PR The instrument's statistics sections in `proteins_stats.py` (the top organisms and the length histogram) still read `protein.organism` and `protein.length`. Once `link_protein_sequences` (#1303) has run, the length can come from the linked sequence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gap
protein.sequence_idis empty for every protein in the store now serving the public site, and in dev too: 0 of 2,758,480. The instrument joins proteins to embeddings through that column, so it reportswith_embeddings: 0while the eight banks hold 20,191,896 vectors, and a protein page shows no sequence. The operation meant to fill it,resolve_protein_sequences, asks today's UniProt for every accession and had never run in either store.The change
The author chose the photos over UniProt (2026-11-24). Every photo records each member's sequence at its cut by md5 (
cut_photo_member.sequence_md5), and the embedding banks were built from exactly those sequences.link_protein_sequences:protein.sequence_idfor every protein that has none to the sequence recorded by the latest cut that records one for it, so a protein whose sequence changed between cuts takes the latest;resolve_protein_sequences, is left alone;dry_run, counts what it would link and writes nothing;unlinked_before,linkedandunlinked_after.It is registered as a derived job on
protea.jobs, and documented in the core reference and the operations page. It is also listed in the spec gate (71 operations), the payload negative matrix and the autodoc whitelist.Checked against dev's data
The operation's own count query, run read-only on dev: 2,758,264 of the 2,758,480 proteins would be linked, and 216 have no sequence in any photo. Every one of the 2,523,987 distinct member md5 values is in
sequence, andsequence.sequence_hashis the md5 of the sequence (2,000 of 2,000 sampled).Tests
tests/test_link_protein_sequences.py: it links and reports what is left; a dry run counts and writes nothing; the statement takes the latest cut and only fills gaps.tests/test_every_operation_declares_its_spec.pyandtests/test_payload_validation.pypass with the new operation.lint-gates.shis green, andcheck_autodoc_coverage.pycovers 59 of 59 patterns.After merging
The plan is to run it on dev first and then on the public store through the desktop workers, comparing the two results as with every other step.