{
  "filename": "plot_4.png",
  "iteration": 3,
  "description": "Mouse conditional knockout phenotype atlas for Atp6ap2 alongside human tissue expression",
  "timestamp": "2026-11-26 22:34:53",
  "code": "\nimport pandas as pd, numpy as np, matplotlib.pyplot as plt\n\n# ---------------------------------------------------------------\n# Panel A: mouse Atp6ap2 conditional knockouts, organ-level outcome\n# Source: MGI allele records + primary papers (PMIDs in labels)\n# ---------------------------------------------------------------\ncko = pd.DataFrame([\n    (\"Cardiomyocyte\",      \"Myh6-Cre\",     \"Lethal heart failure ~3 wk\",            20570919, \"lethal\"),\n    (\"Podocyte\",           \"NPHS2-Cre\",    \"Nephrotic syndrome, death <4 wk\",       22034640, \"lethal\"),\n    (\"Nephron progenitor\", \"Six2-Cre\",     \"Reduced nephron number\",                26658320, \"severe\"),\n    (\"Ureteric bud\",       \"Hoxb7-Cre\",    \"Renal hypodysplasia\",                   23704941, \"severe\"),\n    (\"Renal tubule\",       \"Mx1-Cre\",      \"Distal renal tubular acidosis\",         27044666, \"severe\"),\n    (\"Forebrain neuron\",   \"Camk2a-Cre\",   \"Synapse loss, neurodegeneration\",       26376863, \"severe\"),\n    (\"Photoreceptor\",      \"Crx-Cre\",      \"Retinal disorganisation\",               24305829, \"severe\"),\n    (\"Hepatocyte\",         \"dox-inducible\",\"Endocytic/autophagic vacuoles\",         28129027, \"cellular\"),\n    (\"Pancreatic beta\",    \"Ins-Cre\",      \"Multigranular vacuoles, glucose defect\",31527264, \"cellular\"),\n    (\"T cell\",             \"Cd4-Cre\",      \"Blocked T-cell development\",            26063165, \"severe\"),\n    (\"Osteoclast\",         \"LysM-Cre\",     \"Trabecular bone loss\",                  39400061, \"cellular\"),\n    (\"Smooth muscle\",      \"SM-Cre\",       \"Aortic sclerosis, autophagic death\",    24830537, \"cellular\"),\n    (\"Whole body (adult)\", \"CAG-CreER\",    \"Rapid lethality, marrow hypoplasia\",    28851918, \"lethal\"),\n], columns=[\"tissue\",\"cre\",\"phenotype\",\"pmid\",\"severity\"])\n\ncol = {\"lethal\":\"#b2182b\", \"severe\":\"#ef8a62\", \"cellular\":\"#67a9cf\"}\norder = {\"lethal\":0, \"severe\":1, \"cellular\":2}\ncko = cko.sort_values([\"severity\",\"tissue\"], key=lambda s: s.map(order) if s.name==\"severity\" else s)\n\nfig, (axA, axB) = plt.subplots(1, 2, figsize=(16.5, 7.2),\n                               gridspec_kw={\"width_ratios\":[1.35, 1]})\ny = np.arange(len(cko))[::-1]\naxA.barh(y, [1]*len(cko), color=[col[s] for s in cko.severity], height=0.72)\nfor yi, (_, r) in zip(y, cko.iterrows()):\n    axA.text(0.02, yi, f\"{r.tissue}  ({r.cre})\", va=\"center\", ha=\"left\",\n             fontsize=9.5, color=\"white\", fontweight=\"bold\")\n    axA.text(1.03, yi, f\"{r.phenotype}   PMID {r.pmid}\", va=\"center\", ha=\"left\", fontsize=9)\naxA.set_xlim(0, 3.05); axA.set_ylim(-0.8, len(cko)-0.2)\naxA.axis(\"off\")\naxA.set_title(\"A  Mouse Atp6ap2 conditional knockouts: every tissue tested fails\\n\"\n              \"(MGI:1917745, floxed alleles tm1.1Aich and tm1.1Ics)\",\n              fontsize=11.5, loc=\"left\")\nhandles = [plt.Rectangle((0,0),1,1,color=col[k]) for k in [\"lethal\",\"severe\",\"cellular\"]]\naxA.legend(handles, [\"organism or organ lethal\", \"severe organ dysfunction\",\n                     \"cellular vacuolation / dysfunction\"],\n           loc=\"lower right\", fontsize=9, frameon=False)\n\n# ---------------------------------------------------------------\n# Panel B: Human Protein Atlas consensus RNA (nTPM)\n# ---------------------------------------------------------------\nhpa = pd.Series({\n    \"Parathyroid gland\":719.4, \"Thyroid\":166.0, \"Kidney\":154.5, \"Bone marrow\":117.4,\n    \"Cerebral cortex\":109.4, \"Placenta\":100.4, \"Liver\":90.5, \"Lung\":82.3, \"Colon\":77.7,\n    \"Hippocampus\":69.0, \"Skin\":68.0, \"Adrenal gland\":67.5, \"Esophagus\":65.8, \"Spleen\":65.0,\n    \"Heart muscle\":51.6, \"Pancreas\":50.2, \"Stomach\":46.4, \"Small intestine\":45.0,\n    \"Salivary gland\":39.6, \"Testis\":37.7, \"Pituitary\":34.0, \"Duodenum\":30.3,\n}).sort_values()\naffected = {\"Kidney\",\"Cerebral cortex\",\"Liver\",\"Hippocampus\",\"Heart muscle\",\"Bone marrow\"}\ncols = [\"#b2182b\" if t in affected else \"#bdbdbd\" for t in hpa.index]\naxB.barh(hpa.index, hpa.values, color=cols)\naxB.set_xlabel(\"consensus RNA, nTPM (Human Protein Atlas, ENSG00000182220)\", fontsize=10)\naxB.set_title(\"B  ATP6AP2 is expressed in every tissue\\n\"\n              \"red = organ affected in patients or mouse models\", fontsize=11.5, loc=\"left\")\naxB.tick_params(axis=\"y\", labelsize=9)\nfor s in [\"top\",\"right\"]: axB.spines[s].set_visible(False)\naxB.text(719.4*0.98, len(hpa)-1, \" tissue-enriched (Tau 0.35)\",\n         va=\"center\", ha=\"right\", fontsize=8.5, color=\"white\", fontweight=\"bold\")\n\nplt.tight_layout()\nplt.show()\n\nprint(cko.severity.value_counts().to_string())\nprint(f\"\\nHPA nTPM range {hpa.min():.1f} to {hpa.max():.1f}; median {hpa.median():.1f}; \"\n      f\"fold parathyroid over median {hpa.max()/hpa.median():.1f}x\")\n",
  "plot_number": 4
}