Skip to content

fix(inputs): a photo's run reads each protein's sequence and taxon at the cut - #1297

Merged
github-actions[bot] merged 2 commits into
developfrom
fix/cut-dated-inputs
Nov 23, 2026
Merged

github-actions[bot] merged 2 commits into
developfrom
fix/cut-dated-inputs

Conversation

@frapercan

@frapercan frapercan commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

The bug

protein.sequence_id and protein.taxonomy_id are today's UniProt entry. Four readers used them on photo windows:

Reader Effect in development Effect in production
Prediction: alignment and length inputs (batch and unified path) 12 features silently null today's sequence, published after the cut
Prediction: taxonomy inputs 6 features silently null today's organism
Transitions export: the queries a window asks about zero queries for every photo window today's sequence ids
Target FASTA and its declared query set entries targets without a sequence today's sequences in the scored file

The fix

  • On a run whose annotation set a photo loaded (photo_of), the readers take the member's sequence (cut_photo_member.sequence_md5) and taxon (cut_photo_member.taxon_id).
  • They do it through two shared functions in _photo_sequences.py: photo_sequences and photo_taxa.
  • A run over a set no photo loaded reads today's entry, as before.
  • Uploaded query sets keep their own sequences.

Tests

  • New: tests/test_a_photo_run_reads_the_cut_inputs.py (test database).
    • It gives a member a different sequence and taxon today than at the cut, so a leaking reader returns the wrong values instead of nothing, whatever the environment.
    • Three of its four tests fail without the fix.
  • Changed: the fake session of tests/test_the_queries_a_window_asks_about.py now answers the photo lookup with none, since that universe has no photos.
  • Regression run: 54 test files on prediction, export, transitions, features, retrieval, queries and targets: 850 passed, 2 skipped. The lint gates pass.

Not in this change (next)

  • Other readers that still read today's entries:
    • the legacy training dump and the mini-job feature export (training_dump/_data_loaders.py, export_minijobs/_export_features_batch.py);
    • the InterProScan input (run_interproscan_batch.py).
  • The information accretion feature. It needs information_accretion_set as a dated reference first.
  • The taxonomy tree, which waits for the author's choice. Until it exists, the taxonomy distances stay empty even with the right taxon.
  • A re-scoring of the 211->227 ProtT5-XL set, to record the coverage of the 18 features per window.

This is part of the closure plan's first wave (dated inputs), together with #1296.

Verified in the development universe

The branch's readers were run against the development store, without deploying it: 500 targets of 211->227 sampled with seed 0, the window's start set 453f8cf5, photo b98ba58b.

Reader At the cut (this branch) Today's entry (before)
Sequences 500 of 500 0 of 500
Taxa 499 of 500 known 0 of 500 known

… the cut

protein.sequence_id and protein.taxonomy_id are today's UniProt entry.
Four readers used them on photo windows:
- the alignment, length and taxonomy inputs of prediction (both the
  batch and the unified path);
- the queries of the transitions export;
- the target FASTA and the entries its query set declares.

In development those columns are empty for every photo member, so the
features were silently null and the transitions export asked about no
protein. In production they hold today's values, which would hand a
model knowledge published after the cut.

On a run whose annotation set a photo loaded (photo_of), the readers
now take the member's sequence (cut_photo_member.sequence_md5) and
taxon (cut_photo_member.taxon_id) through two shared functions,
photo_sequences and photo_taxa. A run over a set no photo loaded reads
today's entry, as before. Uploaded query sets keep their own sequences.

The new tests give a member a different sequence and taxon today than
at the cut, so a reader that leaks returns the wrong values instead of
nothing, whatever the environment. Three of the four fail without the
fix. The fake session of the transitions query tests now answers the
photo lookup with none: that universe has no photos.

Not in this change, and next: the legacy training dump and the
mini-job feature export (training_dump/_data_loaders.py,
export_minijobs/_export_features_batch.py), the InterProScan input
(run_interproscan_batch.py), the information accretion feature, and
the taxonomy tree, which waits for the author's choice.
@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 53.57143% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.64%. Comparing base (3eca787) to head (7d564fd).

Files with missing lines Patch % Lines
...re/operations/predict_go_terms/_photo_sequences.py 26.66% 11 Missing ⚠️
...rotea/core/operations/export_evaluation_targets.py 50.00% 8 Missing ⚠️
...e/operations/predict_go_terms/_batch_op_feature.py 68.75% 5 Missing ⚠️
protea/core/transitions_export/_queries.py 71.42% 2 Missing ⚠️

❌ Your project check has failed because the head coverage (83.90%) is below the target coverage (85.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1297      +/-   ##
===========================================
- Coverage    85.69%   85.64%   -0.05%     
===========================================
  Files          471      471              
  Lines        37374    37414      +40     
===========================================
+ Hits         32026    32042      +16     
- Misses        5348     5372      +24     
Files with missing lines Coverage Δ
.../core/operations/predict_go_terms/_unified_path.py 96.66% <100.00%> (ø)
protea/core/transitions_export/_queries.py 95.65% <71.42%> (-4.35%) ⬇️
...e/operations/predict_go_terms/_batch_op_feature.py 95.03% <68.75%> (-3.42%) ⬇️
...rotea/core/operations/export_evaluation_targets.py 68.57% <50.00%> (-2.43%) ⬇️
...re/operations/predict_go_terms/_photo_sequences.py 63.26% <26.66%> (-16.74%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Base automatically changed from integration/three-families to develop November 23, 2026 10:23
@frapercan
frapercan marked this pull request as ready for review November 23, 2026 12:12
@github-actions
github-actions Bot merged commit 3feb615 into develop Nov 23, 2026
21 of 22 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