Allen Brain Institute API

The Allen Brain Institute publishes some really nice gene expression and fibre tracing maps.

Sadly, their API is beyond weird. I have managed to download some data which I believe is their template, but it’s in 1D and basically I would need to reconstruct the NIfTI from that. They do provide instructions on how to do it: http://help.brain-map.org/display/mousebrain/API#API-3DReferenceModels

I am wondering:

  1. Am I doing this all wrong, is there maybe a way to download their data in NIfTI or other 3d data formats?
  2. Has the parser for this 1D data structure been implemented in some python package already? What about a parser for their hierarchical annotation?
  3. If I go ahead and write this myself - what would be a nice place to contribute it to? nibabel?

It’s 1D because their sampling of tissue is highly non uniform. Check this tool for interacting with their API and converting to MNI coordinates https://github.com/chrisfilo/alleninf. NeuroVault includes a version of a gene decoder based on this code.

Neurosynth provides gene expression maps see here: https://github.com/NeuroVault/NeuroVault/pull/519#issuecomment-226266424

Alleninf says it’s deprecated. Are all its functions now provided by neurovault? or is it neurosynth?

So how exactly does one get the data? It looks like the latter link you gave me just points to neurovault.org and neurosynth.org. The neurovault search function finds no genes I would be interested in; while neurosynth.org findes a few. Sadly none of them seem to come with an associated download link for either the expression data or the corresponding template (e.g. http://neurosynth.org/genes/HTR2C/ ).

I would be interested in downloading a 5HT1A expression map and an according template for the mouse brain, do any of these tools have the ability to do that?

None of those three tools work with mice data - only human. Alleninf is deprecated, but it’s codebase can be used as inspiration (for example adapted for mouse data).

NeuroVault gene decoder does include the serotonin receptor you are interested in: http://neurovault.org/images/16291/gene_expression?q=htr1a

I see, and regarding neurovault, how do I actually get to the page you linked? Trying the search de novo leads me to this page http://neurovault.org/images/14272/gene_expression?q=htr1a which doesn’t contain any links to gene expression maps.

Regarding the actual maps I need, shouldn’t I use the neurovault code base for inspiration, if it has superseded alleninf?

I have to say the amount of time I put into TRYING to get the gene expression data from the Allen Brain Institute is absolutely inordinate. Do you have any idea why they don’t just publish a file listing with all maps named according to their gene identifiers? Does this organization have any redeeming benefit I don’t yet notice?

Since NeuroVault performs decoding based on the original sparse (non uniform) sampling of the brain performed by Allen it does not use explicit brain maps (neither does Allen for the very same reason).

Neurosynth constructed gene expression maps by colvolving sampling coordinates with spheres. For example the serotonin map you are looking for is here: http://neurosynth.org/genes/HTR1A/ (the direct link for the nifti file is here: http://neurosynth.org/images/20774).

I reexamined the issue, and I wasn’t able to find any indication regarding nonuniform sampling on the website, as far as I can tell, data is sampled per brain slice in a 2D raster:

Could you link to anything detailing that the sampling is non-uniform?

I’m thinking you might be referring to alignment issues — between individually imaged slices, or among stitched slice sections in some experiments. But that would AFAICT actually mandate higher dimmensionality, in order to maintain the possibility of accounting for alignment issues (in the latter case of stitched sub-slices, that would mean a 4D structure).

Is it possible that the 1-D format is purely a convention which seemed simple to them in terms of data storage?

The links you sent are to the mouse brain atlas and I was referring to the microarray human data available here http://human.brain-map.org/static/download.