Article | Published:

Mapping brain activity at scale with cluster computing

Nature Methods volume 11, pages 941950 (2014) | Download Citation

Abstract

Understanding brain function requires monitoring and interpreting the activity of large networks of neurons during behavior. Advances in recording technology are greatly increasing the size and complexity of neural data. Analyzing such data will pose a fundamental bottleneck for neuroscience. We present a library of analytical tools called Thunder built on the open-source Apache Spark platform for large-scale distributed computing. The library implements a variety of univariate and multivariate analyses with a modular, extendable structure well-suited to interactive exploration and analysis development. We demonstrate how these analyses find structure in large-scale neural data, including whole-brain light-sheet imaging data from fictively behaving larval zebrafish, and two-photon imaging data from behaving mouse. The analyses relate neuronal responses to sensory input and behavior, run in minutes or less and can be used on a private cluster or in the cloud. Our open-source framework thus holds promise for turning brain activity mapping efforts into biological insights.

Access optionsAccess options

Rent or Buy article

Get time limited or full article access on ReadCube.

from$8.99

All prices are NET prices.

References

  1. 1.

    , , , & High-speed in vivo calcium imaging reveals neuronal network activity with near-millisecond precision. Nat. Methods 7, 399–405 (2010).

  2. 2.

    et al. Wave optics theory and 3-D deconvolution for the light field microscope. Opt. Express 21, 25418–25439 (2013).

  3. 3.

    , & Instantaneous three-dimensional sensing using spatial light modulator illumination with extended depth of field imaging. Opt. Express 21, 16007–16021 (2013).

  4. 4.

    et al. Simultaneous whole-animal 3D imaging of neuronal activity using light-field microscopy. Nat. Methods 11, 727–730 (2014).

  5. 5.

    et al. Neural population dynamics during reaching. Nature 487, 51–56 (2012).

  6. 6.

    , & Fast three-dimensional fluorescence imaging of activity in neural populations by objective-coupled planar illumination microscopy. Neuron 57, 661–672 (2008).

  7. 7.

    , , , & Whole-brain functional imaging at cellular resolution using light-sheet microscopy. Nat. Methods 10, 413–420 (2013).

  8. 8.

    et al. Fast functional imaging of multiple brain regions in intact zebrafish larvae using Selective Plane Illumination Microscopy. Front. Neural Circuits 7, 65 (2013).

  9. 9.

    , , & Whole-brain activity maps reveal stereotyped, distributed networks for visuomotor behavior. Neuron 81, 1328–1343 (2014).

  10. 10.

    et al. Neuroscience. The brain activity map. Science 339, 1284–1285 (2013).

  11. 11.

    , & Optical imaging of neuronal populations during decision-making. Science 307, 896–901 (2005).

  12. 12.

    et al. Brain-wide neuronal dynamics during motor adaptation in zebrafish. Nature 485, 471–477 (2012).

  13. 13.

    , , & Techniques for extracting single-trial activity patterns from large-scale neural recordings. Curr. Opin. Neurobiol. 17, 609–618 (2007).

  14. 14.

    et al. Multiple dynamic representations in the motor cortex during sensorimotor learning. Nature 484, 473–478 (2012).

  15. 15.

    & MapReduce: simplified data processing on large clusters. Commun. ACM 51.1, 107–113 (2008).

  16. 16.

    et al. Dryad: distributed data-parallel programs from sequential building blocks. ACM SIGOPS Operating Systems Review 41, 59–72 (2007).

  17. 17.

    , , & The Hadoop Distributed File System. in IEEE 26th Symposium on Mass Storage Systems and Technologies 1–10 (2010).

  18. 18.

    et al. Map-reduce for machine learning on multicore. Adv. Neural Inf. Process. Syst. 19, 281 (2007).

  19. 19.

    , , , & Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. in Proceedings of the 9th USENIX conference on Networked Systems Design and Implementation 2–15 (2012).

  20. 20.

    et al. Light-sheet functional imaging in behaving zebrafish. Nat. Methods (27 July 2014).

  21. 21.

    , , , & Monitoring neural activity with bioluminescence during natural behavior. Nat. Neurosci. 13, 513–520 (2010).

  22. 22.

    EM algorithms for PCA and SPCA. Adv. Neural Inf. Process. Syst. 626–632 (1998).

  23. 23.

    , , & Natural whisker-guided behavior by head-fixed mice in tactile virtual reality. J. Neurosci. 34, 9537–9550 (2014).

  24. 24.

    et al. Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature 499, 295–300 (2013).

  25. 25.

    , & Sensorimotor mismatch signals in primary visual cortex of the behaving mouse. Neuron 74, 809–815 (2012).

  26. 26.

    & Modulation of visual responses by behavioral state in mouse visual cortex. Neuron 65, 472–479 (2010).

  27. 27.

    et al. Automatic identification of fluorescently labeled brain cells for rapid functional imaging. J. Neurophysiol. 104, 1803–1811 (2010).

  28. 28.

    , & Fly motion vision. Annu. Rev. Neurosci. 33, 49–70 (2010).

  29. 29.

    & Highly selective receptive fields in mouse visual cortex. J. Neurosci. 28, 7520–7536 (2008).

  30. 30.

    & Direction selectivity in the larval zebrafish tectum is mediated by asymmetric inhibition. Front. Neural Circuits 6, 59 (2012).

  31. 31.

    et al. Parametric functional maps of visual inputs to the tectum. Neuron 76, 317–324 (2012).

  32. 32.

    , , , & Layer-specific targeting of direction-selective neurons in the zebrafish optic tectum. Neuron 76, 1147–1160 (2012).

  33. 33.

    et al. Filtering of visual information in the tectum by an identified neural circuit. Science 330, 669–673 (2010).

  34. 34.

    et al. Functional architecture of an optic flow-responsive area that drives horizontal eye movements in zebrafish. Neuron 81, 1344–1359 (2014).

  35. 35.

    & Functional imaging reveals rapid development of visual response properties in the zebrafish tectum. Neuron 45, 941–951 (2005).

  36. 36.

    , , , & Left-right asymmetry is required for the habenulae to respond to both visual and olfactory stimuli. Curr. Biol. 24, 440–445 (2014).

  37. 37.

    et al. Optimization of a GCaMP calcium indicator for neural activity imaging. J. Neurosci. 32, 13819–13840 (2012).

  38. 38.

    et al. Structural comparison of zebrafish Elav/Hu and their differential expressions during neurogenesis. Neurosci. Lett. 279, 81–84 (2000).

  39. 39.

    et al. Hindbrain V2a neurons in the excitation of spinal locomotor circuits during zebrafish swimming. Curr. Biol. 23, 843–849 (2013).

  40. 40.

    et al. A structural and functional ground plan for neurons in the hindbrain of zebrafish. Proc. Natl. Acad. Sci. USA 108, 1164–1169 (2011).

  41. 41.

    & Spontaneous fluctuations in brain activity observed with functional magnetic resonance imaging. Nat. Rev. Neurosci. 8, 700–711 (2007).

  42. 42.

    Fast and robust fixed-point algorithms for independent component analysis. IEEE Trans. Neural Netw. 10, 626–634 (1999).

  43. 43.

    et al. Transgenic tools to characterize neuronal properties of discrete populations of zebrafish neurons. Development 140, 3927–3931 (2013).

  44. 44.

    et al. Network anatomy and in vivo physiology of visual cortical neurons. Nature 471, 177–182 (2011).

  45. 45.

    , & Wiring specificity in the direction-selectivity circuit of the retina. Nature 471, 183–188 (2011).

  46. 46.

    et al. Automated three-dimensional detection and counting of neuron somata. J. Neurosci. Methods 180, 147–160 (2009).

  47. 47.

    , & Automated analysis of cellular signals from large-scale calcium imaging data. Neuron 63, 747–760 (2009).

  48. 48.

    et al. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature 454, 995–999 (2008).

  49. 49.

    et al. A new look at state-space models for neural data. J. Comput. Neurosci. 29, 107–126 (2010).

  50. 50.

    Optimal experimental design for event-related fMRI. Hum. Brain Mapp. 8, 109–114 (1999).

  51. 51.

    , & ScanImage: flexible software for operating laser scanning microscopes. Biomed. Eng. Online 2, 13 (2003).

  52. 52.

    , , , & nacre encodes a zebrafish microphthalmia-related protein that regulates neural-crest-derived pigment cell fate. Development 126, 3757–3767 (1999).

  53. 53.

    et al. Transparent adult zebrafish as a tool for in vivo transplantation analysis. Cell Stem Cell 2, 183–189 (2008).

  54. 54.

    , & Functional dissection of the Tol2 transposable element identified the minimal cis-sequence and a highly repetitive sequence in the subterminal region essential for transposition. Genetics 174, 639–649 (2006).

  55. 55.

    , & Histone-GFP fusion protein enables sensitive analysis of chromosome dynamics in living mammalian cells. Curr. Biol. 8, 377–385 (1998).

  56. 56.

    , & HuC:Kaede, a useful tool to label neural morphologies in networks in vivo. Genesis 44, 136–142 (2006).

  57. 57.

    , , & Evaluating the biological relevance of putative enhancers using Tol2 transposon-mediated transgenesis in zebrafish. Nat. Protoc. 1, 1297–1305 (2006).

  58. 58.

    The Zebrafish (University of Oregon Press, 1993).

  59. 59.

    , , , & Two-photon calcium imaging during fictive navigation in virtual environments. Front. Neural Circuits 7, 104 (2013).

  60. 60.

    , , , & Simultaneous two-photon calcium imaging at different depths with spatiotemporal multiplexing. Nat. Methods 8, 139–142 (2011).

  61. 61.

    Statistical Analysis of Circular Data (Cambridge University Press, 1995).

Download references

Acknowledgements

We thank K. Carlisle and R. Lines for help installing and running Spark on the Janelia Farm Research Campus Compute Cluster, D. Ganguli and M. Zaharia for advice on using Spark, G. Merlino for advice on benchmarking, C. Ziemba, C. Stock and T.J. Florence for help testing EC2 installation procedures, P. Keller for his help and advice in building the light-sheet microscope, B. Coop and T. Tabachnik for their help with hardware design, M. Coleman for writing the light-sheet microscope control software Zebrascope and continuing support, S. Narayan for help with zebrafish experiments, K. Svoboda and S. Peron for help setting up the mouse two-photon imaging, B. MacLennan for help with mouse surgeries, D.G.C. Hildebrand and M. Koyama for discussions, the Janelia Farm Research Campus vivarium staff for fish and mouse husbandry, and V. Jayaraman, G. Murphy, K. Svoboda and P. Keller for comments on an earlier draft of the manuscript. This work was supported by the Howard Hughes Medical Institute.

Author information

Affiliations

  1. Howard Hughes Medical Institute, Janelia Farm Research Campus, Ashburn, Virginia, USA.

    • Jeremy Freeman
    • , Nikita Vladimirov
    • , Takashi Kawashima
    • , Yu Mu
    • , Nicholas J Sofroniew
    • , Davis V Bennett
    • , Chao-Tsung Yang
    • , Loren L Looger
    •  & Misha B Ahrens
  2. University of California Berkeley, Computer Science Division, Berkeley, California, USA.

    • Joshua Rosen

Authors

  1. Search for Jeremy Freeman in:

  2. Search for Nikita Vladimirov in:

  3. Search for Takashi Kawashima in:

  4. Search for Yu Mu in:

  5. Search for Nicholas J Sofroniew in:

  6. Search for Davis V Bennett in:

  7. Search for Joshua Rosen in:

  8. Search for Chao-Tsung Yang in:

  9. Search for Loren L Looger in:

  10. Search for Misha B Ahrens in:

Contributions

J.F. and M.B.A. conceived of the project. J.F. developed the analysis library and analyzed the data. N.V., M.B.A. and T.K. developed the zebrafish light-sheet imaging experimental preparation. N.V., M.B.A., Y.M., T.K. and J.F. collected the zebrafish data. N.J.S. developed the mouse experimental preparation, collected the data reported in Figure 3 and helped develop the analysis of those data. D.V.B. contributed to zebrafish experiments. J.R. contributed code to the analysis library. C.-T.Y. and L.L.L. developed the Tg(elavl3:H2B-GCaMP6s)jf5 transgenic fish line. J.F. and M.B.A. wrote the paper, with input from all authors.

Competing interests

The authors declare no competing financial interests.

Corresponding authors

Correspondence to Jeremy Freeman or Misha B Ahrens.

Supplementary information

PDF files

  1. 1.

    Supplementary Text and Figures

    Supplementary Protocol

Videos

  1. 1.

    Direction tuning, planes.

    Maps of direction tuning from individual planes

  2. 2.

    Direction tuning, volume.

    Volumetric rendering of direction tuning maps

  3. 3.

    Principal component analysis, planes.

    Maps of sensorimotor responses from individual planes

  4. 4.

    Swimming-related responses, volume.

    Volumetric rendering of sensorimotor response maps

  5. 5.

    Swimming-related responses, planes.

    Maps of swimming-related responses from individual planes

  6. 6.

    Swimming-related responses, volume.

    Volumetric rendering of swimming-related response maps

  7. 7.

    Swim-related trajectories.

    State-space trajectories showing how neural activity on individual trials evolves through a low-dimensional space. Each trace is a trial. Size of dot indicates strength of swimming.

  8. 8.

    Direction-related trajectories.

    State-space trajectories showing how neural activity on individual trials evolves through a low-dimensional space recovered to capture variability related to different stimulus directions. Each trace is a trial. Color indicates stimulus direction.

  9. 9.

    Independent component analysis, planes.

    Maps of spontaneous functional networks from individual planes.

  10. 10.

    Independent component analysis, volume.

    Volumetric rendering of spontaneous functional network maps.

About this article

Publication history

Received

Accepted

Published

DOI

https://doi.org/10.1038/nmeth.3041

Further reading

Newsletter Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing