{
  "filename": "plot_1.png",
  "iteration": 1,
  "description": "Create comprehensive visualization of CASP12 domain architecture, active site mutations, and evidence summary",
  "timestamp": "2026-07-05 03:51:50",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(3, 1, figsize=(14, 10))\n\n# Panel 1: Domain architecture comparison\nax1 = axes[0]\nax1.set_title(\"A. Domain Architecture: Human CASP12 vs Mouse Casp12\", fontsize=12, fontweight='bold')\n\n# Mouse Casp12 (419 aa) - functional\ny_mouse = 0.7\nax1.barh(y_mouse, 419, height=0.25, color='lightgray', edgecolor='black')\nax1.barh(y_mouse, 92, left=0, height=0.25, color='#4ECDC4', edgecolor='black', label='CARD domain')\nax1.barh(y_mouse, 200, left=100, height=0.25, color='#45B7D1', edgecolor='black', label='Peptidase_C14')\nax1.plot(249, y_mouse, 'r^', markersize=12, zorder=5)  # SHG\nax1.plot(296, y_mouse, 'r*', markersize=15, zorder=5)  # QACRG\nax1.text(249, y_mouse+0.18, 'SHG\\n(His)', ha='center', fontsize=8, color='red', fontweight='bold')\nax1.text(296, y_mouse+0.18, 'QACRG\\n(Cys)', ha='center', fontsize=8, color='red', fontweight='bold')\nax1.text(-30, y_mouse, 'Mouse\\nCasp12\\n(419 aa)', ha='right', va='center', fontsize=9, fontweight='bold')\n\n# Human CASP12 full-length (341 aa, rare allele)\ny_human_full = 0.35\nax1.barh(y_human_full, 341, height=0.25, color='#FFE5E5', edgecolor='black')\nax1.barh(y_human_full, 92, left=0, height=0.25, color='#4ECDC4', edgecolor='black')\nax1.barh(y_human_full, 200, left=100, height=0.25, color='#FFCCCC', edgecolor='black')\nax1.plot(171, y_human_full, 'kx', markersize=12, markeredgewidth=3, zorder=5)  # SHS (mutated!)\nax1.plot(220, y_human_full, 'r*', markersize=15, zorder=5)  # QACRG\nax1.text(171, y_human_full+0.18, 'SHS \u2717\\n(mutated)', ha='center', fontsize=8, color='darkred', fontweight='bold')\nax1.text(220, y_human_full+0.18, 'QACRG\\n(Cys)', ha='center', fontsize=8, color='red', fontweight='bold')\nax1.text(-30, y_human_full, 'Human\\nCASP12\\nfull (341)', ha='right', va='center', fontsize=9, fontweight='bold')\n\n# Human CASP12 truncated (124 aa, common allele)\ny_human_trunc = 0.0\nax1.barh(y_human_trunc, 124, height=0.25, color='#FFE5E5', edgecolor='black')\nax1.barh(y_human_trunc, 92, left=0, height=0.25, color='#4ECDC4', edgecolor='black')\nax1.plot(125, y_human_trunc, 'ks', markersize=12, zorder=5)  # Stop codon\nax1.text(130, y_human_trunc, 'STOP\\n(rs497116)', ha='left', fontsize=8, color='black', fontweight='bold')\nax1.text(-30, y_human_trunc, 'Human\\nCASP12\\ntrunc (124)', ha='right', va='center', fontsize=9, fontweight='bold')\n\nax1.set_xlim(-80, 440)\nax1.set_ylim(-0.2, 1.1)\nax1.set_xlabel('Amino acid position')\nax1.set_yticks([])\n\n# Panel 2: Active site alignment\nax2 = axes[1]\nax2.set_title(\"B. Active Site Motif Comparison (SHG box and QACRG)\", fontsize=12, fontweight='bold')\nax2.axis('off')\n\nalignment_data = [\n    (\"Human CASP1 (active)\", \"F L V F M\", \"S H G\", \"I R E G I\", \"... K V I I I\", \"Q A C R G\", \"D S P G V\"),\n    (\"Human CASP4 (active)\", \"F L V L M\", \"S H G\", \"I L E G I\", \"... K V I I V\", \"Q A C R G\", \"A N R G E\"),\n    (\"Mouse Casp12 (active)\", \"F L V F M\", \"S H G\", \"I L E G I\", \"... K I L I M\", \"Q A C R G\", \"R Y N G T\"),\n    (\"Human CASP12 (inactive)\", \"F L V F M\", \"S H S\", \"I L N G I\", \"... K V I I M\", \"Q A C R G\", \"N G A G I\"),\n]\n\ny_start = 0.85\nfor i, (label, pre_shg, shg, post_shg, pre_qa, qacrg, post_qa) in enumerate(alignment_data):\n    y = y_start - i * 0.22\n    color = 'red' if 'inactive' in label else 'black'\n    weight = 'bold' if 'inactive' in label else 'normal'\n    \n    ax2.text(0.02, y, label, fontsize=10, fontfamily='monospace', color=color, fontweight=weight,\n             transform=ax2.transAxes, va='center')\n    ax2.text(0.32, y, pre_shg, fontsize=10, fontfamily='monospace',\n             transform=ax2.transAxes, va='center')\n    \n    shg_color = 'red' if shg == \"S H S\" else 'green'\n    bbox = dict(boxstyle='round,pad=0.3', facecolor='lightyellow' if shg_color=='green' else '#FFD0D0', \n                edgecolor=shg_color, linewidth=2)\n    ax2.text(0.47, y, shg, fontsize=11, fontfamily='monospace', fontweight='bold',\n             transform=ax2.transAxes, va='center', bbox=bbox, color=shg_color)\n    \n    ax2.text(0.55, y, post_shg, fontsize=10, fontfamily='monospace',\n             transform=ax2.transAxes, va='center')\n    ax2.text(0.68, y, pre_qa, fontsize=10, fontfamily='monospace',\n             transform=ax2.transAxes, va='center')\n    \n    bbox2 = dict(boxstyle='round,pad=0.3', facecolor='lightyellow', edgecolor='green', linewidth=2)\n    ax2.text(0.82, y, qacrg, fontsize=11, fontfamily='monospace', fontweight='bold',\n             transform=ax2.transAxes, va='center', bbox=bbox2, color='green')\n    \n    ax2.text(0.93, y, post_qa, fontsize=10, fontfamily='monospace',\n             transform=ax2.transAxes, va='center')\n\n# Add header\nax2.text(0.47, y_start + 0.12, 'SHG box', fontsize=10, fontweight='bold', ha='center',\n         transform=ax2.transAxes, color='darkblue')\nax2.text(0.82, y_start + 0.12, 'QACRG', fontsize=10, fontweight='bold', ha='center',\n         transform=ax2.transAxes, color='darkblue')\n\n# Panel 3: Summary of evidence\nax3 = axes[2]\nax3.set_title(\"C. Evidence Summary: Does Human CASP12 Have Endopeptidase Activity?\", fontsize=12, fontweight='bold')\nax3.axis('off')\n\nevidence_text = \"\"\"\nAGAINST endopeptidase activity:\n  \u2022 UniProt names it \"Inactive caspase-12\" (Q6UXS9)\n  \u2022 SHG\u2192SHS mutation destroys catalytic dyad (Fischer et al. 2002, PMID:12054529)\n  \u2022 Premature stop codon at pos 125 in most humans (rs497116) removes entire catalytic domain\n  \u2022 GO IKR annotation: NOT|enables GO:0004197 (PMID:12054529)\n  \u2022 Even mouse Casp12 activity is confined to autoprocessing only (Roy et al. 2008, PMID:18332441)\n  \u2022 Catalytic function not needed for biological role (Saleh et al. 2006, PMID:16625199)\n  \u2022 Caspase-12 dimerization not detected by any treatment (Sanders et al. 2015, PMID:26158519)\n\nFOR endopeptidase activity (IBA annotation):\n  \u2022 QACRG catalytic motif is conserved in the full-length allele\n  \u2022 InterPro: Pept_C14 (Peptidase_C14) domain detected\n  \u2022 Phylogenetic inference (PAINT) from caspase ancestor\n\nVERDICT: IBA annotation is OVER-ANNOTATED \u2014 should be removed or qualified\n\"\"\"\nax3.text(0.02, 0.95, evidence_text, fontsize=9, fontfamily='monospace',\n         transform=ax3.transAxes, va='top', ha='left',\n         bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.8))\n\nplt.tight_layout()\nplt.savefig('casp12_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved as casp12_analysis.png\")\n",
  "plot_number": 1
}