{
  "filename": "plot_1.png",
  "iteration": 1,
  "description": "Create comprehensive visualization comparing MJ1511 with characterized AhpD enzymes showing missing catalytic features",
  "timestamp": "2026-07-06 19:55:26",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(3, 1, figsize=(14, 12), gridspec_kw={'height_ratios': [2.5, 1.5, 2]})\n\n# --- Panel A: Catalytic residue comparison ---\nax = axes[0]\nax.set_title('A. Catalytic Residue Comparison: Characterized AhpD vs MJ1511', fontsize=13, fontweight='bold', loc='left')\n\nproteins = ['Mtb AhpD\\n(P9WQB5)', 'S.griseus AhpD\\n(B1W2G7)', 'M.marinum AhpD\\n(B2HD59)', 'R.erythropolis AhpD\\n(C0ZYQ9)', 'MJ1511\\n(Q58906)']\n# Residues: CxxC present, His present, Glu present, Proton relay intact\nfeatures = ['CxxC motif', 'Catalytic His\\n(proton relay)', 'Glu\\n(proton relay)', 'Complete catalytic\\nmachinery']\n\n# Data: 1=present, 0=absent\ndata = np.array([\n    [1, 1, 1, 1],  # Mtb AhpD\n    [1, 1, 1, 1],  # S. griseus\n    [1, 1, 1, 1],  # M. marinum\n    [1, 1, 1, 1],  # R. erythropolis\n    [0, 0, 1, 0],  # MJ1511\n])\n\ncolors = np.where(data == 1, '#2ecc71', '#e74c3c')\nfor i in range(len(proteins)):\n    for j in range(len(features)):\n        rect = mpatches.FancyBboxPatch((j-0.4, i-0.35), 0.8, 0.7, \n                                         boxstyle=\"round,pad=0.05\",\n                                         facecolor=colors[i][j], alpha=0.8)\n        ax.add_patch(rect)\n        label = '\u2713' if data[i][j] == 1 else '\u2717'\n        ax.text(j, i, label, ha='center', va='center', fontsize=16, fontweight='bold',\n                color='white')\n\nax.set_yticks(range(len(proteins)))\nax.set_yticklabels(proteins, fontsize=10)\nax.set_xticks(range(len(features)))\nax.set_xticklabels(features, fontsize=10)\nax.set_xlim(-0.6, len(features)-0.4)\nax.set_ylim(-0.6, len(proteins)-0.4)\nax.invert_yaxis()\nax.set_frame_on(False)\nax.tick_params(axis='both', which='both', length=0)\n\n# Add legend\npresent_patch = mpatches.Patch(color='#2ecc71', label='Present')\nabsent_patch = mpatches.Patch(color='#e74c3c', label='Absent')\nax.legend(handles=[present_patch, absent_patch], loc='upper right', fontsize=10)\n\n# --- Panel B: CxxC motif in sequences ---\nax2 = axes[1]\nax2.set_title('B. CxxC Motif Context in Sequences', fontsize=13, fontweight='bold', loc='left')\nax2.axis('off')\n\nmotif_data = [\n    ('Mtb AhpD',     '...AINGCSHCLVAH...', 'CSHC @ pos 130-133'),\n    ('S.griseus',    '...AINGCGQCLDSH...', 'CGQC @ pos 132-135'),\n    ('M.marinum',    '...SVNGCSHCVVAH...', 'CSHC @ pos 130-133'),\n    ('R.erythropolis','...AINGCNHCLEAH...', 'CNHC @ pos 130-133'),\n    ('MJ1511',       '...VKKNCPEFYEAV...VAGDQC', 'C17 and C107 \u2014 90 aa apart, NO CxxC'),\n]\n\ny_start = 0.95\nfor i, (name, motif, note) in enumerate(motif_data):\n    y = y_start - i * 0.18\n    color = '#e74c3c' if 'MJ1511' in name else '#2c3e50'\n    weight = 'bold' if 'MJ1511' in name else 'normal'\n    ax2.text(0.02, y, f'{name}:', fontsize=10, fontweight='bold', color=color,\n             transform=ax2.transAxes, va='top', fontfamily='monospace')\n    ax2.text(0.20, y, motif, fontsize=10, fontfamily='monospace', color=color,\n             fontweight=weight, transform=ax2.transAxes, va='top')\n    ax2.text(0.62, y, note, fontsize=9, fontstyle='italic', color=color,\n             transform=ax2.transAxes, va='top')\n\n# --- Panel C: Structural distance ---\nax3 = axes[2]\nax3.set_title('C. Evidence Summary Against Thiol-Disulfide Oxidoreductase Activity', fontsize=13, fontweight='bold', loc='left')\nax3.axis('off')\n\nevidence_items = [\n    ('1. CxxC Motif', 'ABSENT \u2014 two Cys residues are 90 aa apart (positions 17 and 107)', '#e74c3c'),\n    ('2. 3D Cys Distance', 'SG\u2013SG = 36.5 \u00c5 (disulfide requires \u22644\u20135 \u00c5)', '#e74c3c'),\n    ('3. Catalytic His', 'ZERO histidines in entire 107-aa sequence', '#e74c3c'),\n    ('4. Proton Relay', 'His\u2013Glu relay system completely absent', '#e74c3c'),\n    ('5. Protein Size', '107 aa vs 177 aa for characterized AhpD', '#e67e22'),\n    ('6. GO Annotation', 'GO:0016491 (IBA) transferred from Mtb AhpD without residue check', '#e67e22'),\n    ('7. GO:0016671', 'Not currently annotated \u2014 hypothesis proposes adding it', '#3498db'),\n]\n\ny_start = 0.95\nfor i, (label, desc, color) in enumerate(evidence_items):\n    y = y_start - i * 0.13\n    ax3.text(0.02, y, label, fontsize=10, fontweight='bold', color=color,\n             transform=ax3.transAxes, va='top')\n    ax3.text(0.25, y, desc, fontsize=9.5, color='#2c3e50',\n             transform=ax3.transAxes, va='top')\n\nplt.tight_layout()\nplt.savefig('mj1511_catalytic_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: mj1511_catalytic_analysis.png\")\n",
  "plot_number": 1
}