{
  "filename": "plot_5.png",
  "iteration": 3,
  "description": "Final comprehensive provenance figure showing GO annotation data flow, decision table, evidence weights, and verdict for LPL1 GO:0047372 assessment",
  "timestamp": "2026-07-05 07:54:56",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig = plt.figure(figsize=(18, 14))\nfig.suptitle('Final Provenance Summary: LPL1 (Q5AMS2) GO:0047372 Assessment', \n             fontsize=15, fontweight='bold', y=0.98)\n\n# Layout: 2x2 grid\ngs = fig.add_gridspec(2, 2, hspace=0.35, wspace=0.3)\n\n# ============================================================\n# Panel A: GO Annotation Provenance Flow\n# ============================================================\nax1 = fig.add_subplot(gs[0, 0])\nax1.set_xlim(0, 10)\nax1.set_ylim(0, 10)\nax1.axis('off')\nax1.set_title('A. GO Annotation Provenance & Data Flow', fontweight='bold', fontsize=11)\n\n# PAINT tree (source)\nax1.add_patch(mpatches.FancyBboxPatch((0.5, 8), 3, 1.2, boxstyle=\"round,pad=0.15\",\n              facecolor='#e6f3ff', edgecolor='#336699', lw=2))\nax1.text(2, 8.6, 'PAINT/PANTHER Tree\\n(PTHR12482)', ha='center', fontsize=8, fontweight='bold')\n\n# Two branches\nax1.annotate('', xy=(1.5, 7), xytext=(2, 8),\n            arrowprops=dict(arrowstyle='->', lw=1.5, color='#336699'))\nax1.annotate('', xy=(3.5, 7), xytext=(2, 8),\n            arrowprops=dict(arrowstyle='->', lw=1.5, color='#336699'))\n\n# ROG1 branch - annotated with GO:0047372\nax1.add_patch(mpatches.FancyBboxPatch((0, 5.8), 3, 1.2, boxstyle=\"round,pad=0.15\",\n              facecolor='#ffe6e6', edgecolor='red', lw=2))\nax1.text(1.5, 6.4, 'SF62 (ROG1 branch)\\nPTN000773838', ha='center', fontsize=7, fontweight='bold')\nax1.text(1.5, 5.95, 'GO:0047372 \u2713 (IDA+IBA)', ha='center', fontsize=7, color='red')\n\n# LPL1 branch - NOT annotated with GO:0047372\nax1.add_patch(mpatches.FancyBboxPatch((3, 5.8), 3.2, 1.2, boxstyle=\"round,pad=0.15\",\n              facecolor='#e6ffe6', edgecolor='green', lw=2))\nax1.text(4.6, 6.4, 'SF24 (LPL1 branch)\\nPTN000280739', ha='center', fontsize=7, fontweight='bold')\nax1.text(4.6, 5.95, 'GO:0004622 \u2713 GO:0120559 \u2713', ha='center', fontsize=7, color='green')\n\n# QuickGO database\nax1.add_patch(mpatches.FancyBboxPatch((0.3, 3.5), 3.5, 1.5, boxstyle=\"round,pad=0.15\",\n              facecolor='#fff3e6', edgecolor='#cc6600', lw=2))\nax1.text(2.05, 4.5, 'QuickGO/EBI\\n(Authoritative)', ha='center', fontsize=8, fontweight='bold')\nax1.text(2.05, 3.75, 'Q5AMS2: NO GO:0047372', ha='center', fontsize=7, color='red', fontweight='bold')\n\nax1.annotate('', xy=(2.05, 5), xytext=(2.05, 5.8),\n            arrowprops=dict(arrowstyle='->', lw=1.5, color='#cc6600'))\n\n# UniProt\nax1.add_patch(mpatches.FancyBboxPatch((4.5, 3.5), 3.5, 1.5, boxstyle=\"round,pad=0.15\",\n              facecolor='#f0e6ff', edgecolor='#6633cc', lw=2))\nax1.text(6.25, 4.5, 'UniProt\\n(Derived)', ha='center', fontsize=8, fontweight='bold')\nax1.text(6.25, 3.75, 'Q5AMS2: Shows GO:0047372', ha='center', fontsize=7, color='#6633cc')\n\nax1.annotate('', xy=(6.25, 5), xytext=(4.6, 5.8),\n            arrowprops=dict(arrowstyle='->', lw=1.5, color='#6633cc', ls='--'))\n\n# AI Review YAML (consumer)\nax1.add_patch(mpatches.FancyBboxPatch((2.5, 1.5), 4, 1.2, boxstyle=\"round,pad=0.15\",\n              facecolor='#ffffcc', edgecolor='#999900', lw=2))\nax1.text(4.5, 2.1, 'AI Review YAML\\n(Seed Hypothesis)', ha='center', fontsize=8, fontweight='bold')\n\nax1.annotate('stale?', xy=(4.5, 2.7), xytext=(6.25, 3.5),\n            arrowprops=dict(arrowstyle='->', lw=1.5, color='#6633cc', ls='--'),\n            fontsize=7, color='#6633cc', fontstyle='italic')\n\n# Big X over the propagation\nax1.plot([5.5, 7], [6.5, 5.5], 'r-', lw=3, alpha=0.5)\nax1.plot([5.5, 7], [5.5, 6.5], 'r-', lw=3, alpha=0.5)\nax1.text(7.2, 6, 'NOT\\npropagated', fontsize=8, color='red', fontweight='bold')\n\n# ============================================================\n# Panel B: Complete GO Decision Table\n# ============================================================\nax2 = fig.add_subplot(gs[0, 1])\nax2.axis('off')\nax2.set_title('B. GO Annotation Decision Table', fontweight='bold', fontsize=11)\n\ntable_data = [\n    ['GO Term', 'Label', 'QuickGO', 'UniProt', 'Action', 'Source node'],\n    ['GO:0047372', 'MAG lipase', '\u2717 ABSENT', '\u2713 Present', 'REMOVE', 'N/A (stale)'],\n    ['GO:0004622', 'PC lyso-PLA1', '\u2713 Present', '\u2713 Present', 'RETAIN', 'PTN000280739'],\n    ['GO:0120559', 'PE lyso-PLA1', '\u2713 Present', '\u2717 Absent', 'RETAIN', 'PTN000280739'],\n    ['GO:0005811', 'Lipid droplet', '\u2713 Present', '\u2713 Present', 'RETAIN', 'PTN000280739'],\n    ['GO:0006629', 'Lipid metab.', '\u2713 Present', '\u2713 Present', 'RETAIN', 'PTN000280657'],\n    ['GO:0005737', 'Cytoplasm', '\u2713 Present', '\u2717 Absent', 'RETAIN', 'PTN000967933'],\n    ['GO:0016042', 'Lipid catabol.', '\u2717 Absent', '\u2713 Present', 'RETAIN*', 'IEA (UniProt)'],\n]\n\ncolors = [\n    ['#999999'] * 6,   # header\n    ['#ffcccc'] * 6,   # MAG lipase - remove\n    ['#ccffcc'] * 6,   # retain\n    ['#ccffcc'] * 6,\n    ['#ccffcc'] * 6,\n    ['#ccffcc'] * 6,\n    ['#ccffcc'] * 6,\n    ['#ffffcc'] * 6,   # IEA - different pipeline\n]\n\ntable = ax2.table(cellText=table_data, cellLoc='center', loc='center',\n                  cellColours=colors)\ntable.auto_set_font_size(False)\ntable.set_fontsize(7)\ntable.scale(1.1, 1.6)\n\nfor j in range(6):\n    table[0, j].set_text_props(fontweight='bold', color='white')\n    table[0, j].set_facecolor('#444444')\ntable[1, 4].set_text_props(fontweight='bold', color='red')\n\n# ============================================================\n# Panel C: Evidence Weight Summary\n# ============================================================\nax3 = fig.add_subplot(gs[1, 0])\nax3.set_title('C. Evidence Weight Against GO:0047372', fontweight='bold', fontsize=11)\n\nevidence_items = [\n    'QuickGO: annotation absent',\n    'Sc_LPL1: phospholipase B (IDA)',\n    'PANTHER: different subfamily\\n(SF24 vs SF62)',\n    'Sequence: 44% id Sc_LPL1\\nvs 26% id ROG1',\n    'Active site: 3 key\\nresidues divergent',\n    'InterPro: lacks\\nRog1_fam (IPR016445)',\n    'CGD: no data (ND)',\n]\n\nweights = [5.0, 4.8, 4.5, 4.0, 3.8, 3.5, 2.0]\ncolors_bar = ['#cc0000', '#ff3333', '#ff6633', '#ff9933', '#ffcc33', '#ffcc66', '#999999']\n\ny_pos = np.arange(len(evidence_items))\nbars = ax3.barh(y_pos, weights, color=colors_bar, edgecolor='black', linewidth=0.5, height=0.7)\nax3.set_yticks(y_pos)\nax3.set_yticklabels(evidence_items, fontsize=8)\nax3.set_xlabel('Evidence Weight (1-5)', fontsize=9)\nax3.set_xlim(0, 5.5)\nax3.invert_yaxis()\n\nfor i, (bar, w) in enumerate(zip(bars, weights)):\n    ax3.text(w + 0.1, i, f'{w:.1f}', va='center', fontsize=8, fontweight='bold')\n\nax3.axvline(x=3, color='gray', ls='--', alpha=0.3)\nax3.text(3.1, len(evidence_items) - 0.3, 'threshold', fontsize=7, color='gray', fontstyle='italic')\n\n# ============================================================\n# Panel D: Final Verdict\n# ============================================================\nax4 = fig.add_subplot(gs[1, 1])\nax4.axis('off')\nax4.set_title('D. Final Verdict & Curation Leads', fontweight='bold', fontsize=11)\n\nverdict_text = \"\"\"VERDICT: OVER-ANNOTATED\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n\nGO:0047372 (monoacylglycerol lipase activity)\non C. albicans LPL1 (Q5AMS2) is NOT supported.\n\nThe annotation:\n \u2022 Is ABSENT from QuickGO (authoritative source)\n \u2022 Was correctly restricted to ROG1 (SF62) by PAINT\n \u2022 Contradicts Sc_LPL1 characterization (PLB, IDA)\n \u2022 Shows active-site divergence from ROG1\n\nCURATION LEADS:\n\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\n1. REMOVE GO:0047372 from review pipeline\n   (likely stale UniProt sync artifact)\n\n2. RETAIN GO:0004622, GO:0120559\n   (phospholipase activities from PAINT)\n\n3. Verify: seed YAML source \u2014 UniProt or GO?\n\nKEY REFERENCES:\n PMID:25014274 \u2014 Sc_LPL1 = phospholipase B\n PMID:25433290 \u2014 Sc_ROG1 = MAG lipase\n PMID:28100635 \u2014 Sc_LPL1 in LD/proteasome\n\"\"\"\n\nax4.text(0.05, 0.95, verdict_text, transform=ax4.transAxes, fontsize=8.5,\n         verticalalignment='top', fontfamily='monospace',\n         bbox=dict(boxstyle='round', facecolor='#fff8f0', edgecolor='#cc6600', lw=2))\n\nplt.savefig('final_provenance_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Final provenance summary figure saved\")\n",
  "plot_number": 5
}