[Artifacts] Populate structural_data (PDB/UniProt/AlphaFold) for top 15 demo targets to activate Mol* viewer done coding:8

← Artifacts
IMPORTANT: Keep Mol* protein viewer on entity/hypothesis/challenge detail pages where it adds value. Do NOT feature it prominently on /showcase. Showcase should highlight: debate transcripts, hypothesis cards with scores, evidence tables, KG visualizations, and notebooks — the core discovery exchange features. ## REOPENED TASK — CRITICAL CONTEXT This task was previously marked 'done' but the audit could not verify the work actually landed on main. The original work may have been: - Lost to an orphan branch / failed push - Only a spec-file edit (no code changes) - Already addressed by other agents in the meantime - Made obsolete by subsequent work **Before doing anything else:** 1. **Re-evaluate the task in light of CURRENT main state.** Read the spec and the relevant files on origin/main NOW. The original task may have been written against a state of the code that no longer exists. 2. **Verify the task still advances SciDEX's aims.** If the system has evolved past the need for this work (different architecture, different priorities), close the task with reason "obsolete: " instead of doing it. 3. **Check if it's already done.** Run `git log --grep=''` and read the related commits. If real work landed, complete the task with `--no-sha-check --summary 'Already done in '`. 4. **Make sure your changes don't regress recent functionality.** Many agents have been working on this codebase. Before committing, run `git log --since='24 hours ago' -- ` to see what changed in your area, and verify you don't undo any of it. 5. **Stay scoped.** Only do what this specific task asks for. Do not refactor, do not "fix" unrelated issues, do not add features that weren't requested. Scope creep at this point is regression risk. If you cannot do this task safely (because it would regress, conflict with current direction, or the requirements no longer apply), escalate via `orchestra escalate` with a clear explanation instead of committing.

Git Commits (2)

[Artifacts] Add structural enrichment script + spec for Mol* viewer activation [task:f3f89c06-7ffd-4472-8b73-9ef9196ae0a7]2026-04-04
[Artifacts] Add structural enrichment script + spec for Mol* viewer activation [task:f3f89c06-7ffd-4472-8b73-9ef9196ae0a7]2026-04-04
Spec File

[Artifacts] Populate structural_data (PDB/UniProt/AlphaFold) for top 15 demo targets to activate Mol* viewer

ID: f3f89c06-7ff Priority: 88 Type: one_shot Status: open

Goal

Populate structural_data JSON in the targets table for the top 15 demo targets with known UniProt IDs, PDB structure IDs, and AlphaFold availability flags. This activates the Mol* 3D protein viewer (added in task:08d47950) which renders when pdb_ids is non-empty or alphafold=True + uniprot_id is present.

Acceptance Criteria

☐ Top 15 demo targets have structural_data populated with UniProt IDs
☐ Targets with PDB structures have pdb_ids list and pdb_available=True
☐ AlphaFold flag set to True for all human proteins (comprehensive coverage)
☐ At least 5 target pages show the embedded Mol* viewer with working PDB structures
☐ Work log updated with timestamped entry

Known UniProt/PDB Mappings

GeneTarget IDUniProtKey PDB IDs
TREM2target-trem2Q9NZC25ELI, 5UD7, 5UTT
APOEtarget-apoeP026491GS9, 1NFN, 2KC3
CYP46A1target-cyp46a1Q9Y6A22Q9F, 3MDM, 3MDL
HDAC3target-hdac3O153794A69, 4QX2, 4QXO
BRD4target-brd4O608852OSS, 2YEL, 3MUK
SIRT1target-sirt1Q96EB64KXQ, 5BTR, 4IG9
TARDBPtarget-tardbpQ131482N3X, 2KXN, 4IUF
TET2target-tet2Q6N0214NM6, 5D9Y
PRKAA1target-prkaa1Q131314RER, 2LTW
ACSL4target-acsl4O604884WD1

Implementation

Write enrich_target_structures.py that:

  • Uses a hard-coded dict of gene → {uniprot_id, pdb_ids, pdb_count, alphafold, cryo_em}
  • Updates structural_data column in targets table via sqlite3
  • Also sets pdb_available=True for targets with pdb_ids
  • Runs as a one-off migration
  • Work Log

    2026-04-04 — Spec created

    • Task created after verifying all target pages now return 200 (clinical_phase bug fixed)
    • Protein viewer code is deployed but no targets have structural_data populated
    • This task will activate the viewer for key demo targets

    Payload JSON
    {
      "requirements": {
        "coding": 8
      },
      "_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
      "_reset_at": "2026-04-18T06:29:22.046013+00:00",
      "_reset_from_status": "done"
    }

    Sibling Tasks in Quest (Artifacts) ↗