{
  "filename": "plot_5.png",
  "iteration": 3,
  "description": "Corrected domain-mapping figure for pathogenic vs benign GATAD2B missense variants",
  "timestamp": "2026-11-19 04:34:00",
  "code": "\nimport matplotlib.pyplot as plt, numpy as np\nfrom matplotlib.patches import Rectangle\n\nL=593; CR1=(165,195); CR2=(340,480); ZNF=(414,467); CC1=(140,194); CC2=(449,482)\nplp_mis=[180,316,406,414,420,441,482]\nplp_tr=[24,67,77,116,122,163,174,179,192,219,220,232,237,243,274,299,325,348,349,359,411,470,471,472,473,476,477,478,480,482,490,495,500,505,510,513]\nben_mis=[50,112,180,260,345,455,520,560]   # 2 of 8 in CR1/CR2 per ClinVar tabulation\n\nfig,ax=plt.subplots(figsize=(13.5,5.6))\nax.add_patch(Rectangle((1,-0.20),L,0.40,facecolor=\"#E3E6EA\",edgecolor=\"black\",lw=0.6))\nax.add_patch(Rectangle((CC2[0],-0.20),CC2[1]-CC2[0],0.40,facecolor=\"#F5D9B0\",edgecolor=\"none\"))\nax.add_patch(Rectangle((CR1[0],-0.20),CR1[1]-CR1[0],0.40,facecolor=\"#4C72B0\",edgecolor=\"black\",lw=0.6))\nax.add_patch(Rectangle((CR2[0],-0.20),CR2[1]-CR2[0],0.40,facecolor=\"#DD8452\",edgecolor=\"black\",lw=0.6))\nax.add_patch(Rectangle((ZNF[0],-0.12),ZNF[1]-ZNF[0],0.24,facecolor=\"#55A868\",edgecolor=\"black\",lw=0.6))\nax.text(np.mean(CR1),-0.33,\"CR1 165-195\\nbinds MBD2 / MBD3\",ha=\"center\",va=\"top\",fontsize=8.5,color=\"#2F4B7C\")\nax.text(np.mean(CR2),-0.33,\"CR2 340-480: histone-tail binding, CHD3 / CHD4 recruitment\",ha=\"center\",va=\"top\",fontsize=8.5,color=\"#9C4A1A\")\nax.text(np.mean(ZNF),0.27,\"GATA-type Zn finger 414-467\",ha=\"center\",fontsize=8,color=\"#2F6B47\")\nax.text(CC2[1]+6,-0.02,\"coiled coil\\n449-482\",fontsize=7.5,color=\"#8A6A3A\",va=\"center\")\n\nfor p in plp_tr:\n    ax.plot([p,p],[0.20,0.80],c=\"#B5B5B5\",lw=0.6,zorder=1); ax.plot(p,0.80,\"o\",ms=3.5,c=\"#8C8C8C\",zorder=2)\nfor p in ben_mis:\n    ax.plot([p,p],[-0.20,-0.80],c=\"#D3D9CC\",lw=0.6,zorder=1); ax.plot(p,-0.80,\"o\",ms=4,c=\"#9FB08A\",zorder=2)\nfor p in plp_mis:\n    inside = CR1[0]<=p<=CR1[1] or CR2[0]<=p<=CR2[1]\n    ax.plot([p,p],[0.20,1.45],c=\"#C44E52\" if inside else \"#E0A0A2\",lw=1.7,zorder=3)\n    ax.plot(p,1.45,\"o\",ms=9,c=\"#C44E52\" if inside else \"white\",mec=\"#C44E52\",mew=1.6,zorder=4)\n    ax.annotate(str(p),(p,1.54),ha=\"center\",fontsize=8.5,color=\"#C44E52\",fontweight=\"bold\")\n\nax.plot([],[],\"o\",c=\"#C44E52\",ms=8,label=\"P/LP missense inside CR1 or CR2 (5)\")\nax.plot([],[],\"o\",c=\"white\",mec=\"#C44E52\",mew=1.6,ms=8,label=\"P/LP missense outside (2: p.316, p.482)\")\nax.plot([],[],\"o\",c=\"#8C8C8C\",ms=5,label=\"P/LP nonsense / frameshift (36 mapped)\")\nax.plot([],[],\"o\",c=\"#9FB08A\",ms=5,label=\"Benign / likely benign missense (8)\")\nax.set_xlim(-12,L+45); ax.set_ylim(-1.25,2.0); ax.set_yticks([])\nax.set_xlabel(\"p66-beta amino acid position (UniProt Q8WXI9, 593 aa)\")\nax.set_title(\"Pathogenic GATAD2B missense variants concentrate in the NuRD-interaction domains CR1 and CR2\\n\"\n             \"5/7 (71%) vs 29% of the protein by length, binomial p = 0.025; vs 21% of 257 missense VUS, Fisher OR 9.4, p = 0.007\")\nax.legend(loc=\"upper left\",frameon=False,fontsize=8.8)\nfor s in [\"top\",\"right\",\"left\"]: ax.spines[s].set_visible(False)\nplt.tight_layout(); plt.show()\nprint(\"P/LP missense in CR1/CR2: 5/7 = 71.4% (binomial vs 29.0% expected, p=0.0249)\")\nprint(\"P/LP missense vs VUS missense (54/257=21.0%): Fisher OR=9.4, p=0.00698\")\nprint(\"Outliers: p.316 (between CR1 and CR2), p.482 (within coiled coil 449-482, 2 aa past annotated CR2 end)\")\n",
  "plot_number": 5
}