{
  "filename": "lss_variant_spectrum.png",
  "iteration": 4,
  "description": "Summarize reported LSS variant spectrum and plot by variant type and associated phenotype for the HYPT14 knowledge-base entry",
  "timestamp": "2026-10-30 16:02:49",
  "code": "\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\n# Curated from primary literature reviewed (PMIDs noted). cDNA/protein as reported.\nvariants = [\n    # protein, type, phenotype_category, pmid\n    (\"p.Ile342Ser\",\"missense\",\"cataract+hypotrichosis/PPKCA\",\"37947113/37455568/35413293/41442087\"),\n    (\"p.Gly99Asp\",\"missense\",\"cataract+hypotrichosis\",\"37947113\"),\n    (\"p.Thr228Ile\",\"missense\",\"mutilating PPK\",\"36811447\"),\n    (\"p.Arg260His\",\"missense\",\"mutilating PPK\",\"36811447\"),\n    (\"p.Asp170Asn\",\"missense\",\"hypotrichosis+pseudoainhum\",\"40237410\"),\n    (\"p.Ile323Thr\",\"missense\",\"non-syndromic hypotrichosis\",\"37029088\"),\n    (\"p.Gly600Val\",\"missense\",\"non-syndromic hypotrichosis\",\"37029088\"),\n    (\"p.Ser339Leu\",\"missense\",\"APMR4 (ID/cataract)\",\"37659595\"),\n    (\"p.Gly508Arg\",\"missense\",\"APMR4 (ID/cataract)\",\"37659595\"),\n    (\"p.Gly508Trp\",\"missense\",\"PPKCA2\",\"35413293\"),\n    (\"p.Val537Leu\",\"missense\",\"APMR4\",\"36251212\"),\n    (\"p.Arg129Gln\",\"missense\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Arg129Trp\",\"missense\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Gly352Arg\",\"missense\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Glu532Gln\",\"missense\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Arg435Cys\",\"missense\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Arg663Trp\",\"missense\",\"hypotrichosis 14\",\"40696433\"),\n    (\"p.Trp581Arg\",\"missense\",\"congenital cataract\",\"26200341\"),\n    (\"p.Gly588Ser\",\"missense\",\"congenital cataract\",\"26200341\"),\n    (\"p.Thr446Tyrfs*10\",\"frameshift\",\"hypotrichosis simplex\",\"41442087\"),\n    (\"p.Pro68Argfs*14\",\"frameshift\",\"hypotrichosis 14\",\"40696433\"),\n    (\"p.Leu511Phefs*17\",\"frameshift\",\"cataract+hypotrichosis\",\"37455568\"),\n    (\"p.Arg328*\",\"nonsense\",\"hypotrichosis 14\",\"40696433\"),\n    (\"p.His307del\",\"inframe_del\",\"hypotrichosis 14\",\"40696433\"),\n    (\"p.Glu469del\",\"inframe_del\",\"hypotrichosis 14\",\"40696433\"),\n    (\"p.Met1?\",\"start_loss\",\"PPKCA2\",\"35413293\"),\n    (\"c.428+42T>A\",\"splice\",\"PPKCA2\",\"35413293\"),\n    (\"c.893-175G>A\",\"deep_intronic_splice\",\"hypotrichosis simplex\",\"41442087\"),\n]\ndf = pd.DataFrame(variants, columns=[\"variant\",\"type\",\"phenotype\",\"pmid\"])\nprint(\"Total curated reported LSS alleles:\", len(df))\nprint(df[\"type\"].value_counts())\n\nfig, ax = plt.subplots(1,2, figsize=(13,5))\nvc = df[\"type\"].value_counts()\nax[0].bar(vc.index, vc.values, color=\"steelblue\")\nax[0].set_title(\"Reported LSS variant types (curated, n=%d)\"%len(df))\nax[0].set_ylabel(\"count\"); ax[0].tick_params(axis='x', rotation=40)\nfor i,v in enumerate(vc.values): ax[0].text(i, v+0.1, str(v), ha='center')\n\n# simplify phenotype categories\ndef cat(p):\n    p=p.lower()\n    if \"cataract\" in p and \"hypotrichosis\" in p: return \"cataract+hair\"\n    if \"cataract\" in p: return \"cataract\"\n    if \"apmr\" in p: return \"APMR4 (ID)\"\n    if \"ppk\" in p or \"pseudoainhum\" in p: return \"PPK/keratoderma\"\n    return \"isolated hypotrichosis\"\ndf[\"pcat\"]=df[\"phenotype\"].map(cat)\npc=df[\"pcat\"].value_counts()\nax[1].barh(pc.index, pc.values, color=\"indianred\")\nax[1].set_title(\"Associated phenotype category\")\nax[1].set_xlabel(\"count of alleles\")\nfor i,v in enumerate(pc.values): ax[1].text(v+0.1, i, str(v), va='center')\nplt.tight_layout(); plt.savefig(\"lss_variant_spectrum.png\", dpi=130)\nprint(\"\\nMissense fraction: %.0f%%\" % (100*(df['type']=='missense').mean()))\nprint(\"Figure saved: lss_variant_spectrum.png\")\n"
}