{
  "filename": "plot_4.png",
  "iteration": 3,
  "description": "Create final comprehensive 6-panel summary figure for DCAF12L2 CRL4 substrate receptor evaluation",
  "timestamp": "2026-07-06 20:56:06",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig = plt.figure(figsize=(18, 12))\nfig.suptitle('DCAF12L2 CRL4 Substrate Receptor Prediction: Comprehensive Evidence',\n             fontsize=14, fontweight='bold', y=0.98)\n\n# Layout: 2x3 grid\ngs = fig.add_gridspec(2, 3, hspace=0.35, wspace=0.35)\n\n# Panel A: Three-way comparison bar chart\nax = fig.add_subplot(gs[0, 0])\nproteins = ['DCAF12L1\\n(Q5VU92)', 'DCAF12L2\\n(Q5VW00)']\nddb1_ident = [50, 56]\nddb1_cons = [53, 58]\ndegron_ident = [91, 100]\noverall = [62.5, 66.6]\n\nx = np.arange(len(proteins))\nwidth = 0.2\n\nb1 = ax.bar(x - width*1.5, overall, width, label='Overall identity', color='#95a5a6')\nb2 = ax.bar(x - width*0.5, ddb1_cons, width, label='DDB1 interface (conserved)', color='#e74c3c')\nb3 = ax.bar(x + width*0.5, degron_ident, width, label='Degron pocket (identical)', color='#2ecc71')\n\nfor i in range(len(proteins)):\n    ax.text(i - width*1.5, overall[i] + 1, f'{overall[i]:.0f}%', ha='center', fontsize=7)\n    ax.text(i - width*0.5, ddb1_cons[i] + 1, f'{ddb1_cons[i]}%', ha='center', fontsize=7)\n    ax.text(i + width*0.5, degron_ident[i] + 1, f'{degron_ident[i]}%', ha='center', fontsize=7, fontweight='bold')\n\nax.set_ylabel('Conservation vs DCAF12 (%)')\nax.set_title('A. Selective Conservation Pattern', fontsize=10, fontweight='bold')\nax.set_xticks(x)\nax.set_xticklabels(proteins, fontsize=8)\nax.legend(fontsize=7, loc='upper left')\nax.set_ylim(0, 115)\nax.axhline(y=100, color='green', linestyle='--', alpha=0.3)\n\n# Panel B: DDB1 interface shared changes\nax = fig.add_subplot(gs[0, 1])\nax.axis('off')\n\nshared_changes = \"\"\"Shared H-box substitutions\n(ancestral retrogene changes):\n\n DCAF12  \u2192 L1/L2  Effect\n Y48     \u2192 H      Aromatic loss\n L57     \u2192 P      Helix-breaker!\n E60     \u2192 L      Charge removal\n T61     \u2192 Q      Polar change\n V66     \u2192 E      Hydrophobic\u2192charged\n H68     \u2192 R      Imidazole\u2192guanidinium\n Q74     \u2192 R      Amide\u2192charged\n K80     \u2192 T      Charge removal\n S428    \u2192 W      Ser\u2192Trp (large)\n S429    \u2192 P      Ser\u2192Pro\n T431    \u2192 M      Thr\u2192Met\n\nThese changes occurred BEFORE the\nL1/L2 split, indicating systematic\ndivergence from DDB1 binding.\"\"\"\n\nax.text(0.05, 0.95, shared_changes, transform=ax.transAxes, fontsize=8,\n        verticalalignment='top', fontfamily='monospace',\n        bbox=dict(boxstyle='round', facecolor='#fadbd8', alpha=0.9))\nax.set_title('B. Ancestral H-box Changes', fontsize=10, fontweight='bold')\n\n# Panel C: Evidence flow diagram (text-based)\nax = fig.add_subplot(gs[0, 2])\nax.axis('off')\n\nevidence_text = \"\"\"EVIDENCE FLOW\n\nWD40 \u03b2-propeller fold\n  \u2713 7 WD40 repeats (Pfam, InterPro)\n  \u2713 AlphaFold pLDDT 86.7\n\nDegron-binding pocket\n  \u2713 23/23 residues IDENTICAL\n  \u2713 Both MAGEA3 & CCT5 contacts\n  \u2192 Substrate recognition: INTACT\n\nYDIR motif (allosteric)\n  \u2713 Perfectly conserved\n  \u26a0 NOT at direct DDB1 contact\n\nDDB1-binding H-box helix\n  \u26a0 58% conserved (below global 67%)\n  \u26a0 Shared ancestral L57P change\n  \u2717 DDB1 never co-purified (0/43)\n  \u2192 DDB1 binding: UNCERTAIN\n\nCRL4 scaffold association\n  \u2713 CUL4A (TAP, PMID 21145461)\n  \u2713 CUL4B (co-IP, PMID 28514442)\n  \u2192 Complex membership: PARTIAL\"\"\"\n\nax.text(0.05, 0.95, evidence_text, transform=ax.transAxes, fontsize=7.5,\n        verticalalignment='top', fontfamily='monospace',\n        bbox=dict(boxstyle='round', facecolor='#eaf2f8', alpha=0.9))\nax.set_title('C. Evidence Summary', fontsize=10, fontweight='bold')\n\n# Panel D: Interaction network\nax = fig.add_subplot(gs[1, 0])\n\n# Simple network diagram showing key interactions\n# Central node: DCAF12L2\ntheta = np.linspace(0, 2*np.pi, 9, endpoint=False)\nr_inner = 0.2\nr_outer = 0.8\n\n# Center\nax.scatter([0.5], [0.5], s=800, c='#3498db', zorder=5, edgecolors='navy', linewidth=2)\nax.text(0.5, 0.5, 'DCAF12L2', ha='center', va='center', fontsize=7, fontweight='bold', color='white')\n\n# Interaction partners in a circle\npartners = [\n    ('CUL4A', '#e74c3c', 0.7),  # CRL4\n    ('CUL4B', '#e74c3c', 0.7),\n    ('CCT3/5', '#2ecc71', 0.6),\n    ('PFDN\\n1-6', '#2ecc71', 0.5),\n    ('MAGEA6', '#f39c12', 0.6),\n    ('DCAF12L1', '#9b59b6', 0.8),\n    ('LONP1', '#95a5a6', 0.5),\n    ('DDB1', '#bdc3c7', 0.0),  # NOT detected\n]\n\nfor i, (name, color, conf) in enumerate(partners):\n    angle = theta[i]\n    x_pos = 0.5 + r_outer * np.cos(angle)\n    y_pos = 0.5 + r_outer * np.sin(angle)\n    \n    if name == 'DDB1':\n        # DDB1 - not detected, draw with dashed line\n        ax.scatter([x_pos], [y_pos], s=400, c='white', edgecolors='red', \n                  linewidth=2, linestyle='--', zorder=4)\n        ax.plot([0.5, x_pos], [0.5, y_pos], 'r--', alpha=0.3, linewidth=1)\n        ax.text(x_pos, y_pos, name, ha='center', va='center', fontsize=6, color='red')\n        ax.text(x_pos, y_pos - 0.08, '(NOT detected)', ha='center', fontsize=5, color='red')\n    else:\n        ax.scatter([x_pos], [y_pos], s=300, c=color, zorder=4, alpha=0.8)\n        ax.plot([0.5, x_pos], [0.5, y_pos], color=color, alpha=conf, linewidth=1.5)\n        ax.text(x_pos, y_pos, name, ha='center', va='center', fontsize=6, \n               fontweight='bold', color='white')\n\nax.set_xlim(-0.4, 1.4)\nax.set_ylim(-0.4, 1.4)\nax.set_aspect('equal')\nax.axis('off')\nax.set_title('D. Interaction Network', fontsize=10, fontweight='bold')\n\n# Legend for network\nlegend_patches = [\n    mpatches.Patch(color='#e74c3c', label='CRL4 scaffold'),\n    mpatches.Patch(color='#2ecc71', label='Chaperonin/prefoldin'),\n    mpatches.Patch(color='#f39c12', label='DCAF12 substrate'),\n    mpatches.Patch(color='#9b59b6', label='Paralog'),\n]\nax.legend(handles=legend_patches, fontsize=6, loc='lower left')\n\n# Panel E: GO Decision Table\nax = fig.add_subplot(gs[1, 1])\nax.axis('off')\n\ngo_data = [\n    ['GO Term', 'Status', 'Evidence', 'Action'],\n    ['GO:0080008\\nCRL4 complex (CC)', 'Existing\\n(IBA)', 'CUL4A/B co-purif.\\nDDB1 absent', 'Retain IBA\\n(appropriate)'],\n    ['GO:0043161\\nProteasome degr. (BP)', 'Not\\nannotated', 'No direct evidence\\nDegron pocket intact', 'Do NOT add\\n(premature)'],\n    ['GO:1990756\\nSubstrate adaptor (MF)', 'Not\\nannotated', 'Degron pocket 100%\\nNo activity data', 'Monitor\\n(promising)'],\n    ['GO:0140627\\nC-end degron (BP)', 'Not\\nannotated', 'Pocket conserved\\nNo assay data', 'Monitor\\n(if confirmed)'],\n]\n\ntable = ax.table(cellText=go_data[1:], colLabels=go_data[0], loc='center', cellLoc='center')\ntable.auto_set_font_size(False)\ntable.set_fontsize(7)\ntable.scale(1, 2.0)\n\n# Color header\nfor j in range(4):\n    table[(0, j)].set_facecolor('#2c3e50')\n    table[(0, j)].set_text_props(color='white', fontweight='bold')\n# Color action cells\ncolors_action = ['#d5f5e3', '#fadbd8', '#fdebd0', '#fdebd0']\nfor i in range(4):\n    table[(i+1, 3)].set_facecolor(colors_action[i])\n\nax.set_title('E. GO Curation Decision Table', fontsize=10, fontweight='bold', pad=20)\n\n# Panel F: Three alternative models\nax = fig.add_subplot(gs[1, 2])\nax.axis('off')\n\nmodels_text = \"\"\"THREE COMPETING MODELS\n\nModel 1: Functional CRL4 receptor\n  H-box changes are tolerated\n  DDB1 binding weak but sufficient\n  \u2192 GO:0043161 would apply\n  Probability: LOW-MODERATE\n\nModel 2: Substrate-only protein\n  Recognizes degrons (pocket intact)\n  Cannot assemble CRL4 (DDB1 lost)\n  May compete with DCAF12\n  \u2192 GO:0043161 would NOT apply\n  Probability: MODERATE\n\nModel 3: Tissue-specific variant\n  Functions in testis/epididymis\n  Tissue cofactors compensate\n  H-box tolerated in context\n  \u2192 Context-specific GO:0043161\n  Probability: MODERATE\n\nVERDICT: Partially supported\nMost informative test: DDB1\nbinding assay for DCAF12L2\"\"\"\n\nax.text(0.05, 0.95, models_text, transform=ax.transAxes, fontsize=7.5,\n        verticalalignment='top', fontfamily='monospace',\n        bbox=dict(boxstyle='round', facecolor='lightyellow', alpha=0.9))\nax.set_title('F. Competing Models', fontsize=10, fontweight='bold')\n\nplt.savefig('dcaf12l2_final_summary.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Final comprehensive figure saved\")\n",
  "plot_number": 4
}