Making sense of a fruit fly’s neural wiring diagram

Visual system connectivity analysis and 3D visualisation of >50,000 neurons

Connectomics
Python
Plotly
Neo4j
SQL
Snakemake
Blender
neuPrint
Analysis of the male Drosophila visual system connectome: Python, Cypher and Snakemake workflows mapping 50,000+ neurons, released as reproducible code.

3D rendering of Drosophila optic lobe neurons.

Render of optic lobe cells reconstructed from the Optic Lobe Connectome. Image copyright of HHMI Janelia Research Campus

Highlights

  • Contributed to a shared codebase with 14 contributors, authoring and reviewing pull requests as part of the team’s review process.
  • Helped release the analysis as an “executable paper”: Snakemake pipelines that build the 3D neuron renders, plus Jupyter notebooks that reproduce each figure from the source data.
  • Wrote Cypher queries against a Neo4j graph database to analyse connectivity across 150,000+ neurons.
  • Applied object-oriented design and the core Python data stack (pandas, Plotly) across the analysis code.
  • Documented code for reuse by others: docstrings, READMEs and inline comments.

Background

Connectomes are extraordinary scientific resources.

They are comprehensive maps of all neural cells and their connections within an organism’s nervous system. These resources are made by creating many, many EM (electron microscopy) images of very thin sections of fixed tissue and then reconstructing them computationally back into a 3D representation.

Individual neurons and their connections are meticulously segmented and traced, by both machine learning algorithms and human annotators, to generate a complex database where each neuron and each connection has it’s own unique ID.

Figure 1: Image of the raw (black and white) electron microscopy (EM) data, the analytically determined “layers” are superimposed in colour. Screenshot of the Neuroglancer viewer within https://neuprint.janelia.org/.

Since the generation of a single connectome requires vast amounts of time and resources, very few exist at the moment. The first connectome was of the soil-dwelling nematode worm Caenorhabditis elegans (C.elegans) which is only ~1mm long and contains only 302 neurons.

The nervous system of the fruit fly (Drosophila melanogaster) was an especially valuable candidate for connectome generation, since it is paired with nearly a century of deep genetic characterization, including a vast toolkit of mutants, genetic drivers, and functional data.

Combining this genetic knowledge with a complete wiring diagram allows researchers to link neural structure directly to gene expression and circuit function, turning the connectome into a resource not just for observing the nervous system, but for testing how it actually works.

Problem

Transform this dense database of connectivity data on an individual cell level into meaningful insights about the visual system of the fruit fly, primarily through the categorisation of cells into types.

Methods

The project involved querying a graphical database (neo4j) of ~50,000 visual system neurons, performing connectivity analysis, creating 3D neuronal morphology renderings, and building reproducible computational workflows. This dataset was a subset of the full dataset that was released in 2026.

Figure 2: Reconstructed skeletons of selected individual neurons from given cell types that are described within our connectome analysis. Subpanel from a figure from Nern et al. 2025.

I was specifically involved performing analyses related to the spatial organisation of individual cells and groups of cells in 3D space and their assignment to vertical columns that span the depths of the fruit fly’s visual system and form functionally distinct units.

Figure 3: Spatial analysis of cell types within the fruit fly’s visual system. Subpanels from a figure from Nern et al. 2025.

I was also involved in the first generation of the accompanying web resource (Cell Type Explorer) that we later improved upon with the generation of neuView. We hoped that this web page would provide a more accessible, easy to use resource for researchers investigating the visual system of the fruit fly.

Outcome

We established a comprehensive inventory of the visual neurons and developed a computational framework to quantify their anatomy. This allowed us to classify ~53,000 neurons into 732 types and forms a basis by which further analysis based on the morphology of cell types might be conducted.

Furthermore, we developed a reproducible analysis pipeline for this large-scale connectomics dataset. The entire analysis workflow was published as supplemental code for Nern et al. 2025, creating what we like to think of as an “executable paper” where every figure and analysis can be independently replicated and reproduced.

References

Acknowledgements

This project took place while I was a member of the Reiser Lab at Howard Hughes Medical Institute (HHMI) Janelia Research Campus. The generation of the male fruit fly connectome was led by the FlyEM team at Janelia.