{
  "filename": "isoform_analysis.png",
  "iteration": 2,
  "description": "Create comprehensive visualization of isoform architecture showing MTS extension and updated verdict",
  "timestamp": "2026-07-01 04:08:12",
  "code": "\nimport matplotlib\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n# The MTS extension from CG4389-PA (Q9V397)\nmts_ext = \"MSATRFLSAVGQISRQQLLQNKCTRALPISAQLLQRRRL\"\nprint(f\"=== MTS Extension Analysis (39 aa) ===\")\nprint(f\"Sequence: {mts_ext}\")\nprint(f\"Length: {len(mts_ext)} aa\")\n\nfrom collections import Counter\ncounts = Counter(mts_ext)\nprint(f\"\\nAmino acid composition:\")\npos = counts.get('R', 0) + counts.get('K', 0)\nneg = counts.get('D', 0) + counts.get('E', 0)\nprint(f\"  R: {counts.get('R', 0)}, K: {counts.get('K', 0)} \u2192 total positive: {pos}\")\nprint(f\"  D: {counts.get('D', 0)}, E: {counts.get('E', 0)} \u2192 total negative: {neg}\")\nprint(f\"  Net charge: +{pos - neg}\")\nprint(f\"  Hydrophobic (LFIVA): {sum(counts.get(aa,0) for aa in 'LFIVA')}/39 ({sum(counts.get(aa,0) for aa in 'LFIVA')/39*100:.0f}%)\")\nprint(f\"  Ser/Thr (hydroxyl): {counts.get('S',0) + counts.get('T',0)}\")\n\n# Create comprehensive figure showing the isoform architecture\nfig, axes = plt.subplots(3, 1, figsize=(16, 11))\n\n# Panel A: Isoform architecture\nax1 = axes[0]\nax1.set_xlim(-50, 820)\nax1.set_ylim(-0.5, 3.5)\n\n# CG4389-PA (Q9V397, 783 aa)\ny_pa = 3\nax1.barh(y_pa, 783, left=0, height=0.4, color='lightgray', edgecolor='black', linewidth=1)\nax1.barh(y_pa, 39, left=0, height=0.4, color='#e74c3c', alpha=0.8)  # MTS\nax1.barh(y_pa, 3, left=780, height=0.4, color='#2ecc71', alpha=0.8)  # PTS1\nax1.text(-45, y_pa, 'CG4389-PA\\n(Q9V397)\\n783 aa', ha='right', va='center', fontsize=9, fontweight='bold')\nax1.text(19, y_pa, 'MTS\\n(39 aa)', ha='center', va='center', fontsize=8, color='white', fontweight='bold')\nax1.text(780, y_pa-0.35, 'SKL', ha='center', fontsize=8, color='#2ecc71', fontweight='bold')\nax1.annotate('DUAL:\\nMito + Perox', xy=(783, y_pa), xytext=(810, y_pa),\n            fontsize=8, color='#8e44ad', fontweight='bold',\n            arrowprops=dict(arrowstyle='->', color='#8e44ad'))\n\n# CG4389-PB (Q8IPE8, 744 aa)\ny_pb = 2\nax1.barh(y_pb, 744, left=39, height=0.4, color='lightgray', edgecolor='black', linewidth=1)\nax1.barh(y_pb, 3, left=780, height=0.4, color='#2ecc71', alpha=0.8)  # PTS1\nax1.text(-45, y_pb, 'CG4389-PB\\n(Q8IPE8)\\n744 aa', ha='right', va='center', fontsize=9, fontweight='bold',\n         bbox=dict(boxstyle='round', facecolor='yellow', alpha=0.3))\nax1.text(780, y_pb-0.35, 'SKL', ha='center', fontsize=8, color='#2ecc71', fontweight='bold')\nax1.annotate('PEROXISOME\\nONLY', xy=(783, y_pb), xytext=(810, y_pb),\n            fontsize=8, color='#2ecc71', fontweight='bold',\n            arrowprops=dict(arrowstyle='->', color='#2ecc71'))\n\n# Human HADHA for comparison\ny_hadha = 1\nax1.barh(y_hadha, 763, left=0, height=0.4, color='lightgray', edgecolor='black', linewidth=1)\nax1.barh(y_hadha, 36, left=0, height=0.4, color='#e74c3c', alpha=0.8)  # MTS\nax1.text(-45, y_hadha, 'H.sapiens\\nHADHA\\n763 aa', ha='right', va='center', fontsize=9)\nax1.text(18, y_hadha, 'MTS', ha='center', va='center', fontsize=8, color='white', fontweight='bold')\nax1.text(760, y_hadha-0.35, 'FYQ', ha='center', fontsize=8, color='#e74c3c')\nax1.annotate('MITO ONLY\\n(no PTS1)', xy=(763, y_hadha), xytext=(810, y_hadha),\n            fontsize=8, color='#e74c3c', fontweight='bold',\n            arrowprops=dict(arrowstyle='->', color='#e74c3c'))\n\n# Human EHHADH\ny_ehh = 0\nax1.barh(y_ehh, 723, left=0, height=0.4, color='lightgray', edgecolor='black', linewidth=1)\nax1.barh(y_ehh, 3, left=720, height=0.4, color='#2ecc71', alpha=0.8)  # PTS1\nax1.text(-45, y_ehh, 'H.sapiens\\nEHHADH\\n723 aa', ha='right', va='center', fontsize=9)\nax1.text(720, y_ehh-0.35, 'SKL', ha='center', fontsize=8, color='#2ecc71', fontweight='bold')\nax1.annotate('PEROXISOME\\nONLY', xy=(723, y_ehh), xytext=(810, y_ehh),\n            fontsize=8, color='#2ecc71', fontweight='bold',\n            arrowprops=dict(arrowstyle='->', color='#2ecc71'))\n\n# Add domains for PB\nfor y_pos in [y_pa, y_pb]:\n    offset = 39 if y_pos == y_pa else 39\n    # ECH domain\n    ax1.barh(y_pos, 280, left=offset+10, height=0.15, color='steelblue', alpha=0.5)\n    # 3HCDH domains\n    ax1.barh(y_pos, 280, left=offset+370, height=0.15, color='coral', alpha=0.5)\n\nax1.set_xlabel('Position (aa)')\nax1.set_yticks([])\nax1.set_title('A. Isoform Architecture: CG4389/Mtpalpha vs Human Orthologs', fontweight='bold', fontsize=12)\n\n# Legend\nfrom matplotlib.patches import Patch\nlegend_elements = [Patch(facecolor='#e74c3c', alpha=0.8, label='MTS (mitochondrial targeting)'),\n                   Patch(facecolor='#2ecc71', alpha=0.8, label='PTS1 (peroxisomal targeting)'),\n                   Patch(facecolor='steelblue', alpha=0.5, label='Enoyl-CoA hydratase domain'),\n                   Patch(facecolor='coral', alpha=0.5, label='3-hydroxyacyl-CoA DH domain')]\nax1.legend(handles=legend_elements, loc='upper right', fontsize=8)\n\n# Panel B: MTS helical wheel projection (simplified)\nax2 = axes[1]\nax2.set_xlim(-2, 12)\nax2.set_ylim(-2, 3)\n\n# Show MTS as amphipathic helix\n# Eisenberg hydrophobicity for helical wheel\neisenberg = {\n    'A': 0.62, 'R': -2.53, 'N': -0.78, 'D': -0.90, 'C': 0.29,\n    'Q': -0.85, 'E': -0.74, 'G': 0.48, 'H': -0.40, 'I': 1.38,\n    'L': 1.06, 'K': -1.50, 'M': 0.64, 'F': 1.19, 'P': 0.12,\n    'S': -0.18, 'T': -0.05, 'W': 0.81, 'Y': 0.26, 'V': 1.08\n}\n\n# Display MTS sequence with coloring\nax2.text(0, 2.5, 'CG4389-PA MTS extension (39 aa):', fontsize=10, fontweight='bold')\nfor i, aa in enumerate(mts_ext):\n    x = i * 0.27\n    if aa in 'RK':\n        color = '#3498db'  # positive = blue\n    elif aa in 'DE':\n        color = '#e74c3c'  # negative = red\n    elif aa in 'LFIVA':\n        color = '#f39c12'  # hydrophobic = orange\n    else:\n        color = '#95a5a6'  # other = gray\n    ax2.text(x, 1.8, aa, fontsize=11, fontweight='bold', color=color, \n             fontfamily='monospace', ha='center')\n    ax2.text(x, 1.3, str(i+1), fontsize=6, color='gray', ha='center')\n\nax2.text(0, 0.7, 'Color: ', fontsize=9)\nax2.text(1.2, 0.7, 'R/K (+charge)', fontsize=9, color='#3498db', fontweight='bold')\nax2.text(3.8, 0.7, 'L/F/I/V/A (hydrophobic)', fontsize=9, color='#f39c12', fontweight='bold')\nax2.text(7.5, 0.7, 'other', fontsize=9, color='#95a5a6')\n\nax2.text(0, 0.1, 'Properties: Net charge = +7  |  No acidic residues  |  38% hydrophobic', fontsize=10)\nax2.text(0, -0.4, 'MitoProtII: 97% MTS probability  |  TargetP: 85% MTS probability', fontsize=10, color='#e74c3c')\nax2.text(0, -0.9, 'MPP cleavage: Ends with RRRL \u2192 cleavage between R and L yields PB N-terminus (M...)', \n         fontsize=9, color='#8e44ad')\nax2.text(0, -1.4, 'PB starts at M39 \u2192 MSTNPAP... (= Q8IPE8)', fontsize=9, fontweight='bold', color='#2ecc71')\n\nax2.axis('off')\nax2.set_title('B. MTS Extension Properties', fontweight='bold', fontsize=12)\n\n# Panel C: Updated verdict\nax3 = axes[2]\nax3.axis('off')\nverdict_text = \"\"\"UPDATED VERDICT: SUPPORTED\n\nQ8IPE8 = CG4389-PB (the shorter isoform WITHOUT the MTS)\n\nEvidence for peroxisomal localization:\n\u2713 Q8IPE8 was DIRECTLY TESTED: mCherry-CG4389-PB colocalized\n  with PMP34-Cerulean in S2 cells (Figure 4, PMID:22758915)\n\u2713 Paper states PB/PC are \"exclusively peroxisomal\"\n\u2713 Canonical PTS1 (SKL) conserved across Drosophila genus\n\u2713 No mitochondrial targeting sequence in this isoform\n\nMitochondrial annotations likely reflect PA isoform (Q9V397):\n\u2022 Q9V397 has 39-aa MTS extension (net charge +7, 97% MitoProtII)\n\u2022 The HDA proteomics evidence cannot distinguish PA from PB\n\u2022 Q9V397 is the isoform predicted to be dually localized\n\nRECOMMENDATION: RETAIN GO:0005777. Consider upgrading to\nGO:0005782 (peroxisomal matrix) since PTS1 targets to matrix.\n\"\"\"\nax3.text(0.02, 0.95, verdict_text, transform=ax3.transAxes,\n         fontsize=10, verticalalignment='top', fontfamily='monospace',\n         bbox=dict(boxstyle='round', facecolor='#d5f5e3', alpha=0.8))\nax3.set_title('C. Updated Curation Assessment', fontweight='bold', fontsize=12)\n\nplt.tight_layout()\nplt.savefig('isoform_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Isoform analysis figure saved\")\n"
}