Create your own
Lesson illustration

Formulating FlyWire Connectomics Research Questions

Hello, and welcome to the capstone module. This module turns the inspection, proofreading, and Python-query skills from the course into one bounded, reproducible connectomics project. The first discipline is choosing a question whose answer is genuinely present in FlyWire data—not a broad neuroscience ambition that would require behavioral experiments, physiology, or an unmanageably large analysis.

By the end of this lesson, you will have a capstone question card: one precise question, a defined population, a synapse-based quantity to calculate, and a bounded result format. In the next lesson, you will turn that design into an explicit cohort of versioned neuron identifiers.


A connectomics question is a data contract

A connectome represents neurons and their annotated synaptic connections. For a practical FlyWire capstone, the most reliable initial questions are descriptive network questions:

  • Which cells are the strongest inputs to a chosen neuron group?
  • Which cells receive the most output from that group?
  • How are synapses distributed among the members of a small cohort?
  • Which connections are reciprocal within a clearly defined set?

These are answerable because FlyWire data can provide:

  1. Neuron annotations such as class, type, side, lineage, or neurotransmitter prediction.
  2. Neuron identities represented by root identifiers at a specified data version.
  3. Synaptic connectivity, represented as presynaptic neuron, postsynaptic neuron, and a synapse-count weight.
  4. Morphology and inspection views, which support validation but do not by themselves establish circuit function.

The distinction matters. A question such as “How does the fly recognize an odor?” is biologically interesting, but it is too broad and makes a causal claim that synapse counts alone cannot settle. A question such as “Which postsynaptic partners receive the largest number of annotated synapses from a defined projection-neuron cohort?” has a concrete output: a ranked table and a network visualization.

A useful rule is:

Your question should be answerable by a finite set of filters, a connectivity query, grouping, ranking, and inspection of the strongest results.

The adult-brain annotation hierarchy gives you several levels at which to set a scope. A superclass is broad; a class is narrower; a cell type or combination of type and side can be narrow enough for a first cohort project.

This figure depicts the full adult Drosophila brain divided into annotation levels—flow, superclass, class, and cell type—and shows the large spatial extent of major neuron groups. It illustrates why a capstone should usually specify a narrow type and side rather than analyze an entire superclass.

Turn a broad interest into measurable terms

A good question has five components.

ComponentDecision you must makeExample
Source populationWhich neurons send the synapses?Neurons annotated as left DA1_lPN
Target populationWhich neurons can receive them?All directly postsynaptic neurons
Edge definitionWhat counts as a connection?Annotated direct chemical synapses
MetricWhat quantity will be calculated?Total synapse count per target
Answer boundaryHow much output will you report?Top five targets and their output fractions

The result can be expressed formally. Let be the selected source cohort, and let be the annotated synapse count from source neuron to target neuron . The cohort's total output to a particular target is:

A ranking by is an unambiguous analysis target. If you also report each target's share of all output made by the cohort, calculate:

This is a statement about the available connectome and its synapse annotations. It does not establish that the target is functionally the most important, nor that the connection produces a particular behavior. That restraint is part of good connectomics practice.

Scope is not vagueness

Compare these formulations:

Draft questionDiagnosisRevision
“What does the olfactory system connect to?”The source population is enormous; “connect to” has no direction or metric.Restrict to one defined olfactory type, one hemisphere, and direct synaptic outputs.
“Do DA1 projection neurons control behavior?”Requires evidence beyond a static connectome.Ask which targets receive their strongest annotated outputs.
“Find all neurons downstream of DA1 projection neurons.”Technically queryable, but likely too large and has no reporting boundary.Rank the five strongest postsynaptic targets by total synapse count.
“Which five postsynaptic partners receive the greatest total synapse count from left DA1_lPN neurons?”Clear source, direction, metric, and bounded output.Add a specific data version when you create the cohort.

The final version of the fourth question for this capstone can be:

At the recorded FlyWire materialization version, among neurons annotated as DA1_lPN on the left side, which five individual postsynaptic partners receive the largest total numbers of annotated synapses from this cohort, and what proportion of the cohort's total outgoing synapses does each partner receive?

This is deliberately modest. The documentation example for this type-and-side filter returns a small cohort in the version used by the documentation; your own capstone will record the actual version and resulting membership rather than assuming that historical result still applies.


Use Codex to test whether the question can be scoped

Codex is useful at this stage as an exploratory interface. It can search free-form labels when you do not yet know the field names, but structured queries are better once you need precise inclusion criteria. You can filter by attributes such as cell_type, nt_type, side, or hemilineage, and combine conditions with logical operators.

Info - Codex: FlyWire

Read “Sample Queries” in FlyWire Codex to see how annotation filters and combined conditions translate into a reproducible cohort definition.

In the “Advanced Query Examples” section, begin with the search-mode explanation. Focus on why a structured query is preferable once your cohort definition is settled. Then, in “Advanced Chaining” and “Additional Examples,” examine the examples that combine conditions with &&. Read the visual-projection example as a model for stating both a cell category and a spatial or projection constraint.

For the worked question, a Codex-style feasibility filter would conceptually combine a type and a side:

cell_type == DA1_lPN && side == left

Do not worry if the precise available field or type spelling differs in the current dataset. At this stage, the point is to express the inclusion rule clearly. In the next lesson, you will retrieve the actual candidates programmatically, record their root IDs, and pin the query to a materialization version.

Codex’s neuron-detail view is also valuable for a quick sanity check. It places annotation information, a 3D rendering, an incoming/outgoing connectivity summary, and links for further analysis in one place.

This FlyWire Codex screen shows a single neuron's metadata, annotation panel, connectivity graph, 3D rendering, and downstream-analysis links. During question scoping, these panels help verify that a candidate cell label and its apparent connectivity are plausible before building a cohort query.

A short feasibility pass should answer four practical questions:

  1. Does the annotation name exist? Search for the proposed type or label.
  2. Is the candidate set small enough to inspect? For a first capstone, a source cohort in the rough range of several to a few dozen cells is practical.
  3. Is the direction clear? “Inputs to” and “outputs from” produce different analyses. State whether your cohort is presynaptic or postsynaptic.
  4. Will the result be bounded? “All partners” can be a useful intermediate table; your reported finding should specify a top , a threshold, or a defined target cohort.

Annotation fields are evidence, not interchangeable truth

The source cohort will be selected through annotations, so your question must say which annotation source and fields you rely on. FlyWire has both community labels and systematic annotations. These serve different purposes:

  • Community annotations are user-supplied labels placed through the interface. They are often valuable and specific, but should be treated as contributed evidence with provenance.
  • Systematic annotations include standardized fields such as class, side, cell type, and predicted neurotransmitter information.
  • Predicted fields are not the same as direct experimental confirmation. For example, a predicted neurotransmitter type is useful for filtering or describing a cohort, but it should be reported as a prediction when interpreting results.

Working with annotations - fafbseg 3.2.2 documentation

Read the fafbseg documentation section “Working with annotations” to connect your conceptual cohort definition with the annotation sources and Python criteria you will use shortly.

In the opening of “Working with annotations,” read the annotation-source overview. Follow the examples of search_community_annotations and search_annotations to distinguish community tags from hierarchical annotation records. Then continue to the later example beginning the criteria pattern. Focus on how NeuronCriteria combines a type and side into a precise selection rule. The documentation’s type argument is a convenience search across available type fields; in your notebook, inspect the returned columns before assuming which underlying field supplied a match.

This distinction protects you from a common capstone failure: defining a cohort as “cells called X” without saying whether “called X” means a community tag, a systematic cell type, a morphology label, or a text search result.

For the example question, a compact provenance statement would be:

The source cohort will be selected using the systematic annotation query for type DA1_lPN and side left, at the materialization version recorded in the notebook. Any community labels used during interpretation will be recorded separately.

You do not need to choose a final version number today. You do need to make versioning a required blank in the question design, because root IDs and materialized connectivity are version-dependent.


Build your capstone question card

Create a short Markdown cell or question.md file in your future project directory. Keep it small enough that a reader can understand the analysis before seeing any code.

Worked question card

## Working title
Strongest postsynaptic targets of left DA1_lPN neurons

## Question
At the recorded FlyWire materialization version, among neurons annotated
as DA1_lPN on the left side, which five individual postsynaptic partners
receive the largest total numbers of annotated synapses from this cohort,
and what proportion of the cohort's total outgoing synapses does each
partner receive?

## Source cohort
Systematic annotation criteria:
- type: DA1_lPN
- side: left

## Target universe
All direct postsynaptic partners of the source cohort.

## Connectivity measure
For each target root ID, sum synapse weights across all source-cohort
members. Rank targets by that total.

## Planned outputs
- cohort table with root IDs and relevant annotations
- ranked top-five partner table
- directed network visualization of the strongest connections
- inspection notes for the strongest reported partners

## Exclusions
- no claims about behavior, causality, or synaptic sign
- no multi-step pathways
- no comparison across different materialization versions

## Required provenance
Materialization version, annotation source and query, retrieval date,
software versions, and any excluded or uncertain neurons.

This card is intentionally a design artifact rather than a results section. It makes the analysis reviewable before you begin collecting output. It also prevents “question drift,” where a notebook starts with one cohort but quietly changes filters after the analyst sees an interesting result.

A lightweight decision rule for your own question

If you prefer a different biological theme, retain the same structure. A question is ready for the next lesson when all of the following are true:

  • It names one source cohort using fields FlyWire can query.
  • It states a direction: incoming to the cohort or outgoing from it.
  • It specifies direct synapse counts or another explicit available measure.
  • It has a bounded reporting rule, such as top five partners.
  • It separates a descriptive finding from a causal interpretation.
  • It reserves a place for materialization version and annotation provenance.

Avoid adding morphology similarity, multi-step pathways, neurotransmitter comparisons, and bilateral analysis all at once. Those are reasonable later extensions, but each adds new selection choices and uncertainty. A small, auditable first analysis is more valuable than a broad result whose cohort definition cannot be reconstructed.


Wrap-up

A FlyWire capstone begins with a question that functions as a data contract: a defined source population, target universe, synapse-based metric, result boundary, and provenance requirements. Codex can help test whether your intended annotation filters are plausible, while the fafbseg annotation tools will let you express those filters programmatically and reproducibly.

Your concrete output from this lesson is a question card, ideally based on the worked DA1_lPN, left-side example or an equally narrow alternative. Next, you will turn that planned cohort into an explicit, versioned table of neuron identifiers, selection criteria, and annotation provenance.

Can't find a good explanation? Sign up and we'll make it for you

Sign up