{
  "filename": "dcaf12l2_analysis.png",
  "iteration": 1,
  "description": "Create comprehensive 4-panel figure summarizing DCAF12L2 structural and interaction evidence",
  "timestamp": "2026-07-06 20:31:31",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(2, 2, figsize=(16, 14))\nfig.suptitle('DCAF12L2 as CRL4 Substrate Receptor: Computational Evidence', fontsize=14, fontweight='bold')\n\n# Panel A: pLDDT profile\nax = axes[0, 0]\n# Re-extract pLDDT data\nimport requests\npdb_url = \"https://alphafold.ebi.ac.uk/files/AF-Q5VW00-F1-model_v6.pdb\"\nresp = requests.get(pdb_url)\npdb_content = resp.text\n\nplddt = {}\nfor line in pdb_content.split('\\n'):\n    if line.startswith('ATOM') and line[12:16].strip() == 'CA':\n        resnum = int(line[22:26].strip())\n        bfactor = float(line[60:66].strip())\n        plddt[resnum] = bfactor\n\nresidues = sorted(plddt.keys())\nplddt_vals = [plddt[r] for r in residues]\n\nax.plot(residues, plddt_vals, color='steelblue', linewidth=0.8)\nax.axhline(y=90, color='green', linestyle='--', alpha=0.5, label='Very high (>90)')\nax.axhline(y=70, color='orange', linestyle='--', alpha=0.5, label='High (>70)')\nax.axhline(y=50, color='red', linestyle='--', alpha=0.5, label='Low (<50)')\n\n# Shade WD40 repeats\nwd_repeats = [(89, 137), (138, 184), (185, 252), (253, 297), (298, 341), (342, 401), (402, 445)]\nfor i, (s, e) in enumerate(wd_repeats):\n    ax.axvspan(s, e, alpha=0.15, color='green' if i % 2 == 0 else 'lightgreen')\n\n# Mark YDIR motif\nax.axvspan(375, 378, alpha=0.4, color='red', label='YDIR motif (375-378)')\nax.set_xlabel('Residue number')\nax.set_ylabel('pLDDT')\nax.set_title('A. AlphaFold Confidence (DCAF12L2)')\nax.legend(fontsize=7, loc='lower left')\nax.set_ylim(0, 105)\nax.annotate('Disordered\\nN-terminus', xy=(25, 30), fontsize=8, ha='center',\n           arrowprops=dict(arrowstyle='->', color='gray'), xytext=(60, 15))\nax.annotate('WD40 \u03b2-propeller\\ndomain', xy=(270, 95), fontsize=8, ha='center')\n\n# Panel B: Sequence alignment conservation at DDB1-binding region\nax = axes[0, 1]\n# Show the key alignment region\ndcaf12_seq  = \"GSGIRSVSFYEHIITVGTGQGSLLFYDIRAQRFLEERLSACYGSKPRLAG\"\ndcaf12l2_seq= \"GTGVRSLSFYQHIITVGTGHGSLLFYDIRAQKFLEERASSSLDSMPGPAG\"\n\n# Calculate per-position identity\nidentity = []\nfor a, b in zip(dcaf12_seq, dcaf12l2_seq):\n    if a == b:\n        identity.append(1.0)\n    elif (a in 'RK' and b in 'RK') or (a in 'DE' and b in 'DE') or \\\n         (a in 'ST' and b in 'ST') or (a in 'NQ' and b in 'NQ') or \\\n         (a in 'FYW' and b in 'FYW') or (a in 'ILVM' and b in 'ILVM'):\n        identity.append(0.5)\n    else:\n        identity.append(0.0)\n\ncolors = ['#2ecc71' if v == 1.0 else '#f39c12' if v == 0.5 else '#e74c3c' for v in identity]\npositions = np.arange(len(identity))\nax.bar(positions, identity, color=colors, width=0.8)\n\n# Mark YDIR region\nydir_start = dcaf12_seq.index('YDIR')\nfor i in range(ydir_start, ydir_start + 4):\n    ax.bar(i, identity[i], color='navy', width=0.8)\n\nax.set_xticks(positions[::5])\nax.set_xticklabels([f'{dcaf12_seq[i]}/{dcaf12l2_seq[i]}' for i in range(0, len(dcaf12_seq), 5)], fontsize=7)\nax.set_ylabel('Conservation')\nax.set_title('B. Conservation at DDB1-Binding Region')\nax.set_yticks([0, 0.5, 1.0])\nax.set_yticklabels(['Different', 'Similar', 'Identical'], fontsize=8)\n\nlegend_patches = [\n    mpatches.Patch(color='#2ecc71', label='Identical'),\n    mpatches.Patch(color='#f39c12', label='Conservative'),\n    mpatches.Patch(color='#e74c3c', label='Non-conservative'),\n    mpatches.Patch(color='navy', label='YDIR motif')\n]\nax.legend(handles=legend_patches, fontsize=7, loc='upper left')\n\n# Panel C: Interaction network comparison\nax = axes[1, 0]\n# Show key interactors for DCAF12 vs DCAF12L2\ncategories = {\n    'CRL4 scaffold': {'genes': ['CUL4A', 'CUL4B', 'DDB1'], \n                       'dcaf12': [True, True, True], \n                       'dcaf12l2': [True, True, False]},\n    'TRiC/CCT': {'genes': ['CCT2', 'CCT3', 'CCT5', 'CCT7', 'CCT8'],\n                  'dcaf12': [True, True, True, True, True],\n                  'dcaf12l2': [True, True, True, True, True]},\n    'Prefoldin': {'genes': ['PFDN1', 'PFDN2', 'PFDN4', 'PFDN5', 'PFDN6', 'VBP1'],\n                   'dcaf12': [True, True, True, True, True, True],\n                   'dcaf12l2': [True, True, True, True, True, True]},\n    'Substrates': {'genes': ['MAGEA6', 'MOV10'],\n                    'dcaf12': [True, True],\n                    'dcaf12l2': [True, False]},\n}\n\ny_pos = 0\nyticks = []\nylabels = []\nfor cat, info in categories.items():\n    ax.axhline(y=y_pos - 0.5, color='gray', linewidth=0.5, linestyle='-')\n    for i, gene in enumerate(info['genes']):\n        d12 = info['dcaf12'][i]\n        d12l2 = info['dcaf12l2'][i]\n        \n        if d12 and d12l2:\n            ax.barh(y_pos, 2, left=0, color='#2ecc71', height=0.6)\n            ax.text(1, y_pos, 'Both', ha='center', va='center', fontsize=7, fontweight='bold')\n        elif d12 and not d12l2:\n            ax.barh(y_pos, 1, left=0, color='#3498db', height=0.6)\n            ax.text(0.5, y_pos, 'DCAF12\\nonly', ha='center', va='center', fontsize=6)\n        elif d12l2 and not d12:\n            ax.barh(y_pos, 1, left=1, color='#e67e22', height=0.6)\n            ax.text(1.5, y_pos, 'L2 only', ha='center', va='center', fontsize=6)\n        \n        yticks.append(y_pos)\n        ylabels.append(f'{gene}')\n        y_pos += 1\n    \n    # Category label\n    mid = y_pos - len(info['genes'])/2\n    ax.text(-0.5, mid - 0.5, cat, ha='right', va='center', fontsize=8, fontweight='bold', fontstyle='italic')\n\nax.set_yticks(yticks)\nax.set_yticklabels(ylabels, fontsize=7)\nax.set_xlim(-0.1, 2.5)\nax.set_xlabel('Detected in interaction studies')\nax.set_title('C. Shared Interactors: DCAF12 vs DCAF12L2')\nax.invert_yaxis()\n\nlegend_patches2 = [\n    mpatches.Patch(color='#2ecc71', label='Both proteins'),\n    mpatches.Patch(color='#3498db', label='DCAF12 only'),\n]\nax.legend(handles=legend_patches2, fontsize=7, loc='lower right')\n\n# Panel D: Evidence summary table\nax = axes[1, 1]\nax.axis('off')\nevidence_data = [\n    ['Feature', 'DCAF12', 'DCAF12L2', 'Status'],\n    ['WD40 repeats', '6 repeats', '7 repeats', '\u2713 Present'],\n    ['\u03b2-propeller fold', 'Crystal structure', 'AlphaFold (pLDDT 86.7)', '\u2713 Predicted'],\n    ['WDxR motif', 'YDIR (non-canonical)', 'YDIR (conserved)', '\u2713 Conserved'],\n    ['DDB1 binding', 'IDA (2 expts)', 'Not detected', '? Unknown'],\n    ['CUL4 binding', 'IDA', 'Co-IP/TAP', '\u2713 Detected'],\n    ['Ub ligase activity', 'IDA', 'No data', '? Unknown'],\n    ['CCT interaction', 'IDA', 'Co-IP', '\u2713 Detected'],\n    ['Degron recognition', 'C-end di-Glu', 'No data', '? Unknown'],\n    ['Expression', 'Broad', 'Testis-enhanced', '\u26a0 Restricted'],\n    ['Seq identity', '\u2014', '66.6% to DCAF12', 'High'],\n]\n\ntable = ax.table(cellText=evidence_data[1:], colLabels=evidence_data[0],\n                 loc='center', cellLoc='center')\ntable.auto_set_font_size(False)\ntable.set_fontsize(7.5)\ntable.scale(1, 1.4)\n\n# Color cells\nfor i in range(len(evidence_data) - 1):\n    status = evidence_data[i + 1][3]\n    if '\u2713' in status:\n        table[(i + 1, 3)].set_facecolor('#d5f5e3')\n    elif '?' in status:\n        table[(i + 1, 3)].set_facecolor('#fdebd0')\n    elif '\u26a0' in status:\n        table[(i + 1, 3)].set_facecolor('#fadbd8')\n\nfor i in range(len(evidence_data[0])):\n    table[(0, i)].set_facecolor('#2c3e50')\n    table[(0, i)].set_text_props(color='white', fontweight='bold')\n\nax.set_title('D. Evidence Summary', fontsize=11, fontweight='bold', pad=20)\n\nplt.tight_layout()\nplt.savefig('dcaf12l2_analysis.png', dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved as dcaf12l2_analysis.png\")\n"
}