Files
2026-08-03 18:42:47 +08:00

3.5 KiB
Executable File

Task 2 Report — Reference-bundle ID evidence schema

Status

DONE_WITH_CONCERNS

Root cause

_fasta_header_index() preserved the complete FASTA header but extracted only gene and protein_id metadata. Consequently, numeric NCBI GeneID evidence in [db_xref=GeneID:<digits>] was not represented as a structured record field, and _build_reference_bundle_id_map() had no ncbi_gene_id TSV column.

Changes

  • apps/web/pipeline_backend.py (reference-bundle parsing/schema)
    • Parse the exact numeric annotation form [db_xref=GeneID:<digits>] into a separate ncbi_gene_id record field.
    • Add ncbi_gene_id to pep_cds_idmap.tsv, using the existing CDS-first, PEP-fallback precedence.
    • Leave the existing gene_id extraction and selection unchanged, so LOC110806180 remains the gene_id value.
    • Emit an empty string when neither FASTA record supplies numeric GeneID.
  • tests/unit/test_pipeline_backend_execution_env.py (focused regression)
    • Add a real parser/schema test whose CDS header contains both [gene=LOC110806180] and [db_xref=GeneID:110806180].
    • Assert the TSV retains gene_id=LOC110806180 and separately emits ncbi_gene_id=110806180.
  • No manifest count was added because Task 2 does not require one and the parser/schema behavior is sufficient.

TDD evidence

RED

Command:

/home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest tests/unit/test_pipeline_backend_execution_env.py -k reference_bundle_id_map -q

Result before production edits: exit code 1; 1 failed, 30 deselected. The expected assertion path failed with:

KeyError: 'ncbi_gene_id'

The preceding gene_id == "LOC110806180" assertion passed, confirming the failure was specifically the missing numeric GeneID schema field.

GREEN — focused regression

The same command after the minimal production edit exited 0 with:

1 passed, 30 deselected in 0.08s

GREEN — required focused suite

Command:

/home/xia-lab/miniconda3/envs/test4py311/bin/python -m pytest tests/unit/test_pipeline_backend_execution_env.py -k 'reference_bundle or ppi' -q

Result: exit code 0; 25 passed, 6 deselected in 1.83s.

Syntax compilation

Command:

/home/xia-lab/miniconda3/envs/test4py311/bin/python -m py_compile apps/web/pipeline_backend.py

Result: exit code 0; no output.

Scope review

The complete diffs against /tmp/ppi-id-resolution-task2-baseline/ contain only:

  • the two parser record lines and two TSV schema/row lines in _fasta_header_index() / _build_reference_bundle_id_map();
  • one csv test import and the focused regression test;
  • this report.

PPI querying, Ortholog logic, frontend behavior, canonical IDs, contracts, manifests, and unrelated stages were not changed. No service or Celery restart was performed because Task 2 validation directly imports the current module and does not exercise a running service. No diagnostic record was updated because the failure is covered by the new regression test and does not add runtime diagnostic behavior. No real-data/API execution was run because the accepted Task 2 brief explicitly scopes validation to the local reference-bundle parser and focused unit suite.

Concerns

  • Pytest emitted the pre-existing RequestsDependencyWarning that installed urllib3/character-detection package versions do not match the version range expected by requests. It did not cause test failures, but the environment dependency skew remains outside Task 2 scope.