{
  "filename": "evidence_summary.png",
  "iteration": 2,
  "description": "Create summary figure showing domain architectures, scaffold context, and evidence against GO:0005201",
  "timestamp": "2026-06-22 07:32:00",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(3, 1, figsize=(14, 10), gridspec_kw={'height_ratios': [2, 2, 3]})\n\n# Panel A: Domain architecture comparison\nax1 = axes[0]\nax1.set_title(\"A. Domain Architecture: A0A2G9RZF1 vs PCPE-1 vs BMP-1/Tolloid\", fontsize=12, fontweight='bold')\n\n# Color scheme\ncolors = {'Signal': '#FFD700', 'CUB': '#4169E1', 'EGF': '#32CD32', 'NTR': '#FF6347', \n          'Astacin': '#FF4500', 'Propeptide': '#DDA0DD', 'Other': '#D3D3D3'}\n\ndef draw_protein(ax, y, length, domains, label, total_scale=1100):\n    # Background\n    ax.barh(y, length/total_scale, height=0.3, color='#E8E8E8', left=0, edgecolor='black', linewidth=0.5)\n    for start, end, dtype in domains:\n        ax.barh(y, (end-start)/total_scale, height=0.3, left=start/total_scale, \n                color=colors.get(dtype, '#888'), edgecolor='black', linewidth=0.5)\n        mid = (start + end) / 2 / total_scale\n        if (end - start) > 50:\n            ax.text(mid, y, dtype, ha='center', va='center', fontsize=7, fontweight='bold')\n    ax.text(-0.02, y, f\"{label}\\n({length} aa)\", ha='right', va='center', fontsize=8, \n            transform=ax.get_yaxis_transform())\n\ndraw_protein(ax1, 3, 156, [(1,30,'Signal'), (31,147,'CUB')], 'A0A2G9RZF1')\ndraw_protein(ax1, 2, 449, [(1,25,'Signal'), (37,149,'CUB'), (159,273,'CUB'), (318,437,'NTR')], 'PCPE-1\\n(Q15113)')\ndraw_protein(ax1, 1, 986, [(1,21,'Signal'), (22,128,'Propeptide'), (129,264,'Astacin'), \n                           (267,381,'CUB'), (382,417,'EGF'), (418,530,'CUB'), (534,649,'CUB')], 'BMP-1\\n(P13497)')\ndraw_protein(ax1, 0, 1007, [(1,25,'Signal'), (26,130,'Propeptide'), (131,267,'Astacin'),\n                            (270,384,'CUB'), (385,420,'EGF'), (421,533,'CUB'), (537,652,'CUB'),\n                            (653,688,'EGF'), (691,803,'CUB'), (807,919,'CUB')], 'mTLD\\n(Q8JI28)')\n\nax1.set_xlim(-0.01, 1.02)\nax1.set_ylim(-0.5, 3.8)\nax1.set_yticks([])\nax1.set_xlabel('Relative position', fontsize=9)\n\n# Legend\nlegend_patches = [mpatches.Patch(color=v, label=k, edgecolor='black', linewidth=0.5) \n                  for k, v in colors.items() if k != 'Other']\nax1.legend(handles=legend_patches, loc='upper right', fontsize=7, ncol=3)\n\n# Panel B: Scaffold gene fragment diagram\nax2 = axes[1]\nax2.set_title(\"B. Scaffold KV928989: Three ORFs Likely From One BMP-1/Tolloid-like Gene\", fontsize=12, fontweight='bold')\n\n# Draw scaffold\nax2.barh(0, 1, height=0.15, color='#F0F0F0', edgecolor='gray')\nax2.text(0.5, 0.2, 'Scaffold KV928989 (134 kb)', ha='center', va='bottom', fontsize=9, style='italic')\n\n# Assembly gaps (schematic)\nfor gx in [0.04, 0.07, 0.15, 0.3, 0.45]:\n    ax2.plot([gx, gx], [-0.075, 0.075], color='red', linewidth=2, alpha=0.5)\n    \n# Gene fragments (schematic positions)\nfrag_data = [\n    (0.1, 0.12, 'A0A2G9RZF1\\n(CUB)', '#4169E1'),\n    (0.22, 0.18, 'A0A2G9RZH1\\n(EGF+CUB)', '#32CD32'),\n    (0.48, 0.20, 'A0A2G9RZI6\\n(CUB+EGF+CUB)\\nFRAGMENT', '#FF4500'),\n]\nfor start, width, label, color in frag_data:\n    ax2.barh(-0.4, width, height=0.3, left=start, color=color, edgecolor='black', linewidth=0.5, alpha=0.8)\n    ax2.text(start + width/2, -0.4, label, ha='center', va='center', fontsize=7, fontweight='bold')\n\n# Arrows suggesting they belong together\nax2.annotate('', xy=(0.22, -0.55), xytext=(0.22, -0.55),)\nax2.plot([0.15, 0.22], [-0.7, -0.7], 'k--', linewidth=1)\nax2.plot([0.40, 0.48], [-0.7, -0.7], 'k--', linewidth=1)\nax2.text(0.35, -0.75, '? Single BMP-1/tolloid-like gene ?', ha='center', va='top', fontsize=9, \n         style='italic', color='red', fontweight='bold')\n\nax2.set_xlim(-0.01, 1.01)\nax2.set_ylim(-1.0, 0.4)\nax2.set_yticks([])\nax2.set_xticks([])\n\n# Legend for gaps\nax2.plot([0.85], [0.2], 'r-', linewidth=2, alpha=0.5)\nax2.text(0.87, 0.2, 'Assembly gap', va='center', fontsize=8, color='red')\n\n# Panel C: GO annotation decision tree\nax3 = axes[2]\nax3.set_title(\"C. Evidence Against GO:0005201 Annotation\", fontsize=12, fontweight='bold')\nax3.axis('off')\n\n# Decision table as text\ntable_data = [\n    ['Evidence Line', 'Finding', 'Impact on GO:0005201'],\n    ['GO term semantics', 'GO:0005201 = structural ECM (collagens, elastin)', 'REFUTES: CUB \u2260 structural'],\n    ['PCPE-1 actual function', 'IDA: peptidase activator + collagen binding', 'REFUTES: wrong source function'],\n    ['PCPE-1 GO:0005201 evidence', 'Only RCA (computational), not IDA', 'WEAKENS: non-experimental'],\n    ['Domain architecture', 'Single CUB cannot do PCPE-1 activity', 'REFUTES: function not transferable'],\n    ['Genomic context', 'Fragment of BMP-1/tolloid gene', 'REFUTES: not standalone protein'],\n    ['Tolloid CUB function', 'CUB = substrate recognition for protease', 'REFUTES: regulatory, not structural'],\n]\n\ntable = ax3.table(cellText=table_data[1:], colLabels=table_data[0], \n                  loc='center', cellLoc='left',\n                  colWidths=[0.25, 0.4, 0.35])\ntable.auto_set_font_size(False)\ntable.set_fontsize(8)\ntable.scale(1, 1.5)\n\n# Color the header\nfor j in range(3):\n    table[0, j].set_facecolor('#2F4F4F')\n    table[0, j].set_text_props(color='white', fontweight='bold')\n# Color the impact column\nfor i in range(1, 7):\n    table[i, 2].set_facecolor('#FFE4E1')\n\nplt.tight_layout()\nplt.savefig('evidence_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: evidence_summary.png\")\n"
}