{
  "filename": "mj1511_comprehensive_evidence.png",
  "iteration": 2,
  "description": "Create comprehensive 4-panel evidence figure for MJ1511 pseudoenzyme hypothesis",
  "timestamp": "2026-06-21 19:00:24",
  "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))\nfig.suptitle('MJ1511 Pseudoenzyme Hypothesis: Comprehensive Evidence', fontsize=14, fontweight='bold')\n\n# Panel A: Genomic context comparison\nax1 = axes[0, 0]\nax1.set_title('A. Genomic context: MJ0742 vs MJ1511', fontsize=11, fontweight='bold')\nax1.set_xlim(-1, 12)\nax1.set_ylim(-0.2, 1.2)\n\n# MJ0742 locus (oxidative stress cluster)\ngenes_0742 = [\n    (0, 1, 'MJ0734\\nRbr', '#ff9800'),      # rubrerythrin\n    (1.2, 2.2, 'MJ0735\\nRd1', '#ffc107'),   # rubredoxin\n    (2.4, 3.4, 'MJ0736\\nAhpC', '#4caf50'),  # AhpC\n    (3.6, 4.6, 'MJ0737\\nRd-like', '#ffc107'),\n    (5.0, 6.0, 'MJ0740\\nRd2', '#ffc107'),   # rubredoxin 2\n    (6.2, 7.2, 'MJ0741\\nSOR', '#ff9800'),   # desulfoferrodoxin\n    (7.4, 8.4, 'MJ0742\\nCMD', '#e53935'),   # CMD - no CXXC\n]\n\ny_top = 0.85\nfor x1, x2, label, color in genes_0742:\n    ax1.add_patch(plt.Rectangle((x1, y_top-0.08), x2-x1, 0.16, \n                                facecolor=color, edgecolor='black', linewidth=1))\n    ax1.text((x1+x2)/2, y_top, label, ha='center', va='center', fontsize=6.5, fontweight='bold')\n\nax1.text(-0.5, y_top, 'Locus\\n0734-0742', ha='right', va='center', fontsize=8, fontweight='bold')\nax1.text(4.2, y_top+0.2, 'Oxidative Stress Defense Cluster', ha='center', fontsize=9, \n         color='green', fontweight='bold', style='italic')\n\n# MJ1511 locus (no functional context)\ngenes_1511 = [\n    (1.5, 2.5, 'MJ1508\\nABC', '#9e9e9e'),\n    (3.0, 4.0, 'MJ1510\\nhyp.', '#bdbdbd'),\n    (4.5, 5.5, 'MJ1511\\nCMD', '#e53935'),\n    (6.0, 7.0, 'MJ1512\\nrgy', '#9e9e9e'),\n    (7.5, 8.5, 'MJ1514\\nhyp.', '#bdbdbd'),\n]\n\ny_bot = 0.3\nfor x1, x2, label, color in genes_1511:\n    ax1.add_patch(plt.Rectangle((x1, y_bot-0.08), x2-x1, 0.16,\n                                facecolor=color, edgecolor='black', linewidth=1))\n    ax1.text((x1+x2)/2, y_bot, label, ha='center', va='center', fontsize=6.5, fontweight='bold')\n\nax1.text(-0.5, y_bot, 'Locus\\n1508-1514', ha='right', va='center', fontsize=8, fontweight='bold')\nax1.text(5, y_bot+0.2, 'No Functional Context', ha='center', fontsize=9,\n         color='red', fontweight='bold', style='italic')\n\n# Legend\nlegend_items = [\n    mpatches.Patch(facecolor='#4caf50', label='Peroxiredoxin (AhpC)'),\n    mpatches.Patch(facecolor='#ffc107', label='Electron transfer (Rd)'),\n    mpatches.Patch(facecolor='#ff9800', label='Redox defense'),\n    mpatches.Patch(facecolor='#e53935', label='CMD protein (no CXXC)'),\n    mpatches.Patch(facecolor='#9e9e9e', label='Unrelated gene'),\n]\nax1.legend(handles=legend_items, fontsize=6.5, loc='lower right', ncol=2)\nax1.set_xticks([])\nax1.set_yticks([])\n\n# Panel B: Alternative mechanisms ruled out\nax2 = axes[0, 1]\nax2.set_title('B. Alternative mechanisms assessment', fontsize=11, fontweight='bold')\nax2.axis('off')\n\nmechanisms = [\n    ('2-Cys AhpD (CXXC)', 'No CXXC; 36.5 A Cys distance', 'RULED OUT', '#ffcdd2'),\n    ('1-Cys Prx', 'Wrong fold; AhpD \u2260 Prx fold', 'RULED OUT', '#ffcdd2'),\n    ('Metal-dependent', 'No His; no metal motifs', 'RULED OUT', '#ffcdd2'),\n    ('Cofactor-mediated', 'No cofactor domain; too small', 'V. UNLIKELY', '#fff3e0'),\n    ('Decarboxylase', 'No substrate in methanogen', 'V. UNLIKELY', '#fff3e0'),\n    ('Pseudoenzyme', 'All evidence consistent', 'MOST LIKELY', '#c8e6c9'),\n]\n\ny = 0.95\nfor mech, evidence, status, color in mechanisms:\n    ax2.add_patch(plt.Rectangle((0.0, y-0.065), 1.0, 0.12,\n                                facecolor=color, edgecolor='gray', linewidth=0.5))\n    ax2.text(0.02, y, mech, fontsize=8, fontweight='bold', va='center')\n    ax2.text(0.4, y, evidence, fontsize=7, va='center')\n    status_color = 'red' if 'RULED' in status else ('orange' if 'UNLIKELY' in status else 'green')\n    ax2.text(0.88, y, status, fontsize=7, fontweight='bold', va='center', color=status_color, ha='center')\n    y -= 0.14\n\nax2.text(0.44, 1.05, 'Mechanism', fontsize=9, fontweight='bold')\nax2.text(0.88, 1.05, 'Status', fontsize=9, fontweight='bold', ha='center')\n\n# Panel C: Evidence convergence diagram\nax3 = axes[1, 0]\nax3.set_title('C. Converging evidence against oxidoreductase function', fontsize=11, fontweight='bold')\nax3.set_xlim(-1.5, 1.5)\nax3.set_ylim(-1.5, 1.5)\nax3.set_aspect('equal')\n\n# Central conclusion\ncircle_center = plt.Circle((0, 0), 0.45, facecolor='#e8f5e9', edgecolor='#2e7d32', linewidth=2)\nax3.add_patch(circle_center)\nax3.text(0, 0.05, 'MJ1511 is\\nNOT an\\noxidoreductase', ha='center', va='center', \n         fontsize=9, fontweight='bold', color='#1b5e20')\n\n# Evidence nodes\nevidence_nodes = [\n    (0, 1.1, 'No CXXC\\nmotif', '#ef5350'),\n    (1.0, 0.55, 'No His\\n(0 total)', '#ef5350'),\n    (1.0, -0.55, 'Cys 36.5 A\\napart', '#ef5350'),\n    (0, -1.1, 'IBA from\\ndistant AhpD', '#ff9800'),\n    (-1.0, -0.55, '1-Cys AhpC\\nin genome', '#42a5f5'),\n    (-1.0, 0.55, 'CMD family\\ndiversity', '#42a5f5'),\n]\n\nfor x, y, label, color in evidence_nodes:\n    circle = plt.Circle((x, y), 0.32, facecolor=color, edgecolor='black', linewidth=1, alpha=0.8)\n    ax3.add_patch(circle)\n    ax3.text(x, y, label, ha='center', va='center', fontsize=7, fontweight='bold', color='white')\n    # Arrow to center\n    dx = -x * 0.55\n    dy = -y * 0.55\n    ax3.annotate('', xy=(x+dx, y+dy), xytext=(x+dx*0.15, y+dy*0.15),\n                arrowprops=dict(arrowstyle='->', color='gray', lw=1.5))\n\nax3.set_xticks([])\nax3.set_yticks([])\n\n# Panel D: GO curation decision\nax4 = axes[1, 1]\nax4.set_title('D. GO curation recommendation', fontsize=11, fontweight='bold')\nax4.axis('off')\n\ndecision_text = \"\"\"\nCURRENT ANNOTATIONS (to remove):\n\n  GO:0016491 \u2014 oxidoreductase activity\n    Evidence: IBA from M. tuberculosis AhpD (P9WQB5)\n    Problem: Catalytic CXXC + His absent\n    Action: REMOVE \u2717\n\n  GO:0051920 \u2014 peroxiredoxin activity\n    Evidence: IEA from InterPro IPR003779\n    Problem: CMD fold \u2260 peroxiredoxin function\n    Action: REMOVE \u2717\n\nSTRUCTURAL ANNOTATION (retain):\n\n  IPR029032 \u2014 AhpD-like fold\n    Status: CORRECT (fold annotation is valid)\n    Note: Fold does NOT imply function\n\n  PF02627 \u2014 CMD domain\n    Status: CORRECT (domain family)\n    Note: Family is functionally diverse\n\nRECOMMENDED:\n\n  No replacement MF term supported\n  Classify as: CMD-family protein of\n  unknown function (pseudoenzyme)\n\"\"\"\n\nax4.text(0.05, 0.95, decision_text, fontsize=8, fontfamily='monospace',\n         va='top', ha='left', transform=ax4.transAxes,\n         bbox=dict(boxstyle='round', facecolor='#f5f5f5', edgecolor='gray'))\n\nplt.tight_layout()\nplt.savefig('mj1511_comprehensive_evidence.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: mj1511_comprehensive_evidence.png\")\n"
}