{
  "filename": "plot_2.png",
  "iteration": 1,
  "description": "Create comprehensive evidence summary figure with PTS1 conservation, similarity analysis, GO annotations, and verdict",
  "timestamp": "2026-07-01 03:56:17",
  "code": "\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# Create a comprehensive evidence summary figure\nfig, axes = plt.subplots(2, 2, figsize=(16, 12))\n\n# Panel A: PTS1 conservation across species\nax1 = axes[0, 0]\nspecies = [\n    'D. melanogaster', 'D. simulans', 'D. suzukii', \n    'D. kikkawai', 'D. pseudoobscura', 'D. mauritiana',\n    'D. busckii', 'D. hydei', 'D. albomicans',\n    'H. sapiens\\n(HADHA)', 'M. musculus\\n(Hadha)', \n    'H. sapiens\\n(EHHADH)', 'S. cerevisiae\\n(FOX2)'\n]\nc_terms = ['SKL', 'SKL', 'SKL', 'SKL', 'SKL', 'SKL', 'SKL', 'AKL', 'SKL', \n           'FYQ', 'FYQ', 'SKL', 'SKL']\ncolors = ['#2ecc71' if ct in ['SKL', 'AKL'] else '#e74c3c' for ct in c_terms]\nbars = ax1.barh(range(len(species)), [1]*len(species), color=colors, edgecolor='white', height=0.7)\nfor i, (sp, ct) in enumerate(zip(species, c_terms)):\n    ax1.text(0.5, i, ct, ha='center', va='center', fontweight='bold', fontsize=11, color='white')\nax1.set_yticks(range(len(species)))\nax1.set_yticklabels(species, fontsize=9)\nax1.set_xlim(0, 1)\nax1.set_xticks([])\nax1.set_title('A. C-terminal Tripeptide (PTS1 Signal)', fontweight='bold')\nax1.axhline(y=8.5, color='black', linewidth=2, linestyle='-')\nax1.text(0.05, 12.3, 'Green = PTS1 present', fontsize=8, color='#2ecc71', fontweight='bold')\nax1.text(0.05, 11.8, 'Red = No PTS1', fontsize=8, color='#e74c3c', fontweight='bold')\nax1.invert_yaxis()\n\n# Panel B: K-mer similarity\nax2 = axes[0, 1]\ncomparisons = ['Mtpalpha\\nvs HADHA\\n(mito)', 'Mtpalpha\\nvs EHHADH\\n(perox)', 'HADHA\\nvs EHHADH']\nkmer3 = [0.220, 0.128, 0.110]\nkmer5 = [0.062, 0.009, 0.007]\nx = np.arange(len(comparisons))\nwidth = 0.35\nbars1 = ax2.bar(x - width/2, kmer3, width, label='3-mer Jaccard', color='#3498db')\nbars2 = ax2.bar(x + width/2, kmer5, width, label='5-mer Jaccard', color='#e67e22')\nax2.set_ylabel('Jaccard Similarity')\nax2.set_title('B. Sequence Similarity (k-mer)', fontweight='bold')\nax2.set_xticks(x)\nax2.set_xticklabels(comparisons, fontsize=9)\nax2.legend()\nfor bar_group in [bars1, bars2]:\n    for bar in bar_group:\n        height = bar.get_height()\n        ax2.text(bar.get_x() + bar.get_width()/2., height + 0.003,\n                f'{height:.3f}', ha='center', va='bottom', fontsize=9)\n\n# Panel C: GO annotation evidence table\nax3 = axes[1, 0]\nax3.axis('off')\ntable_data = [\n    ['GO:0005739\\n(mitochondrion)', 'HDA', 'PMID:16212416', 'Mitochondrial\\nproteomics'],\n    ['GO:0005739\\n(mitochondrion)', 'HDA', 'PMID:19317464', 'LOPIT spatial\\nproteomics'],\n    ['GO:0005739\\n(mitochondrion)', 'ISM', 'PMID:22758915', 'Sequence model\\nprediction'],\n    ['GO:0005777\\n(peroxisome)', 'IDA', 'PMID:22758915', 'Direct assay\\n(5 confirmed)'],\n    ['GO:0005777\\n(peroxisome)', 'ISS', 'PMID:22758915', 'From EHHADH\\n(Q08426)'],\n    ['GO:0005777\\n(peroxisome)', 'ISM', 'PMID:22758915', 'PTS1 prediction'],\n    ['GO:0016507\\n(mito FA \u03b2-ox)', 'IEA', 'InterPro', 'Domain match'],\n]\ncol_labels = ['GO Term', 'Evidence', 'Reference', 'Basis']\ntable = ax3.table(cellText=table_data, colLabels=col_labels, loc='center',\n                  cellLoc='center', colWidths=[0.3, 0.15, 0.25, 0.3])\ntable.auto_set_font_size(False)\ntable.set_fontsize(9)\ntable.scale(1, 1.8)\n# Color code rows\nfor i in range(len(table_data)):\n    row = i + 1\n    if 'mitochondri' in table_data[i][0].lower():\n        for j in range(4):\n            table[row, j].set_facecolor('#AED6F1')\n    else:\n        for j in range(4):\n            table[row, j].set_facecolor('#ABEBC6')\nfor j in range(4):\n    table[0, j].set_facecolor('#D5D8DC')\n    table[0, j].set_text_props(fontweight='bold')\nax3.set_title('C. GO Cellular Component Annotations for Q8IPE8', fontweight='bold', pad=20)\n\n# Panel D: Verdict summary\nax4 = axes[1, 1]\nax4.axis('off')\nverdict_text = \"\"\"VERDICT: PARTIALLY SUPPORTED\n\nThe GO:0005777 (peroxisome) annotation with IDA \nevidence is supported by:\n\u2022 Canonical PTS1 signal (SKL) conserved in all \n  Drosophila species examined\n\u2022 IDA evidence from PMID:22758915\n\u2022 ISS transfer from peroxisomal EHHADH (Q08426)\n\nHowever, Mtpalpha is primarily mitochondrial:\n\u2022 PANTHER: \"Mitochondrial\" subfamily (PTHR43612:SF3)\n\u2022 Domain IPR012803: Fa_ox_alpha_mit (mito-specific)\n\u2022 HDA evidence from 2 mitochondrial proteomics studies\n\u2022 KO phenotype = mitochondrial \u03b2-oxidation deficiency\n\u2022 Vertebrate orthologs are exclusively mitochondrial\n\u2022 Drosophila has separate peroxisomal enzyme (Mfe2)\n\nRECOMMENDATION: Retain GO:0005777 annotation.\nThe protein likely has genuine dual localization \n(primary: mitochondrion, secondary: peroxisome).\n\"\"\"\nax4.text(0.05, 0.95, verdict_text, transform=ax4.transAxes,\n         fontsize=10, verticalalignment='top', fontfamily='monospace',\n         bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.8))\nax4.set_title('D. Curation Assessment', fontweight='bold')\n\nplt.suptitle('Mtpalpha (Q8IPE8) Peroxisome Localization Evidence Assessment', \n             fontsize=14, fontweight='bold', y=1.02)\nplt.tight_layout()\nplt.savefig('evidence_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Evidence summary figure saved\")\n",
  "plot_number": 2
}