{
  "filename": "plot_1.png",
  "iteration": 1,
  "description": "Create comprehensive evidence summary figure comparing mitochondrial vs peroxisomal evidence for Acat1",
  "timestamp": "2026-07-01 03:05:37",
  "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('Evidence Assessment: Drosophila Acat1 (Q9W3N9) Peroxisome Localization\\n(GO:0005777, ISM from PMID:22758915)', \n             fontsize=14, fontweight='bold', y=0.98)\n\n# Panel A: Evidence comparison for mitochondrion vs peroxisome\nax1 = axes[0, 0]\ncategories = ['Mitochondrion\\n(GO:0005739)', 'Peroxisome\\n(GO:0005777)']\nevidence_types = ['HDA (Experimental)', 'IBA (Phylogenetic)', 'ISM (Computational)']\ncolors = ['#2ecc71', '#3498db', '#e74c3c']\n\n# Mitochondrion: HDA=1, IBA=1, ISM=1; Peroxisome: HDA=0, IBA=0, ISM=1\nmito_vals = [1, 1, 1]\nperox_vals = [0, 0, 1]\n\nx = np.arange(len(categories))\nwidth = 0.25\n\nfor i, (ev_type, color) in enumerate(zip(evidence_types, colors)):\n    vals = [mito_vals[i], perox_vals[i]]\n    bars = ax1.bar(x + (i - 1) * width, vals, width, label=ev_type, color=color, alpha=0.8, edgecolor='black')\n\nax1.set_ylabel('Evidence Present (1=Yes, 0=No)', fontsize=11)\nax1.set_title('A. Evidence Support by GO Term', fontsize=12, fontweight='bold')\nax1.set_xticks(x)\nax1.set_xticklabels(categories, fontsize=11)\nax1.set_ylim(0, 1.4)\nax1.legend(fontsize=9, loc='upper right')\nax1.set_yticks([0, 1])\nax1.set_yticklabels(['No', 'Yes'])\n\n# Panel B: PTS1 C-terminal comparison\nax2 = axes[0, 1]\nproteins = ['Dmel Acat1\\n(Q9W3N9)', 'Human ACAT1\\n(P24752)', 'Dmel ScpX\\n(Q24506)', 'Yeast POT1\\n(P27796)']\nc_terms = ['-EKL', '-QKL', '-SKL', '-IKE']\npts1_scores = [3, 3, 6, 2]  # Out of 6\nbar_colors = ['#e74c3c', '#e74c3c', '#2ecc71', '#e74c3c']\n\nbars = ax2.barh(proteins, pts1_scores, color=bar_colors, alpha=0.8, edgecolor='black')\nax2.set_xlabel('PTS1 Score (max 6)', fontsize=11)\nax2.set_title('B. C-terminal PTS1 Signal Scoring', fontsize=12, fontweight='bold')\nax2.set_xlim(0, 7)\nax2.axvline(x=5, color='green', linestyle='--', alpha=0.5, label='Canonical threshold')\n\n# Add C-terminal text to bars\nfor bar, ct in zip(bars, c_terms):\n    ax2.text(bar.get_width() + 0.1, bar.get_y() + bar.get_height()/2, \n             ct, va='center', fontsize=11, fontweight='bold')\n\nax2.legend(fontsize=9)\n\n# Panel C: N-terminal MTS characteristics\nax3 = axes[1, 0]\nproteins_mts = ['Dmel Acat1\\n(first 30 aa)', 'Human ACAT1\\n(first 33 aa, known MTS)']\npos_charges = [6, 7]\nneg_charges = [1, 2]\nnet_charges = [5, 5]\n\nx_mts = np.arange(len(proteins_mts))\nwidth_mts = 0.25\n\nax3.bar(x_mts - width_mts, pos_charges, width_mts, label='Positive (R+K+H)', color='#3498db', alpha=0.8, edgecolor='black')\nax3.bar(x_mts, neg_charges, width_mts, label='Negative (D+E)', color='#e74c3c', alpha=0.8, edgecolor='black')\nax3.bar(x_mts + width_mts, net_charges, width_mts, label='Net charge', color='#2ecc71', alpha=0.8, edgecolor='black')\n\nax3.set_ylabel('Count / Charge', fontsize=11)\nax3.set_title('C. N-terminal MTS Properties', fontsize=12, fontweight='bold')\nax3.set_xticks(x_mts)\nax3.set_xticklabels(proteins_mts, fontsize=10)\nax3.legend(fontsize=9)\n\n# Panel D: Summary table\nax4 = axes[1, 1]\nax4.axis('off')\ntable_data = [\n    ['Feature', 'Mitochondrion', 'Peroxisome'],\n    ['Experimental evidence', 'HDA (LOPIT)', 'None'],\n    ['Phylogenetic evidence', 'IBA', 'None'],\n    ['Computational prediction', 'ISM', 'ISM only'],\n    ['Targeting signal', 'MTS (N-term, +5)', '-EKL (non-canonical)'],\n    ['Functional context', 'Ketolysis, AA catab.', 'None in Drosophila'],\n    ['Ortholog localization', 'Mito (human ACAT1)', 'Not peroxisomal'],\n    ['', '', ''],\n    ['VERDICT', 'SUPPORTED', 'OVER-ANNOTATED'],\n]\n\ntable = ax4.table(cellText=table_data, loc='center', cellLoc='center',\n                  colWidths=[0.35, 0.32, 0.33])\ntable.auto_set_font_size(False)\ntable.set_fontsize(10)\ntable.scale(1, 1.5)\n\n# Style header row\nfor j in range(3):\n    table[0, j].set_facecolor('#34495e')\n    table[0, j].set_text_props(color='white', fontweight='bold')\n    \n# Style verdict row\nfor j in range(3):\n    table[8, j].set_text_props(fontweight='bold', fontsize=11)\n    if j == 1:\n        table[8, j].set_facecolor('#d5f4e6')\n    elif j == 2:\n        table[8, j].set_facecolor('#fadbd8')\n\nax4.set_title('D. Evidence Summary', fontsize=12, fontweight='bold', pad=20)\n\nplt.tight_layout(rect=[0, 0, 1, 0.95])\nplt.savefig('evidence_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Evidence summary figure saved.\")\n",
  "plot_number": 1
}