{
  "filename": "plot_3.png",
  "iteration": 2,
  "description": "Comprehensive evidence figure: disrupted active site, 3D geometry, and cross-species PGRP-LC classification",
  "timestamp": "2026-07-05 11:30:15",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig = plt.figure(figsize=(16, 14))\n\n# Panel A: 3D Active-Site Schematic\nax1 = fig.add_subplot(2, 2, 1)\nax1.set_title('A. Active-Site Geometry\\n(AlphaFold Model AF-A7UTA1-F1)', fontsize=11, fontweight='bold')\n\n# Draw a simplified 2D projection of the zinc site\n# Catalytic PGRP active site (left)\npositions_cat = {\n    'H (Zn1)': (0.3, 0.7),\n    'H (Zn2)': (0.7, 0.7),\n    'C (Zn3)': (0.5, 0.3),\n    'Zn\u00b2\u207a': (0.5, 0.57),\n    'Y (cat)': (0.2, 0.4),\n}\n\n# Draw lines to zinc\nfor label, pos in positions_cat.items():\n    if label != 'Zn\u00b2\u207a' and label != 'Y (cat)':\n        ax1.plot([pos[0], 0.5], [pos[1], 0.57], 'b-', linewidth=2, alpha=0.5)\n\n# Draw circles\nfor label, pos in positions_cat.items():\n    if label == 'Zn\u00b2\u207a':\n        circle = plt.Circle(pos, 0.05, color='#3498db', zorder=5)\n        ax1.add_patch(circle)\n        ax1.text(pos[0], pos[1], 'Zn\u00b2\u207a', ha='center', va='center', fontsize=8, fontweight='bold', color='white', zorder=6)\n    else:\n        color = '#27ae60'  # green for functional\n        circle = plt.Circle(pos, 0.06, color=color, zorder=5)\n        ax1.add_patch(circle)\n        ax1.text(pos[0], pos[1], label.split('(')[0].strip(), ha='center', va='center', fontsize=8, fontweight='bold', color='white', zorder=6)\n        ax1.text(pos[0], pos[1]-0.09, f'({label.split(\"(\")[1]}' if '(' in label else '', ha='center', fontsize=7, color='gray')\n\nax1.text(0.5, 0.95, 'Catalytic PGRP\\n(e.g., PGRP-LB)', ha='center', fontsize=9, fontweight='bold', color='#27ae60')\nax1.set_xlim(0, 1)\nax1.set_ylim(0.1, 1)\nax1.set_aspect('equal')\nax1.axis('off')\n\n# Panel B: Ag PGRPLC active site (disrupted)\nax2 = fig.add_subplot(2, 2, 2)\nax2.set_title('B. Disrupted Site in Ag PGRPLC\\n(A7UTA1)', fontsize=11, fontweight='bold')\n\npositions_ag = {\n    'A310': (0.3, 0.7),     # H\u2192A substitution\n    'H421': (0.7, 0.7),     # Remaining His\n    'S429': (0.5, 0.3),     # C\u2192S substitution\n    'Y347': (0.2, 0.4),     # Catalytic Tyr (conserved)\n}\n\n# NO zinc - draw an X where it would be\nax2.text(0.5, 0.57, '\u2717', ha='center', va='center', fontsize=20, color='#e74c3c', fontweight='bold', zorder=6)\nax2.text(0.5, 0.48, 'No Zn\u00b2\u207a', ha='center', fontsize=8, color='#e74c3c', fontweight='bold')\n\n# Draw dashed lines (broken coordination)\nfor label, pos in positions_ag.items():\n    if label not in ['Y347']:\n        ax2.plot([pos[0], 0.5], [pos[1], 0.57], '--', color='#e74c3c', linewidth=1.5, alpha=0.5)\n\ncolors_ag = {'A310': '#e74c3c', 'H421': '#27ae60', 'S429': '#e74c3c', 'Y347': '#27ae60'}\nlabels_ag = {'A310': 'A\\n(H\u2192A)', 'H421': 'H\\n(kept)', 'S429': 'S\\n(C\u2192S)', 'Y347': 'Y\\n(kept)'}\n\nfor label, pos in positions_ag.items():\n    circle = plt.Circle(pos, 0.06, color=colors_ag[label], zorder=5)\n    ax2.add_patch(circle)\n    ax2.text(pos[0], pos[1], labels_ag[label], ha='center', va='center', fontsize=7, fontweight='bold', color='white', zorder=6)\n\n# Distance annotations\nax2.annotate('', xy=(0.3, 0.7), xytext=(0.5, 0.3),\n            arrowprops=dict(arrowstyle='<->', color='gray', lw=1))\nax2.text(0.33, 0.47, '3.6 \u00c5', fontsize=7, color='gray', rotation=55)\n\nax2.annotate('', xy=(0.7, 0.7), xytext=(0.5, 0.3),\n            arrowprops=dict(arrowstyle='<->', color='gray', lw=1))\nax2.text(0.65, 0.47, '5.7 \u00c5', fontsize=7, color='gray', rotation=-55)\n\nax2.text(0.5, 0.95, 'Ag PGRPLC (TARGET)\\n2/3 Zn ligands substituted', ha='center', fontsize=9, fontweight='bold', color='#e74c3c')\nax2.set_xlim(0, 1)\nax2.set_ylim(0.1, 1)\nax2.set_aspect('equal')\nax2.axis('off')\n\n# Panel C: Cross-species PGRP-LC comparison\nax3 = fig.add_subplot(2, 1, 2)\nax3.set_title('C. PGRP Family: Catalytic vs Non-Catalytic Classification', fontsize=11, fontweight='bold', loc='left')\n\n# Data\nproteins = [\n    ('Dm PGRP-LB', 'Q8INK6', 'Catalytic', True, True, True),\n    ('Dm PGRP-SC1a', 'C0HK98', 'Catalytic', True, True, True),\n    ('Dm PGRP-SC1b', 'C0HK99', 'Catalytic', True, True, True),\n    ('Dm PGRP-SB1', 'Q70PY2', 'Catalytic', True, True, True),\n    ('Hs PGLYRP2', 'Q96PD5', 'Catalytic', True, True, True),\n    ('', '', '', None, None, None),  # separator\n    ('Ag PGRPLC \u2605', 'A7UTA1', 'Non-catalytic', False, True, False),\n    ('Dm PGRP-LC (x)', 'Q9GNK5', 'Non-catalytic', False, True, False),\n    ('Dm PGRP-LC (a)', 'A0A0S0WMR4', 'Non-catalytic', False, True, False),\n    ('Dm PGRP-LC (y)', 'E1JI88', 'Non-catalytic', False, True, False),\n    ('Bl PGRP-LC', 'A0A4P8NZ09', 'Non-catalytic', False, True, False),\n    ('Bm PGRP-LC', 'A0A4P8NZ13', 'Non-catalytic', False, True, False),\n    ('Dm PGRP-SA', 'Q9VYX7', 'Non-catalytic', False, True, False),\n    ('Dm PGRP-LE', 'Q9VXN9', 'Non-catalytic', False, True, False),\n]\n\ny_pos = 0\ncols = ['HH motif\\n(Zn lig 1)', 'IIxH pattern\\n(structural)', 'CPG motif\\n(Zn lig 3)']\n\nfor i, (name, acc, classification, hh, iixh, cpg) in enumerate(proteins):\n    if classification is None:\n        y_pos -= 0.4\n        ax3.axhline(y=y_pos + 0.2, color='blue', linewidth=1, linestyle='--', alpha=0.3)\n        ax3.text(-0.5, y_pos + 0.2, 'Catalytic \u2191 | Non-catalytic \u2193', fontsize=8, color='blue', alpha=0.6)\n        continue\n    \n    # Protein label\n    color = '#c0392b' if '\u2605' in name else 'black'\n    fontweight = 'bold' if '\u2605' in name else 'normal'\n    ax3.text(-0.1, y_pos, name, ha='right', va='center', fontsize=9, color=color, fontweight=fontweight)\n    ax3.text(3.3, y_pos, acc, ha='left', va='center', fontsize=7, color='gray')\n    \n    # Feature boxes\n    features = [hh, iixh, cpg]\n    for j, feat in enumerate(features):\n        x = j * 1.0 + 0.1\n        if feat:\n            fc = '#27ae60'\n            text = '\u2713'\n        else:\n            fc = '#e74c3c'\n            text = '\u2717'\n        rect = plt.Rectangle((x, y_pos - 0.3), 0.8, 0.6, facecolor=fc, edgecolor='white', linewidth=1)\n        ax3.add_patch(rect)\n        ax3.text(x + 0.4, y_pos, text, ha='center', va='center', fontsize=14, color='white', fontweight='bold')\n    \n    y_pos -= 0.8\n\n# Column headers\nfor j, col in enumerate(cols):\n    ax3.text(j * 1.0 + 0.5, 1.0, col, ha='center', va='bottom', fontsize=9, fontweight='bold')\n\nax3.set_xlim(-3.5, 5)\nax3.set_ylim(y_pos - 0.5, 1.5)\nax3.axis('off')\n\n# Add verdict box\nfig.text(0.5, 0.01, \n         \"VERDICT: GO:0008745 (N-acetylmuramoyl-L-alanine amidase activity) is OVER-ANNOTATED on Ag PGRPLC (A7UTA1)\\n\"\n         \"All PGRP-LC orthologs universally lack the HH motif and catalytic Cys required for zinc-dependent amidase catalysis\",\n         ha='center', va='bottom', fontsize=11, fontweight='bold', color='#c0392b',\n         bbox=dict(boxstyle='round,pad=0.5', facecolor='#fdf2e9', edgecolor='#c0392b', linewidth=2))\n\nplt.tight_layout()\nplt.subplots_adjust(bottom=0.1)\nplt.savefig('final_evidence_figure.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Final evidence figure saved\")\n",
  "plot_number": 3
}