{
  "filename": "plot_1.png",
  "iteration": 1,
  "description": "Visualization of GH18 catalytic motif alignment comparing cts2 with active chitinases and known CLPs, plus domain architecture",
  "timestamp": "2026-07-06 21:23:46",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(2, 1, figsize=(14, 10), gridspec_kw={'height_ratios': [3, 2]})\n\n# Panel A: Catalytic motif alignment\nax1 = axes[0]\nax1.set_xlim(-1, 14)\nax1.set_ylim(-0.5, 5.5)\nax1.set_title(\"A. GH18 Catalytic Motif Alignment\", fontsize=14, fontweight='bold', loc='left')\n\nproteins = [\n    (\"S. cerevisiae Cts1\\n(active chitinase)\", \"D G F D F D I E N N N E\", \n     [0,0,0,0,0,1,0,1,0,0,0,0], True),\n    (\"H. sapiens CHIT1\\n(active chitinase)\", \"D G L D L D W E Y P G S\",\n     [0,0,0,0,0,1,0,1,0,0,0,0], True),\n    (\"H. sapiens CHI3L1\\n(non-catalytic CLP)\", \"D G L D L A W L Y P G R\",\n     [0,0,0,0,0,2,0,2,0,0,0,0], False),\n    (\"S. pombe cts2\\n(Q9C105)\", \"D G F D L E V N K G T N\",\n     [0,0,0,0,0,2,0,2,0,0,0,0], False),\n]\n\ny_positions = [4, 3, 1.5, 0.5]\ncolors_map = {0: '#E8E8E8', 1: '#4CAF50', 2: '#F44336'}  # gray, green, red\n\nfor idx, (name, residues_str, highlights, is_active) in enumerate(proteins):\n    y = y_positions[idx]\n    residues = residues_str.split()\n    \n    # Draw protein label\n    ax1.text(-0.8, y, name, ha='right', va='center', fontsize=9, \n             fontweight='bold' if not is_active else 'normal',\n             color='#D32F2F' if not is_active else '#1B5E20')\n    \n    # Draw residue boxes\n    for j, (res, hl) in enumerate(zip(residues, highlights)):\n        color = colors_map[hl]\n        rect = mpatches.FancyBboxPatch((j-0.3, y-0.3), 0.6, 0.6,\n                                        boxstyle=\"round,pad=0.05\",\n                                        facecolor=color, edgecolor='black', linewidth=1)\n        ax1.add_patch(rect)\n        fontcolor = 'white' if hl > 0 else 'black'\n        ax1.text(j, y, res, ha='center', va='center', fontsize=11, \n                fontweight='bold', color=fontcolor, family='monospace')\n\n# Add position labels\npositions = ['0','1','2','3','4','5','6','7','8','9','10','11']\nfor j, pos in enumerate(positions):\n    ax1.text(j, 5.2, pos, ha='center', va='center', fontsize=8, color='gray')\n\n# Add role annotations\nax1.annotate('Catalytic\\nAsp (3rd)', xy=(5, -0.3), fontsize=8, ha='center', va='top',\n            color='#B71C1C', fontweight='bold')\nax1.annotate('Catalytic\\nGlu (proton\\ndonor)', xy=(7, -0.3), fontsize=8, ha='center', va='top',\n            color='#B71C1C', fontweight='bold')\n\n# Add dividing line between active and non-catalytic\nax1.axhline(y=2.25, color='gray', linestyle='--', linewidth=1, alpha=0.5)\nax1.text(13.5, 3.5, \"ACTIVE\", fontsize=10, ha='right', va='center', color='#1B5E20', fontweight='bold')\nax1.text(13.5, 1.0, \"NON-CATALYTIC\", fontsize=10, ha='right', va='center', color='#D32F2F', fontweight='bold')\n\nax1.axis('off')\n\n# Panel B: Domain architecture of cts2\nax2 = axes[1]\nax2.set_xlim(0, 1300)\nax2.set_ylim(-1, 3)\nax2.set_title(\"B. Domain Architecture of S. pombe cts2 (Q9C105, 1236 aa)\", fontsize=14, fontweight='bold', loc='left')\n\n# Signal peptide\nrect = mpatches.FancyBboxPatch((1, 0.5), 19, 1, boxstyle=\"round,pad=2\",\n                                facecolor='#FFC107', edgecolor='black', linewidth=1)\nax2.add_patch(rect)\nax2.text(10, 1, 'SP', ha='center', va='center', fontsize=7, fontweight='bold')\n\n# GH18 domain\nrect = mpatches.FancyBboxPatch((26, 0.3), 299, 1.4, boxstyle=\"round,pad=2\",\n                                facecolor='#2196F3', edgecolor='black', linewidth=1.5)\nax2.add_patch(rect)\nax2.text(175, 1, 'GH18 Domain\\n(non-catalytic)', ha='center', va='center', \n         fontsize=9, fontweight='bold', color='white')\n\n# Mark the disrupted catalytic site\nax2.annotate('E\u2192N\\n(catalytic Glu\\nmissing)', xy=(162, 0.3), xytext=(162, -0.7),\n            fontsize=8, ha='center', va='top', color='#D32F2F', fontweight='bold',\n            arrowprops=dict(arrowstyle='->', color='#D32F2F', lw=1.5))\n\n# Ser/Thr-rich region (rest of protein)\nrect = mpatches.FancyBboxPatch((325, 0.5), 911, 1, boxstyle=\"round,pad=2\",\n                                facecolor='#9E9E9E', edgecolor='black', linewidth=1)\nax2.add_patch(rect)\nax2.text(780, 1, 'Ser/Thr-rich region\\n(heavily glycosylated, disordered)', \n         ha='center', va='center', fontsize=9, color='white', fontweight='bold')\n\n# Scale bar\nax2.plot([0, 100], [-0.5, -0.5], 'k-', linewidth=2)\nax2.text(50, -0.7, '100 aa', ha='center', va='top', fontsize=8)\n\n# Add position labels\nfor pos in [1, 26, 325, 1236]:\n    ax2.text(pos, 2.0, str(pos), ha='center', va='bottom', fontsize=8, color='gray')\n\nax2.axis('off')\n\nplt.tight_layout()\nplt.savefig('cts2_catalytic_motif_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: cts2_catalytic_motif_analysis.png\")\n",
  "plot_number": 1
}