{
  "filename": "scu_hsd17b10_comparison.png",
  "iteration": 1,
  "description": "Domain architecture and catalytic residue conservation comparison between scully and HSD17B10",
  "timestamp": "2026-07-01 09:04:32",
  "code": "\nimport matplotlib.pyplot as plt\nimport matplotlib.patches as mpatches\nimport numpy as np\n\nfig, axes = plt.subplots(3, 1, figsize=(16, 12))\n\n# ---- Panel 1: Domain architecture comparison ----\nax = axes[0]\nax.set_title(\"Domain Architecture: SCU (O18404) vs HSD17B10 (Q99714)\", fontsize=14, fontweight='bold')\n\n# SCU\nscu_len = 255\nhsd_len = 261\n\n# Draw protein bars\nax.barh(1.5, scu_len, height=0.6, color='lightblue', edgecolor='black', label='SCU (Drosophila)')\nax.barh(0.5, hsd_len, height=0.6, color='lightyellow', edgecolor='black', label='HSD17B10 (Human)')\n\n# Rossmann motif\nax.barh(1.5, 8, left=9, height=0.6, color='green', alpha=0.7)\nax.barh(0.5, 8, left=15, height=0.6, color='green', alpha=0.7)\n\n# SDR domain (PF00106) - approximate\nax.barh(1.5, 200, left=10, height=0.3, color='orange', alpha=0.5)\nax.barh(0.5, 200, left=16, height=0.3, color='orange', alpha=0.5)\n\n# Active site marks\n# SCU: S149, Y162, K166\nfor pos, label, color in [(149, 'S149', 'blue'), (162, 'Y162', 'red'), (166, 'K166', 'purple')]:\n    ax.plot(pos, 1.5, 'v', color=color, markersize=12, zorder=5)\n    ax.annotate(label, (pos, 1.85), ha='center', fontsize=8, color=color, fontweight='bold')\n\n# HSD: S155, Y168, K172\nfor pos, label, color in [(155, 'S155', 'blue'), (168, 'Y168', 'red'), (172, 'K172', 'purple')]:\n    ax.plot(pos, 0.5, 'v', color=color, markersize=12, zorder=5)\n    ax.annotate(label, (pos, 0.85), ha='center', fontsize=8, color=color, fontweight='bold')\n\nax.set_xlim(0, 280)\nax.set_ylim(-0.2, 2.5)\nax.set_yticks([0.5, 1.5])\nax.set_yticklabels(['HSD17B10\\n(Q99714, 261 aa)', 'SCU\\n(O18404, 255 aa)'])\nax.set_xlabel('Residue position')\n\n# Legend\nlegend_elements = [\n    mpatches.Patch(color='green', alpha=0.7, label='Rossmann motif (TGGASGLG)'),\n    mpatches.Patch(color='orange', alpha=0.5, label='SDR domain (PF00106)'),\n    plt.Line2D([0], [0], marker='v', color='blue', label='Catalytic Ser', markersize=10, linestyle=''),\n    plt.Line2D([0], [0], marker='v', color='red', label='Active site Tyr', markersize=10, linestyle=''),\n    plt.Line2D([0], [0], marker='v', color='purple', label='Catalytic Lys', markersize=10, linestyle=''),\n]\nax.legend(handles=legend_elements, loc='upper right', fontsize=9)\n\n# ---- Panel 2: Binding site conservation ----\nax2 = axes[1]\nax2.set_title(\"Binding Site Conservation (11/11 identical)\", fontsize=14, fontweight='bold')\n\nscu_binding = [14, 16, 35, 58, 59, 85, 149, 162, 166, 195, 197]\nhsd_binding = [20, 22, 41, 64, 65, 91, 155, 168, 172, 201, 203]\nresidues = ['S', 'L', 'D', 'D', 'V', 'C', 'S', 'Y', 'K', 'F', 'T']\ncategories = ['NAD', 'NAD', 'NAD', 'NAD', 'NAD', 'NAD', 'Cat', 'Cat', 'Cat', 'Sub', 'Sub']\n\ncolors = {'NAD': '#2196F3', 'Cat': '#F44336', 'Sub': '#4CAF50'}\nbar_colors = [colors[c] for c in categories]\n\nx = np.arange(len(residues))\nbars = ax2.bar(x, [1]*len(residues), color=bar_colors, edgecolor='black', alpha=0.8)\n\nfor i, (spos, hpos, res) in enumerate(zip(scu_binding, hsd_binding, residues)):\n    ax2.text(i, 0.5, f\"{res}\", ha='center', va='center', fontsize=14, fontweight='bold', color='white')\n    ax2.text(i, 1.08, f\"SCU:{spos}\\nHSD:{hpos}\", ha='center', va='bottom', fontsize=7)\n\nax2.set_xticks(x)\nax2.set_xticklabels([f\"{r}{s}\" for r, s in zip(residues, scu_binding)], fontsize=9)\nax2.set_ylabel(\"Conservation\")\nax2.set_ylim(0, 1.5)\nax2.set_yticks([0, 0.5, 1.0])\nax2.set_yticklabels(['0%', '50%', '100%'])\n\nlegend2 = [\n    mpatches.Patch(color='#2196F3', label='NAD-binding'),\n    mpatches.Patch(color='#F44336', label='Catalytic triad'),\n    mpatches.Patch(color='#4CAF50', label='Substrate-binding'),\n]\nax2.legend(handles=legend2, loc='upper right')\n\n# ---- Panel 3: Key motif alignments ----\nax3 = axes[2]\nax3.set_title(\"Key Conserved Motifs\", fontsize=14, fontweight='bold')\nax3.axis('off')\n\nmotifs = [\n    (\"Rossmann (NAD-binding)\", \"SCU 10: TGGASGLG\\nHSD 16: TGGASGLG\", \"100% identical\"),\n    (\"Cofactor-binding\", \"SCU 84: NCAG\\nHSD 90: NCAG\", \"100% identical\"),\n    (\"Active site (YxxxK)\", \"SCU 162: YSASK\\nHSD 168: YSASK\", \"100% identical\"),\n    (\"SDR catalytic triad\", \"SCU: S149-Y162-K166\\nHSD: S155-Y168-K172\", \"All 3 conserved\"),\n]\n\nfor i, (name, alignment, conservation) in enumerate(motifs):\n    y = 0.85 - i * 0.22\n    ax3.text(0.05, y, name, fontsize=12, fontweight='bold', va='top',\n             transform=ax3.transAxes)\n    ax3.text(0.35, y, alignment, fontsize=10, family='monospace', va='top',\n             transform=ax3.transAxes)\n    ax3.text(0.75, y, conservation, fontsize=11, va='top', color='green', fontweight='bold',\n             transform=ax3.transAxes)\n\n# Summary box\nsummary_text = (\n    \"Sequence identity: 73.1% | Similarity: 83.1%\\n\"\n    \"Binding sites: 11/11 conserved (100%)\\n\"\n    \"Both: SDR family (PF00106) | EC 1.1.1.35 | Mitochondrial matrix | RNase P component\"\n)\nprops = dict(boxstyle='round', facecolor='lightgreen', alpha=0.3)\nax3.text(0.5, 0.05, summary_text, fontsize=11, ha='center', va='bottom',\n         transform=ax3.transAxes, bbox=props)\n\nplt.tight_layout()\nplt.savefig(\"scu_hsd17b10_comparison.png\", dpi=150, bbox_inches='tight')\nplt.show()\nprint(\"Figure saved.\")\n"
}