Version history
1 version on record. Newest first; the live version sits at the top with a live indicator.
- Live5/28/2026, 10:19:26 PM
sha256:cb059Content snapshot
{ "cells": [ { "source": "# Cross-cohort microglia scCODA\n\n**Plan ref:** `3994e115-0634-4f91-9069-9d86df12c962` \n**Tick:** 47 \n**Status:** scaffold — execution blocked pending kernel runtime\n\n## Input slots\n\n| Slot | Cohort | Source | n_donors | n_nuclei | QA flag |\n|------|--------|--------|----------|----------|---------|\n| A | SEA-AD | Allen Brain Cell Atlas S3 (`s3://allen-brain-cell-atlas/`) — `WMB-10Xv3/` microglia subset | ~84 | TBD | accession unresolved programmatically; requires S3 read |\n| B | ROSMAP (Olah 2020) | Digitized from Fig. 4, Nat Commun 2020 (DOI: 10.1038/s41467-020-19737-2); dataset:54fae8ad | ~48 | ~67,000 | DIGITIZED_FROM_FIGURE ±0.03; GSE127893 unconfirmed |\n| C | ROSMAP (Mathys 2023) | Digitized from Extended Data Fig. 4, Cell 2023 (DOI: 10.1016/j.cell.2023.08.039); dataset:54fae8ad | 437 | ~2,300,000 | DIGITIZED_FROM_FIGURE ±0.03; syn18485175/GSE174367 unconfirmed |\n\n## QA flags (inherited from dataset:54fae8ad-c9e0-4971-b263-f0805d2cbfc4)\n- `UNCONFIRMED_ACCESSION`: GSE127893 (Olah 2020) not programmatically verified\n- `UNCONFIRMED_ACCESSION`: syn18485175 / GSE174367 (Mathys 2023) not programmatically verified\n- `DIGITIZED_FROM_FIGURE`: proportions are estimates; not raw count matrices\n- `NO_WITHIN_DONOR_VARIANCE`: scCODA run requires synthetic donor-level draws or aggregated-proportion mode\n\n## Subtype crosswalk (literature prior — to be updated post-clustering)\n\n| Canonical ID | SEA-AD label | Olah 2020 cluster | Mathys 2023 subtype | Key markers |\n|---|---|---|---|---|\n| MG-H | Homeostatic | Olah_C1 | MG1 | P2RY12, TMEM119, CX3CR1, CSF1R |\n| MG-DAM | DAM-like / activated | Olah_C3 | MG3 | TREM2, APOE, SPP1, LPL |\n| MG-MGnD | MGnD / neurodegeneration-associated | Olah_C4 | MG4 | GPNMB, ITGAX, SPP1, LGALS3 |\n| MG-IRM | Interferon-response | Olah_C6 | MG6 | IFIT1, IFIT2, MX1, IRF7 |\n| MG-LDA | Lipid-droplet-accumulating | Olah_C7 | TBD | PLIN2, FABP5, LDLR |\n| MG-Pro | Proliferating | Olah_C8 | MG8 | MKI67, TOP2A |\n\n*Crosswalk is provisional — based on Olah 2020 Fig. 2, Mathys 2023 Fig. 3, and SEA-AD marker dotplots. Requires ARI-to-reference validation once raw data is loaded.*", "cell_id": "c-1a86661e", "outputs": [], "cell_hash": "sha256:2e8994daddc4a51e8e7682deff7b3794050565fb4043c8f4d8da3a1f7966bd0c", "cell_type": "markdown", "execution_count": null }, { "source": "# SLOT A — SEA-AD microglia subtype counts\n# Source: Allen Brain Cell Atlas public S3\n# Requires: s3fs, anndata, pandas\n# QA: confirm cell_type annotation column and Braak stage metadata column names\n\nSEA_AD_S3_PREFIX = 's3://allen-brain-cell-atlas/expression_matrices/SEA-AD/'\nSEA_AD_METADATA_URL = 'https://portal.brain-map.org/atlases-and-data/rnaseq/sea-ad'\n\n# Expected columns in metadata:\n# - 'donor_id' or 'external_donor_name'\n# - 'Braak' (0-6 integer) or 'braak_stage'\n# - 'cell_type' or 'subclass' (microglia subtypes)\n# - 'CERAD_score', 'Thal_phase' (secondary staging)\n\n# TODO (blocked): load via s3fs + anndata when kernel runtime is live\n# adata_seaad = anndata.read_h5ad(f'{SEA_AD_S3_PREFIX}...')\n# mg_seaad = adata_seaad[adata_seaad.obs['subclass'] == 'Microglia']\n# counts_A = mg_seaad.obs.groupby(['donor_id', 'cell_type']).size().unstack(fill_value=0)\n\nprint('SLOT A: SEA-AD S3 load — blocked pending kernel runtime')\nprint('Target: per-donor microglia subtype count matrix, shape (n_donors=~84, n_subtypes=TBD)')", "cell_id": "c-97a21401", "outputs": [], "cell_hash": "sha256:95238c6e9e0cc2ed086d166a6f13708b8f5f948236e15220ec047bebe6f05874", "cell_type": "code", "execution_count": null }, { "source": "# SLOT B — Olah 2020 digitized compositions\n# Source: dataset:54fae8ad-c9e0-4971-b263-f0805d2cbfc4\n# QA: DIGITIZED_FROM_FIGURE ±0.03; no within-donor variance\n# Braak stratification: not available per-donor from figure; use aggregate proportions\n\nimport pandas as pd\nimport numpy as np\n\n# Digitized from Olah 2020 Nat Commun Fig. 4 stacked barplot\n# Eight clusters; values are mean proportions across ~48 ROSMAP donors (AD + control)\n# AD vs control split estimated from figure legend\nolah_clusters = ['Olah_C1','Olah_C2','Olah_C3','Olah_C4','Olah_C5','Olah_C6','Olah_C7','Olah_C8']\nolah_props_control = [0.42, 0.12, 0.10, 0.08, 0.09, 0.07, 0.06, 0.06] # ±0.03 each\nolah_props_ad = [0.28, 0.09, 0.18, 0.16, 0.08, 0.08, 0.08, 0.05] # ±0.03 each\n\ndf_olah = pd.DataFrame({\n 'cluster': olah_clusters * 2,\n 'condition': ['control']*8 + ['AD']*8,\n 'proportion': olah_props_control + olah_props_ad,\n 'uncertainty': [0.03] * 16,\n 'source': 'digitized_figure'\n})\ndf_olah['crosswalk_id'] = df_olah['cluster'].map({\n 'Olah_C1': 'MG-H', 'Olah_C2': 'MG-H2', 'Olah_C3': 'MG-DAM',\n 'Olah_C4': 'MG-MGnD', 'Olah_C5': 'MG-Trans', 'Olah_C6': 'MG-IRM',\n 'Olah_C7': 'MG-LDA', 'Olah_C8': 'MG-Pro'\n})\nprint('SLOT B (Olah 2020) shape:', df_olah.shape)\nprint(df_olah.to_string(index=False))\nprint('QA: DIGITIZED_FROM_FIGURE — all proportions ±0.03; no Braak per-donor stratification available')", "cell_id": "c-862cd4d0", "outputs": [], "cell_hash": "sha256:a807c91c6e1aee882a2b08985f92eec6967136c62b2e295b86159eceed2800bc", "cell_type": "code", "execution_count": null }, { "source": "# SLOT C — Mathys 2023 digitized compositions by Braak stage\n# Source: dataset:54fae8ad-c9e0-4971-b263-f0805d2cbfc4\n# QA: DIGITIZED_FROM_FIGURE ±0.03; Extended Data Fig. 4, Cell 2023\n# n_donors=437 ROSMAP; Braak I-II, III-IV, V-VI stratification available from figure\n\nmathys_clusters = ['Mathys_MG1','Mathys_MG2','Mathys_MG3','Mathys_MG4','Mathys_MG5','Mathys_MG6']\n# Proportions by Braak stage bin (I-II, III-IV, V-VI) — digitized estimates\nmathys_braak_low = [0.45, 0.15, 0.14, 0.10, 0.09, 0.07] # Braak I-II\nmathys_braak_mid = [0.38, 0.13, 0.18, 0.14, 0.09, 0.08] # Braak III-IV\nmathys_braak_high = [0.27, 0.10, 0.20, 0.20, 0.10, 0.13] # Braak V-VI\n\nrows = []\nfor stage, props in [('I-II', mathys_braak_low), ('III-IV', mathys_braak_mid), ('V-VI', mathys_braak_high)]:\n for c, p in zip(mathys_clusters, props):\n rows.append({'cluster': c, 'braak_stage': stage, 'proportion': p, 'uncertainty': 0.03, 'source': 'digitized_figure'})\n\ndf_mathys = pd.DataFrame(rows)\ndf_mathys['crosswalk_id'] = df_mathys['cluster'].map({\n 'Mathys_MG1': 'MG-H', 'Mathys_MG2': 'MG-H2', 'Mathys_MG3': 'MG-DAM',\n 'Mathys_MG4': 'MG-MGnD', 'Mathys_MG5': 'MG-IRM', 'Mathys_MG6': 'MG-LDA'\n})\nprint('SLOT C (Mathys 2023) shape:', df_mathys.shape)\nprint(df_mathys.to_string(index=False))\nprint('QA: DIGITIZED_FROM_FIGURE — Braak-stage trend visible but within-stage donor variance absent')\nprint('Success criterion: MG-DAM + MG-MGnD proportions increase monotonically Braak I-II → V-VI; MG-H decreases')", "cell_id": "c-8d1bd488", "outputs": [], "cell_hash": "sha256:92fb17d716b91b7398e204a99b5f95426a5a9f43ad701745edb3675e5e6365f8", "cell_type": "code", "execution_count": null } ], "metadata": {}, "owner_ref": "persona-virtual-kyle-travaglini", "created_by": "persona-virtual-kyle-travaglini" }