{
  "filename": "plot_2.png",
  "iteration": 2,
  "description": "Visualize the distribution of CxxC motif and His presence across 100 archaeal CMD-like proteins",
  "timestamp": "2026-07-06 20:03:58",
  "code": "\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Archaeal CMD-like protein survey results\n# Total: 100 proteins\n# CxxC+His: 43 (catalytic-competent)\n# CxxC only: 8 (CxxC but no His -- partial)\n# His only: 41 (His but no CxxC)\n# Neither: 8 (no CxxC, no His -- clearly non-catalytic)\n\n# More precisely from the data:\nwith_cxxc_with_his = 43  # approximate from data\nwith_cxxc_no_his = 8     # CxxC present but His=0\nno_cxxc_with_his = 49    # no CxxC but has His\nno_cxxc_no_his = 0       # neither\n\n# Let me recount from the output\n# With CxxC: 51, Without CxxC: 49\n# With His: 92, Without His: 8\n# So CxxC+His = 51 - (CxxC, no His) \n# From the data, CxxC proteins that have His=0: none visible, all CxxC proteins seem to have His>=1\n# Let's count properly\n\n# From the data above, proteins with CxxC AND His=0: none (all with CxxC have His>=1)\n# Proteins without CxxC AND His=0: 8 (MJ1511, MJ0742, M. bathoardescens, \n#   Methanobrevibacter millerae, M. oralis, Methanobrevibacter gottschalkii, \n#   Methanohalophilus portucalensis, Methanosarcina thermophila)\n\n# Wait, let me recount from the output data...\n# CxxC YES and His>0: 51 (all CxxC proteins have His\u22651)\n# CxxC NO and His>0: 92-51 = 41\n# CxxC NO and His=0: 49-41 = 8\n# CxxC YES and His=0: 0\n\ncategories = ['CxxC + His\\n(catalytic-competent)', \n              'No CxxC, has His\\n(uncertain)',\n              'No CxxC, no His\\n(non-catalytic)']\ncounts = [51, 41, 8]\ncolors = ['#2ecc71', '#f39c12', '#e74c3c']\n\nfig, axes = plt.subplots(1, 2, figsize=(14, 6))\n\n# Panel A: Pie chart\nax1 = axes[0]\nwedges, texts, autotexts = ax1.pie(counts, labels=categories, colors=colors, \n                                    autopct='%1.0f%%', startangle=90, \n                                    textprops={'fontsize': 10})\nfor autotext in autotexts:\n    autotext.set_fontsize(12)\n    autotext.set_fontweight('bold')\nax1.set_title('A. CxxC Motif & His Distribution\\nin 100 Archaeal CMD-like Proteins', \n              fontsize=13, fontweight='bold')\n\n# Panel B: Highlight MJ1511 context\nax2 = axes[1]\nax2.axis('off')\nax2.set_title('B. MJ1511 in Context of Archaeal CMD Family', fontsize=13, fontweight='bold')\n\ncontext_data = [\n    (\"Category\", \"Count\", \"%\", \"MJ1511?\"),\n    (\"CxxC + His (catalytic)\", \"51\", \"51%\", \"\"),\n    (\"No CxxC, has His\", \"41\", \"41%\", \"\"),\n    (\"No CxxC, no His\", \"8\", \"8%\", \"YES\"),\n]\n\ntable_colors = [['#ecf0f1']*4,\n                ['#d5f5e3']*4,\n                ['#fdebd0']*4,\n                ['#fadbd8']*4]\n\ntable = ax2.table(cellText=[row for row in context_data],\n                  cellColours=table_colors,\n                  loc='center',\n                  cellLoc='center')\ntable.auto_set_font_size(False)\ntable.set_fontsize(11)\ntable.scale(1, 2)\n\n# Make header bold\nfor j in range(4):\n    table[0, j].set_text_props(fontweight='bold')\n# Make MJ1511 row bold\nfor j in range(4):\n    table[3, j].set_text_props(fontweight='bold', color='#c0392b')\n\n# Add note below table\nax2.text(0.5, 0.05, \n         'MJ1511 is in the smallest, most divergent group:\\n'\n         'no CxxC motif AND no histidine residues.\\n'\n         'All methanococcal CMD-like proteins are in this group.',\n         ha='center', va='center', fontsize=10, fontstyle='italic',\n         transform=ax2.transAxes,\n         bbox=dict(boxstyle='round,pad=0.5', facecolor='#fef9e7', alpha=0.8))\n\nplt.tight_layout()\nplt.savefig('archaeal_cmd_survey.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved: archaeal_cmd_survey.png\")\n",
  "plot_number": 2
}