Repository to accompany the manuscript Perisomatic Ultrastructure Efficiently Classifies Cells in Mouse Cortex (Elabbady 2025). The tutorials in this repository are aimed to recapitulate the figures and analyses from the manuscript.
Here we present how the perisomatic region of brain cells can be used to classify cells from a mm3 volumetric electron microscopy dataset of mouse visual cortex.
To run the tutorials provided in this repository please follow the detailed installation instructions found at MicronsBinder. The conda environment file has been provided here as well.
Briefly, run the following:
conda env create -f environment.yml
conda activate micronsbinder
This repository comes with several public data files. Filenames and definitions are provided below:
- microns_SomaData_AllCells_v661.pkl
This file contains the nucleus and soma features for all 94,010 cells presented in the manuscript. Note that this includes all predicted neurons and non-neurons but excludes any objects predicted as errors. The hierarchical model predictions for cell class and subclass are also included. Details about how each feature was calculated can be found in the Methods section under 'Generating Nucleus and Soma Features'. Note that the prediction provided match those presented in the manuscript. To access newer predictions or versions of the model, please query the cell-types table from the dataset directly using CAVEClient. Instructions and tutorials on how to use CAVE can be found here.
- inhibitory_perisomatic_feats_v661.pkl
This file contains the nucleus, soma, and PSS features that were extracted for all 6,805 predicted inhibitory neurons. Note that the numbers in each shape column denotes the number of objects of that shape detected within a given spatial bin. So for example, a value of 5 in shape_2_0_15000 means that a given cell had 5 instances of Shape 2 between 0-15 microns from the soma center point.
The cortical column has been described in detail in Schneider-Mizell 2023 - this cells within this column have been proofread and with expert cell-type labels. The files below all aid in quantifying the truncation and completeness of cells within and outside the column.
- column_edits_df.pkl
- column_edit_distances.pkl
This file compiles all the proofreadings edits that were made for all the cells within the cortical column and notes the distance of each edit from the soma center point.
- column_radial_truncation.pkl
This file contains the radial distance of each branch from the soma center point for each proofread cell within the cortical column.
- column_syn_edits_df.pkl
- nucleus_counts_perID_v661.pkl
To search for cells within the MICrONS dataset using the perisomatic features, checkout the Cell Search folder at tutorials/Cell_Search/. Users can use the jupyter notebook Cell_Search_Code_Tutorial to search for cells with similar perisomatic features programmatically. Alternatively, users can launch a dash app to interactively explore the dataset. Users will be asked to input an ID (nucleus or segment ID) and how many cells they would like to find. They can view their cell of interest within the 2D embedding space along with the requested similar cells. The app provides an interactive manner to visualize cell neighborhoods within the embedding space and provides dynamic neuroglancer links that include all the cells of interest for further exploration.
To launch the Cell Search App, navigate to the folder tutorials/Cell_Search/ and run the following:
python Cell_Search_App.py
This will launch a local instance of the app. To access the app, paste the local address displayed in your terminal into a browser.
For accompanying feature extraction pipelines, please look at the following repositories:
- Nucleus and Soma Extraction
- Spine Extraction from mesh objects
- Post-Synaptic Shape Feature Extraction
To see how these features have enabled scientific discovery, please check out the following papers:
- Cell-type-specific inhibitory circuitry from a connectomic census of mouse visual cortex (Schneider-Mizell 2023)
- The Synaptic Architecture of Layer 5 Thick Tufted Excitatory Neurons in the Visual Cortex of Mice (Bodor 2023)
- Integrating EM and Patch-seq data: Synaptic connectivity and target specificity of predicted Sst transcriptomic types (Gamlin 2023)


