!CellTypes.png|width=32! The *Allen Cell Types Database* provides multimodal single cell characterization data to enable data-driven approaches to cell type classification.

From the API, you can:

{!download_image.png|width=32!|anchor:NWB} *Download electrophysiology data in Neurodata Without Borders (NWB) format*
!structure_level_expression.png|width=32! *Download computed electrophysiology features*
!download_image.png|width=32! *Download images of cell morphology images*
!download_image.png|width=32! *Download morphological reconstructions in SWC format*
!structure_level_expression.png|width=32! *Download computed morphology features*
!download_image.png|width=32! *Download neuronal models trained on this data set*

This document provides a brief overview of the data, database  organization and example queries. API database object names are in camel  case. See the main [API Documentation|api:Allen Brain Atlas API] for more information on data models and query syntax.

The accompanying [Allen Software Development Kit (SDK)|http://sdk.brain-map.org/] provides python code for accessing electrophysiology data (NWB files) for all cells and morphological reconstructions (SWC files) for a subset of cells. The Allen SDK also provides sample code demonstrating how to download neuronal model parameters and run your own simulations using stimuli for the experiments or custom current injections.

h2. Experimental Overview And Metadata

Experimental data from Allen Cell Types Database is associated with the "Mouse Cell Types" Product.

Each brain specimen is sectioned in the coronal plane at section thickness of 350 µm. The sections are then hemisected along the midline and a single cell in the hemisected tissue is targeted for electrophysiological recording and biocytin fill to visualize the cell morphology. Each cell is represented as Specimen object.

Each cell Specimen is associated with an anatomical Structure and CellSomaLocation record containing the coordinate of the cell in the Common Coordinate Framework and a normalized depth between pia (value of 0) and white matter (value of 1) surfaces.

Each cell Specimen is also associated with two SpecimenTags describing the “dendrite type” (spiny, aspiny, sparsely spiny) and the “apical dendrite” (intact, truncated, n/a).

See [whitepapers|celltypes:Documentation] for detailed experimental and annotation information.

From the API, detailed information about cells can be obtained using [RMA |api:RESTful Model Access (RMA)]queries.

* All cells in the "Mouse Cell Types" Product
,rma::criteria,[is_cell_specimen$eq'true'],products[name$eq'Mouse Cell Types']
* All cells tagged with 'dendrite type - spiny'
,rma::criteria,[is_cell_specimen$eq'true'],products[name$eq'Mouse Cell Types']
structure,donor(transgenic_lines),specimen_tags[name$eq'dendrite type - spiny'],cell_soma_locations
* All cells annotated to be in layer 4
,rma::criteria,[is_cell_specimen$eq'true'],products[name$eq'Mouse Cell Types']
,rma::include,structure[name$il'*layer 4*'],donor(transgenic_lines),specimen_tags,cell_soma_locations

h2. Electrophysiology

All cells in the Allen Cell Types Database have electrophysiological recordings of responses to stimuli from a common set of current injection protocols. Please see the (TODO) electrophysiology technical white paper for details on specimen selection, tissue processing, recording, and quality control.

The Cell Types Database categorizes detailed stimulus protocols into set of high level descriptions:
|| Stimulus Group Name \\ || Description \\ ||
| Short Square \\ | |
| Short Square - Hold \-60mV \\ | |
| Short Square - Hold \-70mV \\ | |
| Short Square - Hold \-80mV \\ | |
| Short Square - Triple \\ | |
| Long Square \\ | |
| Square - 2s Suprathreshold \\ | |
| Square - 0.5ms Subthreshold \\ | |
| Ramp \\ | |
| Ramp to Rheobase \\ | |
| Noise 1 \\ | |
| Noise 2 \\ | |
| Test \\ | |


Stimulus sweeps that pass quality control standards are available for download as Neurodata Without Borders (NWB) files. To find the NWB download link for Rorb cell specimen [320654829|http://celltypes.brain-map.org/mouse/experiment/electrophysiology/320654829], use this query:

Please see the Allen SDK pages (LINKS TODO) on perisomatic biophysical models and generalized leaky integrate-and-fire models for details showing how to download these files in the context of neuronal model simulation.


A standard set of electrophysiological features are automatically computed from the recorded responses of each cell.  A subset of those features are displayed at the top of the electrophysiology page for a cell:
|| Feature \\ || Description \\ ||
| Upstroke:downstroke ratio \\ | |
| Fast AP trough \\ | |
| FI curve slope \\ | |
| Rheobase \\ | |
| Ramp AP Time \\ | |
| Resting Vm \\ | |
Please read the electrophysiology technical white paper (TODO) for a complete list of computed features and their interpretations.

Use this query to download the features computed for Scnn1a cell specimen 467703703:


h2. Morphology

The Allen Cell Types Database contains morphological reconstructions generated from bright-field images of biocytin-stained cells. Reconstructions are generated by manually curating the results of an automated segmentation algorithm.  Please see the morphology technical white paper for more details (TODO).

The API provides programmatic access to the microscopy images used for reconstruction, axis-oriented projections of those images, and morphological reconstructions. Example queries:
* Find all cells with morphological images
* Find projection image IDs for layer 4 spiny cell (TODO)
* Download an image from its ID
* Find all images used for reconstruction for a layer 4 spiny cell (TODO)
* Download an image from the image stack
* Find all cells with morphological reconstructions
* Find the reconstruction file for one of those cells
* Download the reconstruction file

A standard set of morphological features were computed for all reconstructed cells.  A subset of those features are displayed at the top of the cell-specific morphology page:

|| Feature Name \\ || Description \\ ||
| Max Euclidean Distance \\ | |
| Number of Stems \\ | |
| Number of Bifurcations \\ | |
| Average Contraction \\ | |
| Parent:Daughter \\ | |

For a complete list of computed morphological features, please see the morphology technical white paper (TODO).

To download all of the morphology features for Scnn1a cell 313862022:


h2. Single Cell Neuronal Models

The Allen Cell Types Database contains two types of neuronal models: perisomatic biophysical models and generalized leaky integrate-and-fire (GLIF) models.  These models attempt to mathematically reproduce a cell's recorded response to a current injection.  The perisomatic biophysical models take into account dendritic morphological structure, whereas GLIF models rely strictly on the cell's stimulus and response. 

There are five types of GLIF models with varying levels of complexity.  The most basic model is a simple leaky integrate-and-fire equation.  More advanced GLIFs attempt to model variable spike threshold, afterspike currents, and threshold adaptation. 
|| Model Name \\ || Description \\ ||
| Biophysical, perisomatic \\ | |
| 1 Leak Integrate and Fire (LIF) \\ | |
| 2 LIF + Reset Rules (LIF-R) \\ | |
| 3 LIF + Afterspike Currents (LIF-ASC) \\ | |
| 4 LIF-R + Afterspike Currents (LIF-R-ASC) \\ | |
| 5 LIF-R-ASC + Threshold Adaptation (LIF-R-ASC-A) \\ | |
Please see the perisomatic biophysical and GLIF technical white papers for more details on how these models were created (TODO). !models_celltypes.png|border=1!
A cell's electrophysiology page displays all available models.  Choose a model to see its simulated response to all stimuli presented to the cell.  If the required sweeps are available, two model evaluation metrics are computed per model:
|| Metric Name \\ || Required Sweeps \\ || Description \\ ||
| Explained Variance Ratio \\ | Noise 2 (at least two) \\ | |
| Feature Average \\ | Sweeps used for biophysical model fitting \\ | |
\* rheobase is defined as the Long Square amplitude

All models in the Allen Cell Types Database are available for download and local execution via the[Allen Software Development Kit (SDK)|http://sdk.brain-map.org/].  The biophysical models require [NEURON|http://www.neuron.yale.edu/neuron/] to be run, which the SDK helps to configure.  The GLIF simulation module comes as part of the Allen SDK. 

To download all of the configuration files necessary to run model 472427473: