### Reconstructed wiring diagram of a female adult fly brain

This work is based on v783 of the proofread reconstruction of an adult female *Drosophila* brain^{15,16,17}. All cells and connections are drawn from the right optic lobe. Cell-type annotations of neurons intrinsic to the optic lobe^{4}, and ‘boundary’ neurons that straddle the optic lobe and central brain^{17} are provided in companion papers.

As detailed elsewhere^{16,61}, neurons were reconstructed by human proofreading of a 3D electron micrograph that was automatically segmented using convolutional nets. Synapses were automatically detected and assigned to partners using convolutional nets^{62}. Reconstruction accuracy is state-of-the-art, judging from comparisons^{4,16} with neuronal wiring diagrams in the fly central brain^{63} and optic lobe^{64} previously reconstructed by other methods. I have not tried to disentangle biological and technical sources of cell-to-cell variability, although this could be attempted using statistical models^{17,64}.

It is common to threshold the wiring diagram by retaining only connections with at least some threshold number of synapses^{16,17,63}. This thresholding is carried out to reduce false-positive connections, and is important in the central brain, where most cell types consist of just a single neuron and its mirrored counterpart in the other hemisphere. In the optic lobe, most types contain many cells, so a large sample can be used to decide whether cell types are genuinely connected. Hence, the present study does not threshold connections.

Annotations of Dm3, TmY4 and TmY9 cell types were released with a companion paper^{4} but were mentioned only in passing. The present work describes connectomic properties of these cell types in detail for the first time.

### Dm3 types

Line amacrine cells were described in Strausfeld’s Golgi studies of *Calliphora* and *Eristalis*^{1}, as well as *Musca*^{65}. Strausfeld also mentioned unpublished observations of line amacrine cells in *Locusta* and *Apis*^{1}. Line amacrine cells were named Dm3 in a Golgi study of *Drosophila*^{2}.

Light microscopy with multicolour stochastic labelling^{3} went beyond Golgi studies by splitting Dm3 into two types with dendrite at orthogonal orientations. Dm3p and Dm3q were then shown to have transcriptomes that differ before adulthood (P50 or earlier)^{18}. (Ref. ^{18} used the alternative names Dm3a and Dm3b.) Immunostaining showed that Dm3q expresses Bifid, whereas Dm3p does not. Ref. ^{18} also analysed a reconstruction of seven medulla columns^{64}, with the results showing that Dm3p and Dm3q prefer to synapse onto each other, foreshadowing the present work, and speculatively placed Dm3 cells in the motion pathway.

It is unclear why this approach did not find the third Dm3v type, which is obvious in Fig. 1d. Presumably it is because only Dm3p and Dm3q were labelled in the GAL4 line used by the study. There was no way to see Dm3v because it was invisible. Subsequent transcriptomic studies^{18,19} did not uncover the third Dm3 type. Neither did the seven-column medulla electron microscopy dataset^{18,64} uncover it, presumably because this volume is too small to contain more than fragments of Dm3 cells. However, the three Dm3 types (Fig. 1b–d) are unmistakably obvious in our complete and unbiased sample of optic lobe neurons. They can be distinguished by the directions of their neurites (Fig. 1b–d), or by their patterns of connectivity (Fig. 3a and Extended Data Fig. 1).

In connectivity patterns, Dm3p and Dm3q are more similar to each other than to Dm3v, and TmY9q and TmY9q^{⟂} are more similar to each other than to TmY4^{4}. Whether similarity of connectivity corresponds with transcriptomic similarity remains to be seen.

### TmY types

TmY4 and TmY9 were previously described^{2}. The two TmY9 types can be distinguished by the tangential directions of their neurites (Fig. 2b,c), or by their connectivity (Fig. 3a, and Extended Data Figs. 4 and 5). Their stratification profiles are slightly different (Fig. 1a). TmY9q^{⟂} stratifies in layers 1 and 2 of the lobula plate, whereas TmY9q stratifies only in layer 1. TmY9q^{⟂} is more often bistratified in layers 5 and 6 of the lobula, whereas TmY9q is more often monostratified (Figs. 1a and 2b,c).

### LC10e and LC15

LC10 cells project from the lobula to the anterior optic tubercle^{12}, and have been linked with visually guided courtship behaviours^{66}. Four LC10 types were previously identified using GAL4 transgenic lines, on the basis of their stratification in the lobula^{13}. Using the connectomic approach described in a companion paper^{4}, I identified a fifth type (LC10e), which stratifies in layer 6 of the lobula. LC10e was further subdivided into two groups on the basis of connectivity. The two groups cover the dorsal and ventral medulla, respectively.

My conjecture that LC10e detects a corner or T-junction is specific to the ventral variant, which receives strong input from TmY9q and TmY9q^{⟂}. The ventral visual field is expected to be more important for form vision, assuming that the fly is above the landmarks or objects to be seen.

### Neurotransmitter and receptor identity

FlyWire provides predictions of neurotransmitter identity that are based on the electron micrographs^{67}. Dm3 is predicted to be glutamatergic, whereas TmY4 and TmY9 are predicted to be cholinergic. The same inferences can be drawn by examining expression of neurotransmitter synthesis and transport genes^{19,68}.

Whether a neurotransmitter has an excitatory or inhibitory effect on the postsynaptic neuron depends on the identity of the postsynaptic receptor. Acetylcholine is excitatory when the postsynaptic receptor is nicotinic, which is generally the case in the fly brain^{69}. Glutamate is inhibitory in *Drosophila* when the postsynaptic receptor is GluClα^{70}.

According to transcriptomic data^{19,68}, Dm3 expresses GluClα. Unpublished data indicate that TmY4 and TmY9 also express GluClα (Y. Kurmangaliyev, personal communication). It should be noted that transcriptomic information so far exists for Dm3p and Dm3q, but not Dm3v.

On the basis of the above evidence, Dm3 is presumed to be inhibitory whereas TmY4 and TmY9 are presumed to be excitatory in the present work.

Tm1, Tm2, Tm9 and L3 are predicted to be cholinergic, and Mi4 is predicted to be GABAergic by FlyWire^{67} and transcriptomics^{68}.

T2a, Y3, TmY10, TmY11, Tm7, Tm8a, Tm16, Tm20, Tm25 and Tm27 are predicted to be cholinergic on the basis of electron micrographs^{16,67}, and presumed to be excitatory.

LPi14 and LPi15 are predicted to be GABAergic on the basis of electron micrographs^{16,67}, and presumed to be inhibitory. LPi07 cells are predicted to be GABAergic, glutamatergic or uncertain on the basis of electron micrographs, and are presumed to be inhibitory.

### Hexel cell types

The ommatidia of an insect compound eye are typically organized into a hexagonal lattice, so the term hexel will refer to an element of the image captured by the compound eye. This is to distinguish the geometry from an image defined on a square lattice of pixels, as customary in computer vision.

The *Drosophila* compound eye obeys the principle of neural superposition, in which each hexel is sampled by six photoreceptors that are located in neighbouring ommatidia but point at the same optical axis^{2,71}. These six photoreceptors converge onto a single lamina cartridge, which projects to a single medulla column.

Cell types that occur once per cartridge or column are said to be modular^{64}, and are in one-to-one correspondence with hexels. I define hexel cell types as those that are modular, and also have receptive fields that have been observed by neurophysiologists to be approximately one ommatidium wide. Tm1, Tm2, Tm9, Mi1, Mi4 and Mi9 are included because the full-width at half-maximum of their receptive fields ranges from 6° to 8°, roughly equivalent to the angular spacing between ommatidia^{30}. L1 to L5 are also included, on the basis of observed receptive fields^{33}. (L3 turns out to be the main contributor to the disynaptic pathways studied.) This list of hexel types is provisional because receptive fields of modular types have not yet been quantified exhaustively.

Connectivity maps included 745 Tm1, 746 Tm2, 716 Tm9, 796 Mi1, 749 Mi4, 730 Mi9, 785 L1, 763 L2, 709 L3, 671 L4 and 774 L5 cells in the v783 reconstruction that were successfully assigned to points in the hexagonal lattice through the procedures explained below. These numbers are smaller than the total number of cells proofread in v783 (ref. ^{4}), but the deficit is generally less than 10%.

Tm3 and Tm4 were excluded from the list of hexel types because the full-width at half-maximum of their receptive fields is 12° (ref. ^{30}). Including Tm3 and Tm4 would change the list of strong disynaptic pathways. Tm4–Li02–LC10ev, for example, would enter the list for LC10ev. T4 and T5 were also not considered hexel types because their receptive fields are too large.

Tm1 is OFF transient^{30,32,72}, Tm2 is OFF transient^{30,32,72,73}, Mi4 is ON sustained^{30,74}, Tm9 is OFF sustained^{30,32,72}, and L3 is OFF sustained^{33,75}. These are all Dm3 inputs (Extended Data Figs. 1 and 3), consistent with the prediction that Dm3 cells have OFF receptive fields. Mi1 is ON transient^{30,72,76}. Most of these physiological studies are based on calcium imaging. Electrophysiology^{72} and voltage imaging^{48} are also possible.

### Hexagonal lattice coordinates

Rules of connectivity in the optic lobe were simplified in a companion paper^{4} to depend on only cell type, and neglected spatial locations. For a refined characterization of optic lobe connectivity that includes spatial dependences, the present work assigned hexel cell types to a hexagonal lattice.

All Mi1 cells were semi-automatically assigned to hexagonal lattice points. Locations of L cells were assigned by placing them in one-to-one correspondence with Mi1 cells using the Hungarian algorithm applied to the connectivity matrix. The locations of other hexel types were assigned by placing them in one-to-one correspondence with L cells, again with the Hungarian algorithm.

The resulting locations of hexel types in (*p*, *q*) coordinates are provided in Supplementary Data 2. Following the convention defined in ref. ^{29}, all three cardinal axes of the hexagonal lattice point upwards (Fig. 1f). The vertical axis is directed dorsally. The *p* and *q* axes are directed in the anterodorsal and posterodorsal directions in the medulla, respectively. Note that for *Drosophila* the hexagons of the lattice are oriented with flat sides at the top and bottom, and pointy tips at the left and right. The relation of *p*–*q* axes to dorsoventral and anteroposterior axes is more complex than indicated in Fig. 1f, because the medulla is curved rather than flat.

The figures portray the lattice of medulla columns. A similar lattice can be constructed for ommatidia, and this lattice is left–right inverted relative to the lattice of medulla columns owing to the optic chiasm. Therefore, back-to-front motion on the retina is front-to-back motion on the medulla lattice. In other words, the *p* and *q* axes are swapped in the eye relative to the medulla. Another difference between the eye and the medulla is that the *p* and *q* axes are close to orthogonal in the medulla, which is squashed along the anterior–posterior direction. The *p* and *q* axes are closer to 120° apart in the eye, where the ommatidia more closely approximate a regular hexagonal lattice.

Hexagonal lattices are drawn in the figures as if they were perfectly uniform. The drawings are intended to portray only the nearest-neighbour relations of cells and columns, and do not accurately represent distances. More geometrically accurate representations of the lattices were constructed in ref. ^{29}, which quantitatively characterized how lattice properties vary in space for the left optic lobe of the same electron microscopy dataset used in this study, and for many *Drosophila* eyes^{29}. Visual acuity also varies across the retina in flies and other insects^{52,77}.

### Centres of ‘receptive fields’

Locations for Dm3 and TmY cells were computed from maps of monosynaptic connectivity from Tm1. Locations for LC15 and LC10ev cells were computed from their strongest disynaptic pathways, Mi1–T3–LC15 and Tm1–TmY9q–LC10ev. In all cases, the map was convolved with a linear filter that was 1.1 in the central column and 1 in its six neighbouring columns. The maximum of the result was taken as the location of the cell. This centre is often close to the ellipse centre (the centroid of the map), but they are not necessarily the same.

### Ellipse approximation to ‘receptive fields’

Suppose that an image has hexel values \({h}_{i}\) at Cartesian coordinates \(({x}_{i},{y}_{i})\), where *i* runs from 1 to *N* points of a hexagonal lattice. Normalizing the image yields a probability distribution \({p}_{i}={h}_{i}/({\sum }_{j=1}^{N}{h}_{j})\). Then compute the coordinates of the image centroid by

$$\begin{array}{cc}\bar{x}=\mathop{\sum }\limits_{i=1}^{N}{p}_{i}{x}_{i} & \bar{y}=\mathop{\sum }\limits_{i=1}^{N}{p}_{i}{y}_{i}\end{array}$$

and the covariance matrix by

$$C=\mathop{\sum }\limits_{i=1}^{N}{p}_{i}\left[\begin{array}{cc}{({x}_{i}-\bar{x})}^{2} & ({x}_{i}-\bar{x})(\,{y}_{i}-\bar{y})\\ ({x}_{i}-\bar{x})(\,{y}_{i}-\bar{y}) & {({y}_{i}-\bar{y})}^{2}\end{array}\right]+\frac{5{s}^{2}}{12}I$$

in which *I* denotes the 2 × 2 identity matrix and *s* denotes the length of a hexagon side. The length and width of the hexel image are defined as \(2{\sigma }_{\max }\) and \(2{\sigma }_{\min }\), in which \({\sigma }_{\max }^{2}\) and \({\sigma }_{\min }^{2}\) are the larger and smaller eigenvalues of the covariance matrix. The approximating ellipse is centred at the image centroid, and oriented along the principal eigenvector of the covariance matrix.

The first term of the covariance matrix *C* effectively regards the probability distribution as a weighted combination of Dirac delta functions located at the lattice points. The second term is a correction that arises if each delta function is replaced by a uniform distribution over the corresponding hexagon. This replacement makes biological sense because a column receives visual input from a non-zero solid angle. Without the correction, the length and width would vanish if the image consists of a single hexel concentrated at a single delta function. With the correction, the length and width of an image with a single non-zero hexel become \(s\sqrt{5/3}=a\sqrt{5}/3\), in which \(a=s\sqrt{3}\) is the lattice constant. The correction becomes relatively minor when the length and width of the image are large.

The above has implicitly defined \(2\sigma \) as the width of a 1D Gaussian distribution, for which \({\sigma }^{2}\) is the variance. This is the full-width at \({e}^{-1/2}\approx 0.6\) of the maximum. Alternatively, the width could be estimated by the full-width at half-maximum, \(\sigma 2\sqrt{2\mathrm{ln}2}\approx 2.4\sigma \). For either estimate, the width is proportional to \(\sigma \). I stick with the simpler estimate \(2\sigma \), which can be readily scaled by any multiplicative factor of the reader’s preference.

### 1D projections of ‘receptive fields’

The ellipse approximation gives a parametric estimate of receptive field size. For a non-parametric estimate, I also used 1D projections onto directions defined on the hexagonal lattice. Each hexel was given coordinates (*p*, *q*), with the origin placed at the anchor location used for alignment.

The cardinal directions (*v*, *p* and *q*) point to nearest neighbours, which are one lattice constant away. The projection grouped hexels with equal *p* + *q*, 2*p* − *q* or 2*q* − *p*. The projection was smoothed by convolving with [0.5, 1, 0.5] with stride 2, resulting in coordinates measured in units of a single lattice constant.

The orthogonal directions (*h*, *p*^{⟂} and *q*^{⟂}) point to next-nearest neighbours, which are \(\sqrt{3}\) lattice constant away. The projections grouped hexels with equal *q* − *p*, *q* or *p*. The resulting coordinate was in units of lattice constant \(\times \sqrt{3}/2\).

### Input fractions of cell and cell types

Let *W*_{ab} be the number of synapses from cell *a* to cell *b*, and let *W*_{AB} be the number of synapses from cell type *A* to cell type *B*. Normalize these matrices so that every column sums to 1,

$$\begin{array}{cc}{P}_{{ab}}=\frac{{W}_{{ab}}}{\sum _{c}{W}_{{cb}}} & {P}_{{AB}}=\frac{{W}_{{AB}}}{\sum _{C}{W}_{{CB}}}\end{array}$$

The matrix *P*_{ab} is the fraction of input synapses to neuron *b* that come from neuron *a*. Similarly, the matrix *P*_{AB} is the fraction of input synapses to cell type *B* that come from cell type *A*.

The matrix *P*_{ab} can be interpreted as the Markov chain defined by a ‘backwards’ random walk on neurons. At each time step, the walker chooses an input synapse of the present neuron uniformly at random, and then crosses the synapse in the retrograde direction to reach the presynaptic node. Then *P*_{ab} denotes the probability of stepping from neuron *b* to neuron *a*.

Similarly, the matrix *P*_{AB} can be interpreted as the Markov chain defined by a ‘backwards’ random walk on cell types. At each time step, the walker chooses an input synapse of the present cell type uniformly at random, and then crosses the synapse in the retrograde direction to reach the presynaptic cell type. Then *P*_{AB} denotes the probability of stepping from cell type *B* to cell type *A*.

Extended Data Fig. 7 quantifies the anatomical strength of a disynaptic pathway by *P*_{AB}*P*_{BC}, which is the probability of randomly walking the *A*–*B*–*C* pathway backwards. This score was used to select the top disynaptic pathways leading to Dm3 (Fig. 4), TmY (Fig. 5) and LC (Fig. 6) types.

### Intermediary types

The analysed disynaptic pathways (Figs. 4–6, Extended Data Fig. 7 and Supplementary Data 3–5) start at a hexel type, pass through an intermediary type, and finish at a target type (Dm3, TmY or LC). The intermediary type is constrained to not be a hexel type. For LC10ev (Fig. 6 and Supplementary Data 5), the intermediary type is constrained to be cholinergic (excitatory). For LC15, the constraint was unnecessary as the top intermediaries are all predicted to be cholinergic (excitatory). The analyses do not require that intermediary types be assigned spatial locations. The number of cells for each intermediary type can be found in a companion paper^{4}.

### Mapping monosynaptic connectivity

Let **r**_{a} denote the location of cell *a* in the hexagonal lattice, and let *W*_{ab} denote the number of synapses from cell *a* to cell *b*. Then the monosynaptic connectivity map from cell type *A* to cell *b* is

$${f}_{{Ab}}\left({\bf{r}}\right)=\sum _{a\in A}{{\delta }}_{{\bf{r}}{{\bf{r}}}_{a}}{W}_{{ab}}$$

The average monosynaptic connectivity map from cell type *A* to cell type *B* is

$${f}_{{AB}}\left({\bf{r}}\right)=\frac{1}{\left|B\right|}\sum _{a\in A}\sum _{b\in B}{{\delta }}_{{\bf{r}},{{\bf{r}}}_{a}-{{\bf{r}}}_{b}}{W}_{{ab}}$$

The normalization is with respect to the number of cells \({|B|}\) of type B, because the connectivity map is defined as the average number of synapses received by a *B* cell from *A* cells, if the origin of the coordinate system is placed at the *B* cell.

In Supplementary Data 3–5, these maps are defined using *P*_{ab} rather than *W*_{ab}, to facilitate comparison with the probability maps for disynaptic pathways defined below.

### Mapping disynaptic pathways

The map of the disynaptic pathway from cell type *A* to cell type *B* to cell *c* is

$${f}_{{ABc}}({\bf{r}})=\sum _{a\in A}\sum _{b\in B}{{\delta }}_{{\bf{r}}{{\bf{r}}}_{a}}{P}_{{ab}}{P}_{{bc}}$$

and the average disynaptic pathway map from cell type *A* to cell type *B* to cell type *C* is

$${f}_{ABC}({\bf{r}})=\frac{1}{|C|}\sum _{a\in A}\sum _{b\in B}\sum _{c\in C}{\delta }_{{\bf{r}},{{\bf{r}}}_{a}-{{\bf{r}}}_{c}}{P}_{ab}\,{P}_{bc}$$

Both maps are normalized probability distributions, in the sense that summing over all **r**, *A* and *B* yields 1.

Maps for trisynaptic pathways are defined in an analogous fashion.

### Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.