{
  "filename": "evidence_summary.png",
  "iteration": 3,
  "description": "Create GO decision table and evidence strength summary visualization",
  "timestamp": "2026-06-22 09:25:53",
  "code": "\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create a summary evidence figure\nfig, axes = plt.subplots(1, 2, figsize=(16, 8))\n\n# Panel A: GO Decision Table\nax1 = axes[0]\nax1.axis('off')\nax1.set_title('GO Annotation Decision Table for A0A2U1PS28', fontsize=13, fontweight='bold', pad=20)\n\ntable_data = [\n    ['GO Term', 'Category', 'Current', 'Recommendation', 'Confidence'],\n    ['GO:0043022\\nribosome binding', 'MF', 'IEA\\n(retain)', 'RETAIN\\n(core function)', 'HIGH'],\n    ['GO:0003924\\nGTPase activity', 'MF', 'IEA\\n(retain)', 'RETAIN', 'HIGH'],\n    ['GO:0005525\\nGTP binding', 'MF', 'IEA\\n(retain)', 'RETAIN', 'HIGH'],\n    ['GO:0070125\\nmito. trans. elong.', 'BP', 'IEA\\n(incorrect)', 'REMOVE\\n(wrong organelle)', 'HIGH'],\n    ['GO:0032544\\nplastid translation', 'BP', 'absent', 'ADD', 'MEDIUM'],\n    ['GO:0005759\\nmito. matrix', 'CC', 'IEA\\n(incorrect)', 'REMOVE\\n(wrong organelle)', 'HIGH'],\n    ['GO:0005743\\nmito. inner memb.', 'CC', 'IEA\\n(incorrect)', 'REMOVE\\n(wrong organelle)', 'HIGH'],\n    ['GO:0009507\\nchloroplast', 'CC', 'absent', 'ADD', 'HIGH'],\n]\n\ncolors = []\nfor i, row in enumerate(table_data):\n    if i == 0:\n        colors.append(['#4472C4'] * 5)\n    elif 'REMOVE' in row[3]:\n        colors.append(['#FFFFFF', '#FFFFFF', '#FFD7D7', '#FF9999', '#FFD7D7'])\n    elif 'ADD' in row[3]:\n        colors.append(['#FFFFFF', '#FFFFFF', '#FFFFFF', '#99FF99', '#D7FFD7'])\n    elif 'RETAIN' in row[3]:\n        colors.append(['#FFFFFF', '#FFFFFF', '#D7FFD7', '#D7FFD7', '#D7FFD7'])\n    else:\n        colors.append(['#FFFFFF'] * 5)\n\ntable = ax1.table(cellText=table_data, cellColours=colors, cellLoc='center',\n                   loc='center', colWidths=[0.28, 0.1, 0.18, 0.24, 0.15])\ntable.auto_set_font_size(False)\ntable.set_fontsize(9)\ntable.scale(1, 2.0)\n\n# Style header row\nfor j in range(5):\n    table[0, j].set_text_props(color='white', fontweight='bold')\n\n# Panel B: Evidence strength summary\nax2 = axes[1]\ncategories = [\n    'Ribosome binding\\n(MF: GO:0043022)',\n    'Five-domain\\narchitecture',\n    'GTP-dependent\\nbinding',\n    'CTD-tRNA\\ncontacts',\n    'Chloroplastic\\nlocalization',\n    'Back-translocation\\nactivity',\n    'Plant-specific\\nexperimental'\n]\n# Score each on: strength of evidence (1-5)\nstructural = [5, 5, 4, 5, 0, 5, 0]  # From crystal/cryo-EM structures\nbiochemical = [4, 0, 5, 3, 0, 5, 0]  # From biochemical assays  \ncomputational = [4, 5, 4, 4, 5, 3, 3]  # From sequence/domain analysis\northolog = [3, 0, 3, 0, 5, 0, 4]  # From Arabidopsis ortholog data\n\nx = np.arange(len(categories))\nwidth = 0.2\n\nbars1 = ax2.barh(x + 1.5*width, structural, width, label='Structural', color='#4472C4')\nbars2 = ax2.barh(x + 0.5*width, biochemical, width, label='Biochemical', color='#ED7D31')\nbars3 = ax2.barh(x - 0.5*width, computational, width, label='Computational', color='#A5A5A5')\nbars4 = ax2.barh(x - 1.5*width, ortholog, width, label='Ortholog transfer', color='#70AD47')\n\nax2.set_xlabel('Evidence Strength (0-5)', fontsize=11)\nax2.set_yticks(x)\nax2.set_yticklabels(categories, fontsize=9)\nax2.set_xlim(0, 5.5)\nax2.set_title('Evidence Strength by Category\\nfor A0A2U1PS28 Core Function Claims', fontsize=13, fontweight='bold')\nax2.legend(loc='lower right', fontsize=9)\nax2.invert_yaxis()\n\nplt.tight_layout()\nplt.savefig('evidence_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Evidence summary figure saved.\")\n"
}