Skip to main content
Ctrl+K
Allen Brain Cell Atlas - Data Access - Home
  • Allen Brain Cell Atlas - Data Access

INTRODUCTION

  • Getting started
  • Accessing 10x RNA-seq gene expression data
  • Using cells selected in the ABC Atlas with Gene Expression data.

DATA

  • Mouse whole-brain transcriptomic cell type atlas (Hongkui Zeng)
    • Whole mouse brain 10Xv2 single cell transcriptomes
    • Whole mouse brain 10Xv3 single cell transcriptomes
    • Whole mouse brain 10XMulti single cell transcriptomes
    • Clustering analysis of whole adult mouse brain 10X single cell transcriptomes
    • Whole adult mouse brain taxonomy of cell types
    • MERFISH spatial transcriptomics dataset of a single adult mouse brain
    • Imputed MERFISH spatial transcriptomics of a single adult mouse brain
    • Cluster groups and neighborhood specific UMAP embeddings
    • Allen Mouse Common Coordinate Framework (2020 version)
    • MERFISH CCF mapped coordinates
  • Aging Mouse dataset (Hongkui Zeng)
    • Zeng Aging Mouse 10Xv3 single cell transcriptomes
    • Zeng Aging Mouse clustering and mapping to the WMB taxonomy of cell types
  • A molecularly defined and spatially resolved cell atlas of the whole mouse brain (Xiaowei Zhuang)
    • MERFISH spatial transcriptomics dataset of a single adult mouse brain (Zhuang-ABCA-1)
    • MERFISH spatial transcriptomics dataset of a single adult mouse brain (Zhuang-ABCA-2)
    • MERFISH spatial transcriptomics dataset of a single adult mouse brain (Zhuang-ABCA-3)
    • MERFISH spatial transcriptomics dataset of a single adult mouse brain (Zhuang-ABCA-4)
  • Human whole-brain transcriptomic cell type atlas (Kimberly Siletti)
    • Human brain 10Xv3 single nucleus transcriptomes
    • Clustering analysis of whole human brain 10X single nucleus transcriptomes
    • Human brain taxonomy of cell types
  • ASAP Human Postmortem-Derived Brain Sequencing Collection (ASAP-PMDBS)
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Data Overview
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Mapping to the Whole Human Brain (WHB) and Seattle Alzheimer’s Disease Brain Cell Atlas (SEA-AD) Taxonomies

NOTEBOOKS

  • Mouse whole-brain transcriptomic cell type atlas (Hongkui Zeng)
    • 10x RNA-seq clustering analysis and annotation (CCN20230722)
    • 10x scRNA-seq gene expression data
      • 10x RNA-seq gene expression data (part 1)
      • 10x RNA-seq gene expression data (part 2a)
      • 10x RNA-seq gene expression data (part 2b)
    • MERFISH whole brain spatial transcriptomics
      • MERFISH whole brain spatial transcriptomics (part 1)
      • MERFISH whole brain spatial transcriptomics (part 2a)
      • MERFISH whole brain spatial transcriptomics (part 2b)
      • MERFISH whole brain spatial transcriptomics cells with imputed genes
    • Cluster neighborhoods and embeddings
    • Cell type neighborhood gallery
    • Allen Mouse Common Coordinate Framework (2020 version)
    • MERFISH CCF mapped coordinates
  • Aging Mouse Notebooks (Hongkui Zeng)
    • Mouse Aging clustering analysis and annotation
    • Mouse Aging 10X RNA-seq gene expression
  • A molecularly defined and spatially resolved cell atlas of the whole mouse brain (Xiaowei Zhuang)
    • MERFISH whole mouse brain spatial transcriptomics (Xiaowei Zhuang)
  • Whole Human Brain 10x scRNA-seq gene expression data
    • Whole Human Brain 10x RNA-seq clustering analysis and annotation
    • Whole Human Brain (WHB) 10x RNA-seq gene expression data (part 1)
    • Whole Human Brain 10x RNA-seq gene expression data (part 2)
  • ASAP Human Postmortem-Derived Brain Sequencing Collection (ASAP-PMDBS) Notebooks
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Data Overview
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Mapping to the Whole Human Brain Taxonomy
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Mapping to the SEA-AD Taxonomy
    • ASAP Human Postmortem-Derived Brain Sequencing Collection (PMDBS): Gene Expression

ADDITIONAL RESOURCES

  • Resource Pages
    • Gene lists
    • Cluster annotations
    • Parcellation annotations
  • Repository
  • Open issue
  • .ipynb

Cell type neighborhood gallery

Contents

  • Neighborhood: Pallium-Glut
  • Neighborhood: Subpallium-GABA
  • Neighborhood: HY-EA-Glut-GABA
  • Neighborhood: TH-EPI-Glut
  • Neighborhood: MB-HB-CB-GABA
  • Neighborhood: MB-HB-Glut-Sero-Dopa
  • Neighborhood: NN-IMN-GC

Cell type neighborhood gallery#

In this notebook, we will visualize a set of cell type neighborhoods to produce visualizations similar to Figure 2 of Yao et al.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path

from abc_atlas_access.abc_atlas_cache.abc_project_cache import AbcProjectCache

We will interact with the data using the AbcProjectCache. This cache object tracks which data has been downloaded and serves the path to the requsted data on disk. For metadata, the cache can also directly serve a up a Pandas Dataframe. See the getting_started notebook for more details on using the cache including installing it if it has not already been.

Change the download_base variable to where you have downloaded the data in your system.

download_base = Path('../../data/abc_atlas')
abc_cache = AbcProjectCache.from_cache_dir(download_base)

abc_cache.current_manifest
'releases/20241130/manifest.json'

Read in the list of neighborhood spatial embedding maps

maps = abc_cache.get_metadata_dataframe(directory='WMB-neighborhoods', file_name='dimension_reduction')
maps.set_index('name', inplace=True)
print("number of maps:", len(maps))
maps
number of maps: 8
label description number_of_cells cluster_group_label
name
HY-EA-Glut-GABA UMAP20230830-HY-EA-Glut-GABA Glutamatergic and GABAergic neurons in hypotha... 295448 CCN20230722_HY-EA-Glut-GABA
MB-HB-CB-GABA UMAP20230830-MB-HB-CB-GABA GABAergic neurons in midbrain, hindbrain, and ... 186775 CCN20230722_MB-HB-CB-GABA
MB-HB-Glut-Sero-Dopa UMAP20230830-MB-HB-Glut-Sero-Dopa Glutamatergic, serotonergic and dopaminergic n... 180669 CCN20230722_MB-HB-Glut-Sero-Dopa
NN-IMN-GC UMAP20230830-NN-IMN-GC Non-neuronal cells, immature neurons, granule ... 1418529 CCN20230722_NN-IMN-GC
Pallium-Glut UMAP20230830-Pallium-Glut Glutamatergic neurons from cerebral cortex (de... 1494801 CCN20230722_Pallium-Glut
Subpallium-GABA UMAP20230830-Subpallium-GABA Telencephalic GABAergic neurons from cerebral ... 611423 CCN20230722_Subpallium-GABA
TH-EPI-Glut UMAP20230830-TH-EPI-Glut Glutamatergic neurons from thalamus and epitha... 126171 CCN20230722_TH-EPI-Glut
WholeBrain UMAP20230830-WholeBrain All cells in the whole mouse brain (5322 clust... 4042976 CCN20230722_WholeBrain

Read in the extended 10x and MERFISH cell metadata created in the cluster neighborhood tutorial

cell_10x = abc_cache.get_metadata_dataframe(
    directory='WMB-neighborhoods',
    file_name='10x_cell_metadata_with_group_membership',
    dtype={"neurotransmitter": str}
)
cell_10x.set_index('cell_label', inplace=True)
print("number of 10x cells:", len(cell_10x))
10x_cell_metadata_with_group_membership.csv: 100%|██████████████████████████████████████████████████████| 1.57G/1.57G [01:01<00:00, 25.5MMB/s]
number of 10x cells: 4042976
cell_merfish = abc_cache.get_metadata_dataframe(
    directory='WMB-neighborhoods',
    file_name='merfish_cell_metadata_with_group_membership',
    dtype={"cell_label": str, "neurotransmitter": str}
)
cell_merfish.set_index('cell_label', inplace=True)
print("number of merfish cells:", len(cell_merfish))
merfish_cell_metadata_with_group_membership.csv: 100%|██████████████████████████████████████████████████| 1.20G/1.20G [00:41<00:00, 28.7MMB/s]
number of merfish cells: 3938808

Create a set of helper functions to read in the neighborhood specific UMAP coordinates and to plot cells in a UMAP or anatomical context and apply them a set of neighborhood

def fetch_coord(group) :
    mlabel = maps.loc[group, 'label']
    coord = abc_cache.get_metadata_dataframe(
        directory='WMB-neighborhoods',
        file_name=mlabel
    )
    coord.set_index('cell_label', inplace=True)
    return coord
def plot_umap(xx, yy, cc=None, val=None, fig_width = 8, fig_height = 8, cmap=None):
    
    fig, ax = plt.subplots()
    fig.set_size_inches(fig_width, fig_height)
    
    if cmap is not None:
        plt.scatter(xx, yy, s=0.5, c=val, marker='.', cmap=cmap)
    elif cc is not None:
        plt.scatter(xx, yy, s=0.5, color=cc, marker='.')
        
    ax.axis('equal')
    ax.set_xlim(-18, 27)
    ax.set_ylim(-18, 27)
    ax.set_xticks([])
    ax.set_yticks([])
    
    return fig, ax
def plot_sections(df, group, feature, blist, fig_width = 20, fig_height = 5):
    
    fig, ax = plt.subplots(1, len(blist))
    fig.set_size_inches(fig_width, fig_height)
    
    for idx, bsl in enumerate(blist):
        
        filtered = df[df['brain_section_label'] == bsl].copy()
        filtered.sort_values(group, ascending=True, inplace=True)
        
        xx = filtered['x']
        yy = filtered['y']

        vv = filtered[feature].copy()
        pred = (filtered[group] == False)
        vv[pred] = '#f5f5f5'
        
        ax[idx].scatter(xx, yy, s=1.0, color=vv, marker=".")
            
        ax[idx].axis('equal')
        ax[idx].set_xlim(0, 11)
        ax[idx].set_ylim(11, 0)
        ax[idx].set_xticks([])
        ax[idx].set_yticks([])
        
        ax[idx].set_title("%s: %s" % (group, bsl))
        
        
    plt.subplots_adjust(wspace=0.01, hspace=0.01)
    plt.show()
    return fig, ax

Neighborhood: Pallium-Glut#

group = 'Pallium-Glut'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
UMAP20230830-Pallium-Glut.csv: 100%|████████████████████████████████████████████████████████████████████| 84.5M/84.5M [00:02<00:00, 30.9MMB/s]
../_images/8b1117b645b0f9e19ed2d3a15a8393be1d780eec256b86d9db9ce756e0c827b9.png
blist = ['C57BL6J-638850.52', 'C57BL6J-638850.50', 'C57BL6J-638850.46']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/f13a2470d0c9fd12c422a99eb9a403894e43e989d8fe01208d81ee5d8b5ab0e1.png
blist = ['C57BL6J-638850.43', 'C57BL6J-638850.40', 'C57BL6J-638850.36']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/a3435807b89811a09310520605fb21a6be7b742b45bfc1695af508b9286de1cb.png

Neighborhood: Subpallium-GABA#

group = 'Subpallium-GABA'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
UMAP20230830-Subpallium-GABA.csv: 100%|█████████████████████████████████████████████████████████████████| 27.7M/27.7M [00:01<00:00, 21.8MMB/s]
../_images/9897e8fbf59e5d44fec1962972162e61b4fe4d10371197787e202ada4d2c6405.png
blist = ['C57BL6J-638850.52', 'C57BL6J-638850.50', 'C57BL6J-638850.46']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/d107163149b40459f545958560613c79443f86289a4e68077a31dbac2d823ebe.png
blist = ['C57BL6J-638850.43', 'C57BL6J-638850.40', 'C57BL6J-638850.36']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/69db515b0b99f375ebc9f76cf4c9af8929fac3a159587cd547e15d76a3613465.png

Neighborhood: HY-EA-Glut-GABA#

group = 'HY-EA-Glut-GABA'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
../_images/7020063242204187da89b589704e9ff174bcd672848d26e016e183558677e3b9.png
blist = ['C57BL6J-638850.52', 'C57BL6J-638850.50', 'C57BL6J-638850.46']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/c120d389db4e1f9facad4c68b2338314fa72175fc68d8d9084197d72a954e90f.png
blist = ['C57BL6J-638850.43', 'C57BL6J-638850.40', 'C57BL6J-638850.36']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/e94b42416da1c4312ace4d4a753e448e21fe94e79c03d1b0b0d605afad291ac1.png

Neighborhood: TH-EPI-Glut#

group = 'TH-EPI-Glut'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
../_images/7ec4efcac62daec0648b5ca815a9c529c8417be498208b61b8d4f1bf4d4a48e0.png
blist = ['C57BL6J-638850.44', 'C57BL6J-638850.40', 'C57BL6J-638850.38']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/408c4098ec759b42a85b9dc8555560069c8a1a331f4f9d608f44eca3fee9ca53.png
blist = ['C57BL6J-638850.36', 'C57BL6J-638850.33', 'C57BL6J-638850.30']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/ea8fc3c6dfe81dcbf773a4fa348bc9d46cee931b0cf2a99fc916dede25c2f4ef.png

Neighborhood: MB-HB-CB-GABA#

group = 'MB-HB-CB-GABA'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
UMAP20230830-MB-HB-CB-GABA.csv: 100%|███████████████████████████████████████████████████████████████████| 9.32M/9.32M [00:00<00:00, 16.5MMB/s]
../_images/767332df8ccc5aaf71a3a540bdb130a2821ddbea3f1445b2894f5234922ef936.png
blist = ['C57BL6J-638850.36', 'C57BL6J-638850.30', 'C57BL6J-638850.26']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/d1be3afaa2ae814aef2a6dc3d53c80272589a25de3f35c0b37f46a4d43b166fb.png
blist = ['C57BL6J-638850.16', 'C57BL6J-638850.08', 'C57BL6J-638850.04']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/0abe82f5ba1eaceae308e70cfb230319ada2d673aedf9d6da188896507a838d0.png

Neighborhood: MB-HB-Glut-Sero-Dopa#

group = 'MB-HB-Glut-Sero-Dopa'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
UMAP20230830-MB-HB-Glut-Sero-Dopa.csv: 100%|████████████████████████████████████████████████████████████| 8.42M/8.42M [00:01<00:00, 5.73MMB/s]
../_images/63899f00e512f802f895b046514ecffcae836b064f4b88a13ddadee2012ed83b.png
blist = ['C57BL6J-638850.36', 'C57BL6J-638850.30', 'C57BL6J-638850.26']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/d6cebc5014fe8adb7cb906a1201474f9dd744f52341f5850c2bbc2bce0f2fb27.png
blist = ['C57BL6J-638850.16', 'C57BL6J-638850.08', 'C57BL6J-638850.04']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/20e9b1c70cf1634e825990684c4529bb10661f5749f1b20555a6d7d2bfd13861.png

Neighborhood: NN-IMN-GC#

group = 'NN-IMN-GC'
coord = fetch_coord(group)
fig, ax = plot_umap(coord['x'], coord['y'], cc=cell_10x.loc[coord.index, 'subclass_color'])
plt.show()
UMAP20230830-NN-IMN-GC.csv: 100%|███████████████████████████████████████████████████████████████████████| 83.4M/83.4M [00:03<00:00, 25.6MMB/s]
../_images/b848b056bdbac6df0173ebd069205765720c05e2b4dfa2d6eb5d75e2307ec5d9.png
blist = ['C57BL6J-638850.67','C57BL6J-638850.60','C57BL6J-638850.46']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/1e8a27c048ad8d5b7b381dae5a5ef0af923062ca8bdb593d2558b74a6b086bc1.png
blist = ['C57BL6J-638850.36', 'C57BL6J-638850.16', 'C57BL6J-638850.04']
fig, ax = plot_sections(cell_merfish, group, 'subclass_color', blist)
plt.show()
../_images/3f96bb886a2830556d2b013b3a593ec260f71c95a2b70f989f10a36fb6cdb059.png

previous

Cluster neighborhoods and embeddings

next

Allen Mouse Common Coordinate Framework (2020 version)

Contents
  • Neighborhood: Pallium-Glut
  • Neighborhood: Subpallium-GABA
  • Neighborhood: HY-EA-Glut-GABA
  • Neighborhood: TH-EPI-Glut
  • Neighborhood: MB-HB-CB-GABA
  • Neighborhood: MB-HB-Glut-Sero-Dopa
  • Neighborhood: NN-IMN-GC

By Allen Institute

© Copyright 2023.