{
  "filename": "plot_2.png",
  "iteration": 1,
  "description": "Comprehensive 4-panel figure: protein architecture, paralog comparison, geometry, and verdict summary",
  "timestamp": "2026-06-22 00:47:21",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(2, 2, figsize=(16, 12))\n\n# Panel 1: Protein architecture diagram\nax1 = axes[0, 0]\nax1.set_xlim(0, 500)\nax1.set_ylim(0, 4)\n\n# Draw architecture\n# Signal peptide\nax1.barh(2, 20, height=0.8, left=0, color='#95A5A6', edgecolor='black', linewidth=0.5)\nax1.text(10, 2, 'SP', ha='center', va='center', fontsize=8, fontweight='bold', color='white')\n\n# N-terminal disordered region\nax1.barh(2, 312, height=0.8, left=20, color='#FF6B6B', edgecolor='black', linewidth=0.5, alpha=0.6)\nax1.text(176, 2, 'Disordered N-terminal extension\\n(312 aa, pLDDT ~40)', ha='center', va='center', fontsize=8)\n# Hatching for disorder\nfor x in range(30, 330, 10):\n    ax1.plot([x, x+5], [1.7, 2.3], color='gray', linewidth=0.3, alpha=0.5)\n\n# SOD domain\nax1.barh(2, 143, height=0.8, left=332, color='#4ECDC4', edgecolor='black', linewidth=1)\nax1.text(403, 2, 'Cu/Zn-SOD domain\\n(143 aa, pLDDT 94.3)', ha='center', va='center', fontsize=9, fontweight='bold')\n\n# Mark active site residues\nactive_sites = [364, 366, 375, 381, 389, 400, 403, 442, 465, 468]\nfor pos in active_sites:\n    ax1.plot(pos, 1.5, 'r^', markersize=6)\n\n# Labels\nax1.text(250, 3.5, 'RvY_17310 (A0A1D1W3Y1) \u2014 475 aa', ha='center', fontsize=13, fontweight='bold')\nax1.text(250, 3.0, 'Architecture: Signal peptide | Disordered spacer | Cu/Zn-SOD catalytic domain', \n         ha='center', fontsize=10, style='italic', color='#555555')\nax1.set_xlabel('Residue Position', fontsize=10)\nax1.set_yticks([])\nax1.spines['left'].set_visible(False)\nax1.spines['top'].set_visible(False)\nax1.spines['right'].set_visible(False)\n\n# Panel 2: Comparative conservation across R. varieornatus SODs\nax2 = axes[0, 1]\ngenes = ['RvY_17310\\n(475 aa)', 'RvY_03757\\n(193 aa)', 'RvY_00651\\n(154 aa)', 'RvY_09480\\n(317 aa)', \n         'RvY_00650\\n(292 aa)', 'RvY_10893\\n(185 aa)', 'RvY_13070\\n(194 aa)', 'RvY_13431\\n(546 aa)']\nconserved_counts = [10, 10, 10, 10, 10, 10, 9, 8]\ncolors = ['#2ECC71' if c == 10 else '#F39C12' if c >= 9 else '#E74C3C' for c in conserved_counts]\n\n# Highlight target\nedge_colors = ['red' if i == 0 else 'black' for i in range(len(genes))]\nedge_widths = [3 if i == 0 else 0.5 for i in range(len(genes))]\n\nbars = ax2.barh(range(len(genes)), conserved_counts, color=colors, \n                edgecolor=edge_colors, linewidth=edge_widths, height=0.7)\n\nax2.set_yticks(range(len(genes)))\nax2.set_yticklabels(genes, fontsize=9)\nax2.set_xlabel('Active Site Residues Conserved (out of 10)', fontsize=10)\nax2.set_title('Cu/Zn-SOD Active Site Conservation\\nacross R. varieornatus Paralogs', fontsize=12, fontweight='bold')\nax2.set_xlim(0, 11)\nax2.axvline(x=10, color='green', linestyle='--', alpha=0.3)\n\nfor i, v in enumerate(conserved_counts):\n    label = f'{v}/10 \u2713' if v == 10 else f'{v}/10'\n    ax2.text(v + 0.15, i, label, va='center', fontsize=9, fontweight='bold' if v == 10 else 'normal')\n\n# Add note about target\nax2.annotate('TARGET', xy=(10, 0), xytext=(8, -0.7), fontsize=9, color='red', fontweight='bold',\n             arrowprops=dict(arrowstyle='->', color='red'))\n\n# Panel 3: Geometry comparison bar chart\nax3 = axes[1, 0]\nmeasurements = ['His\u2194His\\n(Cu-lig1\u2194lig2)', 'His\u2194His\\n(lig1\u2194bridge)', 'His\u2194His\\n(lig1\u2194lig4)',\n                'His\u2194His\\n(lig2\u2194bridge)', 'His\u2194His\\n(lig2\u2194lig4)', 'His\u2194His\\n(bridge\u2194lig4)']\nhuman_dists = [5.80, 4.40, 4.91, 4.95, 3.37, 6.32]\nrvy_dists = [6.27, 4.14, 4.97, 5.18, 3.34, 6.04]\ndeltas = [r - h for r, h in zip(rvy_dists, human_dists)]\n\ny_pos = np.arange(len(measurements))\nwidth = 0.35\nax3.barh(y_pos - width/2, human_dists, width, label='Human SOD1 crystal\\n(PDB 2SOD)', color='#3498DB')\nax3.barh(y_pos + width/2, rvy_dists, width, label='RvY_17310 AlphaFold\\nmodel', color='#E67E22')\n\nax3.set_yticks(y_pos)\nax3.set_yticklabels(measurements, fontsize=9)\nax3.set_xlabel('Ligand-Ligand Distance (\u00c5)', fontsize=10)\nax3.set_title('Cu-Site Active Site Geometry\\n(Crystal Structure vs AlphaFold Model)', fontsize=12, fontweight='bold')\nax3.legend(fontsize=8, loc='lower right')\n\nfor i, d in enumerate(deltas):\n    color = '#2ECC71' if abs(d) < 0.3 else '#F39C12'\n    ax3.text(max(human_dists[i], rvy_dists[i]) + 0.1, i, f'\u0394={d:+.2f}\u00c5', \n             va='center', fontsize=8, color=color)\n\n# Panel 4: Summary verdict\nax4 = axes[1, 1]\nax4.axis('off')\n\nverdict_text = \"\"\"VERDICT: GO:0004784 ANNOTATION SUPPORTED\n\nEvidence Summary:\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\n\u2713 All 4 Cu-binding His conserved\n\u2713 All 3 Zn-binding residues conserved  \n\u2713 Cu/Zn-bridging His conserved\n\u2713 Disulfide bond Cys pair conserved\n\u2713 Electrostatic loop Arg conserved\n\u2713 ESL net charge preserved (+0 vs -1)\n\u2713 Active site geometry matches crystal\n   (all \u0394 < 0.5 \u00c5 vs human SOD1)\n\u2713 AlphaFold pLDDT > 94 for all 10 sites\n\u2713 Disulfide SG-SG = 2.03 \u00c5 (ideal)\n\nArchitecture:\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\nSignal peptide \u2192 secreted protein\nLarge disordered N-terminal extension\nC-terminal Cu/Zn-SOD catalytic domain\n\u2192 Resembles SOD3/EC-SOD architecture\n\nCaveats:\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\n\u2022 PROSITE PS00332 fails at non-binding \n  position (Ser replaces Glu50)\n\u2022 No direct enzymatic assay data\n\u2022 AlphaFold model lacks metal ions\"\"\"\n\nax4.text(0.05, 0.95, verdict_text, transform=ax4.transAxes, fontsize=10,\n         verticalalignment='top', fontfamily='monospace',\n         bbox=dict(boxstyle='round,pad=0.5', facecolor='#E8F8F5', edgecolor='#2ECC71', linewidth=2))\n\nplt.tight_layout()\nplt.savefig('comprehensive_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: comprehensive_analysis.png\")\n",
  "plot_number": 2
}