{
  "filename": "plot_5.png",
  "iteration": 2,
  "description": "IMPC phenotyping of Unc119 knockout mice: no immune or lymphocyte phenotype",
  "timestamp": "2026-11-17 22:50:01",
  "code": "\nimport requests, pandas as pd, numpy as np, matplotlib.pyplot as plt\nfrom scipy import stats\nS=\"https://www.ebi.ac.uk/mi/impc/solr/\"\nr=requests.get(S+\"statistical-result/select\",\n   params={\"q\":'marker_symbol:\"Unc119\"',\"rows\":1000,\"wt\":\"json\",\n           \"fl\":\"procedure_name,parameter_name,p_value,zygosity\"},timeout=120).json()\ndf=pd.DataFrame(r[\"response\"][\"docs\"]).dropna(subset=[\"p_value\"])\nprint(\"Unc119 IMPC statistical tests with a p-value:\", len(df), \"across\", df.procedure_name.nunique(), \"procedures\")\nprint(\"Minimum p-value across the whole pipeline:\", df.p_value.min())\nprint(\"Tests passing the IMPC threshold p < 1e-4:\", (df.p_value<1e-4).sum())\n# uniformity of p-values => no phenotype signal anywhere\nks=stats.kstest(df.p_value.values, \"uniform\")\nprint(f\"KS test of p-values vs Uniform(0,1): D = {ks.statistic:.3f}, p = {ks.pvalue:.3f}\")\n\nhem=df[df.procedure_name.eq(\"Hematology\")]\nlym=hem[hem.parameter_name.str.contains(\"Lymphocyte|White blood\", case=False)]\nprint(\"\\nLymphocyte-related parameters:\")\nprint(lym[[\"parameter_name\",\"zygosity\",\"p_value\"]].sort_values(\"p_value\").to_string(index=False))\n\nfig,axes=plt.subplots(1,2,figsize=(12.5,4.6))\nax=axes[0]\nax.hist(df.p_value, bins=20, range=(0,1), color=\"#4C72B0\", edgecolor=\"white\")\nax.axhline(len(df)/20, color=\"#C44E52\", ls=\"--\", lw=1.2, label=\"uniform expectation\")\nax.set_xlabel(\"IMPC p-value\"); ax.set_ylabel(\"Number of tests\")\nax.set_title(f\"Unc119 knockout mouse: {len(df)} IMPC tests,\\nnone below the 1e-4 threshold (KS vs uniform p = {ks.pvalue:.2f})\", fontsize=10)\nax.legend(fontsize=8)\n\nax=axes[1]\nlab=(lym.parameter_name+\"\\n(\"+lym.zygosity+\")\")\nax.barh(lab, -np.log10(lym.p_value), color=\"#55A868\")\nax.axvline(4, color=\"#C44E52\", ls=\"--\", lw=1.2)\nax.text(4.1, 0.2, \"IMPC significance\\nthreshold p = 1e-4\", color=\"#C44E52\", fontsize=8, va=\"bottom\")\nax.set_xlabel(\"-log10(p)\"); ax.set_xlim(0, 5.2)\nax.set_title(\"No lymphocyte deficit in Unc119-null mice\", fontsize=10)\nplt.tight_layout(); plt.show()\n",
  "plot_number": 5
}