API for Allen Developing Mouse Brain Atlas

image The Allen Developing Mouse Brain Atlas provides in situ hybridization (ISH) image data for approximately 2,000 genes over embryonic and postnatal timepoints. Each data set is processed through an informatics analysis pipeline to obtain spatially mapped quantified expression information.

From the API, you can:

image Download images
image Download quantified expression values by structure
image Download quantified expression values as 3-D grids
image Query the correlative search service
image Query the image synchronization service
image Download atlas images, drawings and structure ontology

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 for more information on data models and query syntax.

Experimental Overview and Metadata

Experimental data from this atlas is associated with the “Developing Mouse Brain” Product.

Multiple genes were assayed using each Specimen. Typically, the sectioning scheme divided each brain into 4 to 8 interleaving SectionDataSets depending on the age of the specimen.

Section thickness is 20 micron for the earlier timepoints up to P4 and 25 micron for P14 and older. Section thickness is an attribute of the SectionDataSet object.

Image resolution is variable (0.99 - 1.049 microns) and is reported as an attribute of SectionImage.

Each gene was assayed with one sagittal SectionDataSet at each of the 7 main developmental timepoints (E11.5, E13.5, E15.5, E18.5, P4, P14, P28). A subset of genes also has coronal SectionDataSets, replicate sagittal experiments and/or data for intermediate and aging timepoints.

To support the generation of structure/age summaries for the web application, one sagittal SectionDataSet is selected as the representative for each age. This is reported as the boolean delegate attribute of SectionDataSet.

From the API, detailed information about Genes, Probes, SectionDataSets and SectionImages can be obtained using RMA queries.

Examples

http://api.brain-map.org/api/v2/data/Gene/query.xml?criteria=products[id$eq3]
  • All experiments associated with gene netrin G1 (Ntng1)
http://api.brain-map.org/api/v2/data/SectionDataSet/query.xml?criteria=[failed$eqfalse],products[id$eq3], 
genes[acronym$eq'Ntng1']&include=genes,section_images,specimen(donor(age))

Figure: There are 11 SectionDataSets associated with gene netrin G1 (Ntng1). Screenshot shows SectionDataSets for timepoints E13.5, E15.5, E18.5 and P4.

image See the image download page to learn how to download images at different resolutions and regions of interest.

Informatics Data Processing

The informatics data processing pipeline produces results that enable the navigation, analysis and visualization. The pipeline consists of the following components:

  • a set of age-matched annotated 3-D reference spaces,
  • an alignment module,
  • an expression detection module,
  • an expression gridding module, and
  • a structure unionizer module.

The output of the pipeline is quantified expression values at a grid voxel level and at a structure level according to the integrated reference atlas ontology. The grid level data are used downstream to provide a correlative gene search service and to support visualization of spatial relationships. See the informatics processing whitepaper for more details.

3-D Reference Models

The backbone of the automated pipeline is a set of annotated 3-D reference spaces for each of the 7 developmental stages. For each stage, a brain volume was reconstructed from section images from a single specimen. Each 3-D reference space is in PIR orientation (+x = posterior, +y = inferior, +z = right).

image

Figure: All references spaces are in PIR orientation where x axis = Anterior-to-Posterior, y axis = Superior-to-Inferior and z axis = Left-to-Right.

Structural delineation were extracted from the associated 2-D reference atlas plates and interpolated to create 3-D annotations. Structures in the reference atlas are arranged in a hierarchical organization. Each structure has one parent and denotes a “part-of” relationship. Structures are assigned a color to visually emphasize their hierarchical positions in the brain. Note: the structural hierarchy used in this atlas is based on a systematic developmental ontology that differs from the ontology used for processing the Allen Mouse Brain Atlas.

image See the atlas drawings and ontologies page for more information.

Three volumetric data files are available for download for each reference space from our download server:

  • atlasVolume: uchar (8bit) grayscale Nissl or Feulgen-HP yellow volume of the reconstructed brain.
  • annotation: uint (32bit) structural annotation volume matching the atlasVolume. The value represents the ID of the finest level structure annotated for the voxel. Note: the 3-D mask for any structure is composed of all voxels annotated for that structure and all of its descendents in the structure hierarchy.
  • gridAnnotation: uint (32bit) structural annotation volume at grid resolution.

All volumetric data is stored in an uncompressed format with a simple text header file in MetaImage format. The raw numerical data is stored as a 1-D array as shown in the figure below.

Figure: Packing of 3-D volumetric data into a 1-D numerical array.

The atlas volume dimension and resolution for each ReferenceSpace vary with age, scanning platform and gene sampling density as listed in the table below.

ReferenceSpace Age Anatomy atlasVolume Dimension atlasVolume Resolution
1 E11.5 Embryo [345,371,158] [16.0,16.0,20.0]
2 E13.5 Embryo [552,673,340] [16.0,16.0,20.0]
3 E15.5 Embryo [704,982,386] [16.0,16.0,20.0]
4 E16.5 Head [704,982,386] [16.0,16.0,20.0]
5 E18.5 Brain [581,370,278] [16.0,16.0,20.0]
6 P4 Brain [724,403,398] [16.752,16.752,20.0]
7 P14 Brain [794,469,390] [16.752,16.752,25.0]
8 P28 Brain [863,480,418] [16.752,16.752,25.0]
9 P56 Brain [528,320,456] [25.0,25.0,25.0]
10 P56 Brain [528,320,456] [25.0,25.0,25.0]

Table information in CSV format.

The grid dimension and resolution for each ReferenceSpace vary with age and gene sampling density as listed in the table below.

ReferenceSpace Age Anatomy grid Dimension grid Resolution
1 E11.5 Embryo [70,75,40] [80.0,80.0,80.0]
2 E13.5 Embryo [89,109,69] [100.0,100.0,100.0]
3 E15.5 Embryo [94,132,65] [120.0,120.0,120.0]
4 E16.5 Head [94,132,65] [120.0,120.0,120.0]
5 E18.5 Brain [67,43,40] [140.0,140.0,140.0]
6 P4 Brain [77,43,50] [160.0,160.0,160.0]
7 P14 Brain [68,40,50] [200.0,200.0,200.0]
8 P28 Brain [73,41,53] [200.0,200.0,200.0]
9 P56 Brain [67,41,58] [200.0,200.0,200.0]
10 P56 Brain [67,41,58] [200.0,200.0,200.0]

Table information in CSV format.

Example Matlab code snippet to read in the P4 atlas and annotation volume:

% ------------
% Download and unzip the P4 (ReferenceSpace=6) atlasVolume and annotation zip files
% ------------
 
% atlas volume size
size = [724,403,398];
 
% VOL = 3-D matrix of atlas Nissl volume
fid = fopen('P4_atlasVolume/atlasVolume.raw', 'r', 'l' );
VOL = fread( fid, prod(size), 'uint8' );
fclose( fid );
VOL = reshape(VOL,size);
 
% ANO = 3-D matrix of annotation labels
fid = fopen('P4_DevMouse2012_annotation/annotation.raw', 'r', 'l' );
ANO = fread( fid, prod(size), 'uint32' );
fclose( fid );
ANO = reshape(ANO,size);
 
% Display one coronal section
figure;imagesc(squeeze(VOL(362,:,:)));colormap(gray);
figure;imagesc(squeeze(ANO(362,:,:)));colormap(lines);
 
% Display one sagittal section
figure;imagesc(squeeze(ANO(:,:,115)));colormap(lines);
figure;imagesc(squeeze(VOL(:,:,115)));colormap(gray);

Example Matlab code snippet to read in the P4 grid annotation volume:

% -----------
% Download and unzip the P4 (ReferenceSpace=6) gridAnnotation zip files
% -----------
 
%  grid volume size
sizeGrid = [77,43,50];
 
% ANOGD = 3-D matrix of grid-level annotation labels
fid = fopen( 'P4_DevMouse2012_gridAnnotation/gridAnnotation.raw', 'r', 'l' );
ANOGD = fread( fid, prod(sizeGrid), 'uint32' );
fclose( fid );
ANOGD = reshape(ANOGD,sizeGrid);
 
% Display one coronal and one sagittal section
figure;imagesc(squeeze(ANOGD(36,:,:)));colormap(lines);
figure;imagesc(squeeze(ANOGD(:,:,14)));colormap(lines);

Image Alignment

The aim of image alignment is to establish a mapping from each SectionDataSet to its exact or closest age matched ReferenceSpace. The reference-space-id attribute indicates which reference space the data has been aligned to. The module reconstructs a 3-D Specimen volume from its constituent SectionImages and registers the volume to the 3-D reference model by maximizing image correlation.

Once registration is achieved, information from the 3-D reference model can be transferred to the reconstructed Specimen and vice versa. The resulting transform information is stored in the database. Each SectionImage has an Alignment2d object that represents the 2-D affine transform between an image pixel position and a location in the Specimen volume. Each SectionDataSet has an Alignment3d object that represents the 3-D affine transform between a location in the Specimen volume and a point in the 3-D reference model. Spatial correspondence between any two SectionDataSets from different Specimens can be established by composing these transforms.

image For convenience, a set of “Image Synchronization” API methods is available to find a corresponding position between SectionDataSets, the 3-D reference model and structures. Note that all locations on SectionImages are reported in pixel coordinates and all locations in 3-D ReferenceSpaces are reported in microns. These methods are used by the Web application to provide the image synchronization feature in the multiple image viewer.

To support image synchronization across reference spaces, each space has been co-registered and scaled to every other space using a 12 parameter affine transform, allowing brains of different ages to be roughly compared. The image synchronization API methods automatically perform the cross-space transform when requesting to sync data from different reference spaces.

Examples:

http://api.brain-map.org/api/v2/image_to_image/101121829.xml?x=5752&y=3312&section_data_set_ids=100057390,100047075,100047197,100046840,100057243,100045273,100045230,71924185,70300595
[type or paste code here](http://api.brain-map.org/api/v2/image_to_atlas/101121829.json?x=5752&y=3312&atlas_id=181276165)

Figure: Cross timepoint image synchronization on the Web application. Multiple SectionDataSets in the Zoom-and-Pan (Zap) viewer can be synchronized to the same approximate location across different ages. Screenshot taken after synchronization of 5 other Ntng1 SectionDataSets at E13.5, E15.5, E18.5, P14 and P28 to the P4 (lower-left) SectionDataSet.

Figure: Screenshot taken after synchronization of the E11.5, E13.5, E15.5, P4, P14 and P56 atlases to the P4 ISH SectionDataSet (lower-left in the previous figure).

Expression Detection

For every ISH SectionImage, a grayscale mask is generated that identifies pixels corresponding to gene expression. The detection algorithm is based on adaptive thresholding and mathematical morphology.

image The expression mask image is the same size and pixel resolution as the primary ISH image and can be downloaded through the image download service.

Expression Gridding

For each SectionDataSet, the Gridding module creates a low resolution 3-D summary of the gene expression and projects the data to its exact or closest age matched ReferenceSpace. Casting all data into a canonical space allows for easy cross-comparison of gene expression data within each stage. The expression data grids can also be viewed directly as 3-D volumes or used for analysis such as correlative searches.

Each image in a SectionDataSet is divided into a grid resolution squares. Grid resolution varies with age ranging from 80 x 80 µm at E11.5 to 200 x 200 µm at P28. Pixel-based gene expression statistics are computed using information from the primary ISH and the expression mask:

  • expression density = sum of expressing pixels / sum of all pixels in division
  • expression intensity = sum of expressing pixel intensity / sum of expressing pixels
  • expression energy = expression intensity * expression density

Each per-image 2-D expression grid is smoothed and rotated to form a 3-D grid. Z-direction smoothing is applied to the 3-D grid which is then transformed into the targeted reference space.

image Grid data can be downloaded for each SectionDataSet using the 3-D Expression Grid Data Service. The service returns a zip file containing the volumetric data for expression density, intensity and/or energy in an uncompressed format with a simple text header file in MetaImage format. Structural annotation for each grid voxel can be obtained via the ReferenceSpace gridAnnotation volume file.

Note: Coronal SectionDataSets span both hemispheres while sagittal SectionDataSets only span the left hemisphere. Voxels with no data are assigned a value of “-1”.

Examples:

http://api.brain-map.org/grid_data/download/100054927
http://api.brain-map.org/grid_data/download/100054927?include=intensity,density

The expression data grid can be viewed in the Brain Explorer® 2 desktop program. Each grid voxel is rendered as a colorized sphere where the diameter represents expression energy and the color encodes expression intensity. In addition, a preview of the expression data grid is shown on the Web application as a series of maximum density projection images.

Example Matlab code snippet to read an energy grid volume:

%------------
% Download and unzip the energy grid file for P4 Rora Pdyn SectionDataSet
% -----------
 
%  grid volume size
sizeGrid = [77,43,50];
 
% ENERGY = 3-D matrix of expression energy grid volume
fid = fopen('Rora_P4_sagittal_100054927/energy.raw', 'r', 'l' );
ENERGY = fread( fid, prod(sizeGrid), 'float' );
fclose( fid );
ENERGY = reshape(ENERGY,sizeGrid);
 
% Display one coronal and one sagittal section
figure;imagesc(squeeze(ENERGY(36,:,:)));colormap(gray);
figure;imagesc(squeeze(ENERGY(:,:,14)));colormap(gray);

Structure Unionization

Expression statistics at a structural level are also computed by combining/unionizing grid voxels with the same 3-D structural label. Expression statistics are encapsulated as a StructureUnionize object associated with one Structure and one SectionDataSet. StructureUnionize data is used in the web application to display expression summary colormaps for a set of coarse structures over development.

image Expression statistics are encapsulated as a StructureUnionize object associated with one Structure and one SectionDataSet and can be downloaded via RMA.

StructureUnionize data is used in the web application to generate an expression summary heatmap for a set of coarse structures over the 7 main developmental timepoints assayed.

Example:

  • Fetch expression energy values for the delegate SectionDataSet at each of the 7 developmental ages for coarse-level structures RSP, Tel, PedHy, p3, p2, p1, M, PPH, PH, PMH and MH in CSV format
http://api.brain-map.org/api/v2/data/query.csvcriteria=model::StructureUnionize,rma::criteria,section_data_set[delegate$eqfalse] (genes[id$eq21177],specimen(donor(age[name$in'E11.5','E13.5','E15.5','E18.5','P4','P14','P28']))),
structure(structure_sets_structures(structure_set[name$eq'Developing Mouse - Coarse']))
&order=ages.embryonic$desc,ages.days,structures.graph_order&num_rows=100
&tabular=structure_unionizes.section_data_set_id,ages.name as age,ages.embryonic,ages.days,
structures.acronym,structures.name,structures.graph_order,structure_unionizes.expression_energy

Figure: Gene expression “heatmap” from the gene detail page of Tcf7l2 for 11 gross anatomical regions over 7 developmental timepoints.

Expression Grid Search Service

A expression grid service has been implemented to allow users to instantly perform a correlation search over the ~2,000 genes to find genes that have a similar spatio-temporal profile to a seed gene.

image The expression grid search service is available through both the Web application and API.

To perform a Correlation search, a user selects a seed Gene, a spatial domain and a set of timepoints over which the similarity comparison is to be made. All voxels belonging to any of the domain structures and specified timepoints form the domain voxel set. Pearson’s correlation coefficient is computed between the domain voxel set from the seed Gene and every other Gene in the Product. The return list is sorted by descending correlation coefficient.

Note: Only the 7 main developmental timepoints (E11.5, E13.5, E15.5, E18.5, P4, P14, P28) can be used as temporal domain. For each timepoint, the delegate SectionDataSet is used in the computation.

See the connected service page for definitions of service::dev_mouse_correlation parameters.

Example:

  • Correlation search for genes with similar expression to Neurod1 within the telencephalic vesicle (Tel) at age P4
http://api.brain-map.org/api/v2/data/query.xml?criteria=service::dev_mouse_correlation[row$eq17779] [structures$eq'Tel'][ages$eq'P4']

Figure: Screenshot of top returns of a correlation search for genes with similar expression as Neurod1 within the telencephalic telencephalic vesicle at age P4.

Example:

  • Correlation search for genes with similar expression to Neurod1 within Tel over multiple ages P4, P14, P28
http://api.brain-map.org/api/v2/data/query.xml?criteria=service::dev_mouse_correlation[row$eq17779] [structures$eq'Tel'][ages$eq'P4','P14','P28']

Figure: Screenshot of the top 2 returns (Sowaha, Prox1) of a correlation search for genes with similar expression as Neurod1 within the telencephalic vesicle at ages (left to right) P4, P14, P28.

Example:

  • Correlation search for genes with similar expression to Nr5a1 over the whole neural plate (NP) and across all 7 ages
http://api.brain-map.org/api/v2/data/query.xml?criteria=service::dev_mouse_correlation[row$eq26171][structures$eq'NP']

Figure: Screenshot of the top returns of a correlation search for genes with similar expression as Nr5a1 over the whole neural plate (NP) and across all 7 ages. Each gene is represented by an expression “heatmap” for 11 gross regions.

Expert Manual Annotation

ISH data for ages E11.5, E13.5, E15.5 and E18.5 were manually annotated to provide accurate gene expression characteristics for fine level structures. For each SectionDataSet and Structure, gene expression is scored with intensity (Undetected, Low, Medium, High), density (Undetected, Low, Medium, High) and pattern (Undetected, Full, Regional, Gradient) attributes.

Manual annotation results can be accessed through RMA and can be used to search data.

Note: the structural hierarchy associated with the manual annotation differs from the Ontology used for informatics processing of the ISH data.

Examples:

  • Download manual annotation for gene Tcf7l2 at E11.5
http://api.brain-map.org/api/v2/data/query.xml?criteria=model::ManualAnnotation,rma::criteria,[section_data_set_id$eq100045897], rma::include,structure,rma::options[order$eq'structures.graph_order$asc']
  • Search for E13.5 SectionDataSets with high intensity, regional expression in the diencephalon
http://api.brain-map.org/api/v2/annotated_section_data_sets.xml?structures=112765096 &intensity_values='High'&pattern_values='Regional'&age_names='E13.5'
http://api.brain-map.org/api/v2/structure_graph_download/112755225.json

Figure: Expression intensity, density and pattern attributes for level 5 structures for gene Tcf7l2 at E11.5 (id=100045897)