{
  "filename": "topology_model.png",
  "iteration": 2,
  "description": "Analyze the tandem repeat structure of PGG domains - compare the internal repeat unit and assess whether these form a multi-TM pore-like structure",
  "timestamp": "2026-06-22 10:06:16",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\n# The key observation: PGG domain proteins show variable numbers of TM helices\n# that are always multiples or near-multiples of the PGG domain count\n\nproteins = {\n    'A0A804UIX9 (Maize)': {'length': 375, 'PGG': 2, 'TM': 6, 'Ank': False},\n    'A0A0P0WVF8 (Rice)': {'length': 286, 'PGG': 2, 'TM': 6, 'Ank': False},\n    'Q2R8Q6 (Rice)': {'length': 275, 'PGG': 1, 'TM': 6, 'Ank': False},\n    'A0A804LML3 (Maize)': {'length': 429, 'PGG': 2, 'TM': 6, 'Ank': False},\n    'A0A0P0WVA6 (Rice, SF432)': {'length': 276, 'PGG': 1, 'TM': 4, 'Ank': False},\n    'A0A0P0WVH3 (Rice, 5\u00d7PGG)': {'length': 877, 'PGG': 5, 'TM': 16, 'Ank': False},\n    'ACD6/Q8LPS2 (Arabidopsis)': {'length': 670, 'PGG': 1, 'TM': 6, 'Ank': True},\n    'ITN1/Q9C7A2 (Arabidopsis)': {'length': 670, 'PGG': 1, 'TM': 6, 'Ank': True},\n}\n\nprint(\"=== PGG Domain Architecture Survey ===\")\nprint(f\"{'Protein':<35} {'Length':>6} {'PGG':>4} {'TM':>4} {'Ank':>5} {'TM/PGG':>8}\")\nprint(\"-\" * 70)\nfor name, info in proteins.items():\n    ratio = info['TM'] / info['PGG'] if info['PGG'] > 0 else 'N/A'\n    print(f\"{name:<35} {info['length']:>6} {info['PGG']:>4} {info['TM']:>4} {'Yes' if info['Ank'] else 'No':>5} {ratio:>8.1f}\")\n\nprint(\"\\n=== Key Observation ===\")\nprint(\"TM/PGG ratio is approximately 3:1 in most proteins\")\nprint(\"  - 2 PGG + 6 TM \u2192 3 TM per PGG domain\")\nprint(\"  - 1 PGG + 6 TM \u2192 6 TM per PGG (but only 1 PGG annotated; may have degenerate second)\")\nprint(\"  - 5 PGG + 16 TM \u2192 3.2 TM per PGG domain\")\nprint(\"\\nThis suggests a fundamental repeat unit of: PGG domain + ~3 TM helices\")\nprint(\"A0A804UIX9 has 2 such units \u2192 2\u00d7(PGG + 3TM) = 6 TM total\")\n\n# Create a topology diagram\nfig, ax = plt.subplots(figsize=(12, 7))\n\n# Draw membrane\nax.axhspan(-0.5, 0.5, color='#FFE0B2', alpha=0.5)\nax.text(7, 0, 'MEMBRANE', ha='center', va='center', fontsize=14, color='orange', fontweight='bold', alpha=0.5)\n\n# TM helices positions (x-coordinates)\ntm_x = [1, 2.5, 4, 6, 7.5, 9]\ntm_labels = ['TM1\\n(54-73)', 'TM2\\n(102-123)', 'TM3\\n(135-154)', 'TM4\\n(166-189)', 'TM5\\n(222-239)', 'TM6\\n(269-290)']\n\n# Draw TM helices\nfor i, (x, label) in enumerate(zip(tm_x, tm_labels)):\n    color = '#FF5722' if i < 3 else '#E91E63'\n    rect = plt.Rectangle((x-0.3, -0.5), 0.6, 1, color=color, alpha=0.8, ec='black', lw=1)\n    ax.add_patch(rect)\n    ax.text(x, -0.8, label, ha='center', va='top', fontsize=7)\n\n# Draw loops (extracellular/luminal)\n# PGG1 loop between TM1 and TM2\nax.annotate('', xy=(2.5, 0.5), xytext=(1, 0.5),\n            arrowprops=dict(arrowstyle='-', color='blue', lw=2, connectionstyle='arc3,rad=0.5'))\nax.text(1.75, 1.7, 'PGG domain 1\\n(LPGG motif)', ha='center', va='center', fontsize=9, \n        color='blue', fontweight='bold',\n        bbox=dict(boxstyle='round,pad=0.3', facecolor='lightblue', alpha=0.7))\n\n# PGG2 loop between TM5 and TM6\nax.annotate('', xy=(9, 0.5), xytext=(7.5, 0.5),\n            arrowprops=dict(arrowstyle='-', color='blue', lw=2, connectionstyle='arc3,rad=0.5'))\nax.text(8.25, 1.7, 'PGG domain 2\\n(PPGG motif)', ha='center', va='center', fontsize=9,\n        color='blue', fontweight='bold',\n        bbox=dict(boxstyle='round,pad=0.3', facecolor='lightblue', alpha=0.7))\n\n# N-terminus (cytoplasmic)\nax.annotate('N-term\\n(disordered,\\ncytoplasmic)', xy=(1, -0.5), xytext=(-0.5, -2),\n            arrowprops=dict(arrowstyle='->', color='gray'), fontsize=8, ha='center',\n            bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.7))\n\n# C-terminus\nax.annotate('C-term\\n(basic, disordered,\\n3 Cys, PPGG motif)', xy=(9, -0.5), xytext=(10.5, -2),\n            arrowprops=dict(arrowstyle='->', color='gray'), fontsize=8, ha='center',\n            bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.7))\n\n# Labels\nax.text(-1, 1.5, 'EXTRACELLULAR\\n/ LUMINAL', ha='center', va='center', fontsize=10, color='green')\nax.text(-1, -1.5, 'CYTOPLASMIC', ha='center', va='center', fontsize=10, color='purple')\n\n# Repeat unit brackets\nax.annotate('', xy=(0.5, -2.8), xytext=(4.5, -2.8),\n            arrowprops=dict(arrowstyle='<->', color='red', lw=2))\nax.text(2.5, -3.1, 'Repeat Unit 1', ha='center', fontsize=9, color='red', fontweight='bold')\n\nax.annotate('', xy=(5.5, -2.8), xytext=(9.5, -2.8),\n            arrowprops=dict(arrowstyle='<->', color='red', lw=2))\nax.text(7.5, -3.1, 'Repeat Unit 2', ha='center', fontsize=9, color='red', fontweight='bold')\n\nax.set_xlim(-2, 12)\nax.set_ylim(-3.5, 3)\nax.set_aspect('equal')\nax.set_title('Proposed Membrane Topology of A0A804UIX9\\n(6-TM, 2\u00d7PGG repeat unit architecture)', fontsize=13, fontweight='bold')\nax.axis('off')\n\nplt.tight_layout()\nplt.savefig('topology_model.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Topology model saved.\")\n"
}