Quickstart
This page will walk you through everything you need to run, create, and analyse a freely-walking experiment. If you are new to this setup, read through this page first, then follow the links to the detailed pages as needed. For hardware and software requirements, see the Rig Specs page.
If you haven’t set up the system yet, start with the Installation & Setup page for software dependencies and configuration steps.
How to run a protocol
Fly prep and hardware:
Software prep:
Configure the computer paths:
Please refer to the page on computer configuration for detailed help on the below steps.
Putting the flies in the arena:
Running the experiment:
After the protocol finishes, the data folder is transferred to the processing computer and runs FlyTracker to generate tracking output. The MATLAB processing pipeline then generates results files and figures, which are saved on the network drive and local archive. You can monitor the progress of all experiments via the pipeline status page.
This page covers common problems and their solutions, organised by the stage at which they occur.
How to make a protocol
The easiest way to create a new protocol is to start from the protocol template (src/protocols/protocol_template.m) in the freely-walking-optomotor repository. The template is based on protocol_27 and includes:
- Annotated sections for each part of the experiment (workspace setup, timing parameters, condition definitions, stimulus presentation, data saving)
- A comprehensive speed reference table mapping speed values to temporal frequencies for all common patterns
- Commented examples for different stimulus routing options (standard gratings, curtains, fixation bars, mixed routing)
- Automatic condition numbering (the 7th column of
all_conditionsis generated from the row index)
To create a new protocol:
- Copy
protocol_template.mand rename it (e.g.protocol_XX.m) - Edit the header comments to describe the scientific question and stimuli
- Define your
all_conditionsmatrix with the desired patterns, speeds, and durations - Choose the appropriate presentation function(s) in the stimulus routing section
- Test with a short acclimation time (
t_acclim_start = 30) before running the full experiment
Patterns for the G3 arena can be generated using the G4_pattern_generator_gui, but for this screen all patterns and position functions were made from scratch using custom scripts:
- Pattern scripts: script_to_make_patterns/
- Protocol scripts: protocols/ (includes a subfolder with helper functions)
- See the Protocols and Patterns index pages for documentation on each stimulus
How to analyse the data
The analysis pipeline is described in detail on the Analysis page. In brief, data processing proceeds in three levels:
- Level 1 — per-cohort processing via
process_freely_walking_data(), which generates overview figures and results files for each individual vial of flies. - Level 2 — cross-cohort analysis via
process_screen_data(), which combines data across all strains and cohorts and creates comparison plots against the empty-split control flies. - Level 3 — statistical testing via
make_summary_heat_maps_p27(), which generates p-value heatmaps comparing each strain to the empty-split control.
If you are analysing data from a different protocol, see Analysing a new protocol.
For interactive data exploration, see the Dashboard page — it provides a browser-based interface for comparing strains and conditions without writing code.
A comprehensive training guide is available as a PDF at docs/training_guide/training_guide.pdf in the freely-walking-optomotor repository. The training guide covers the full data pipeline in detail — from running experiments through to the DATA struct — and includes diagrams, code walkthroughs, and a glossary of key terms. It is a useful companion to this documentation site, especially for understanding the processing functions and data structures in depth.