Log inGet started
World

Fruit Fly

Branchmain
Branchesmain
Commit83f1b94a81

README.md

FruitFlyLab

The bench for a FruitFlyBrain. A movable, resizable window, laid out from ui.screenSize() so it reads the same on a phone held upright and on a wide monitor, holding everything a person does to the network by hand.

From the top:

  • Header. The connectome's name and its neuron and connection counts, with thousands separators.
  • State. Simulated seconds and the mean rate over the whole network on one line, spikes and dropped spikes on the next, in a tabular face. When the network is above 0.05 Hz with no drive live, a line says so: the activity is recurrence in the wiring, and reset is the cure.
  • Run / pause, reset, clear drive, then the three sliders (gain, time scale, minimum synapses) in one fixed label column, so the tracks and the value pills line up. The pill is the value; the label is the name alone.
  • Readouts. One row per watched group: an x that stops watching it, the group's name in its own colour, a bar drawn to that group's own full scale with the scale printed beside it, and the rate. The rows scroll inside a capped block, and groups sitting at zero collapse into one dimmed line with a show that opens them. Below, the trace: every group on one plot over the last 24 seconds, on a square root scale so a group at 4 Hz stays visible beside one at 130, with both gridline values named in the section header. A group of 32 neurons or fewer offers a raster, one row per neuron with a tick wherever that neuron was active at the sample.
  • Hot classes. The ten cell classes with the highest mean activity right now, as bars. Activity is the model's own 60 ms spike trace, not a rate, and the block says so.
  • Live drives. What is being driven at this moment and by whom: the bench, the fly, or a protocol.
  • Selection. Eight chips for the cell types this bench is used on most, a free text field, the rate slider, then stimulate / silence / restore, and watch / count with a name field.
  • Neuron. What the last identified neuron is, with a button that fills the selection with its cell type.
  • Fly. What the fly senses and what it does, as the fly reports them.
  • Legend. A swatch per colour in the neuron cloud, with the dataset's own superclass names beside it.

A group keeps its colour for the life of the session: the colour comes from a hash of the group's own name into a twelve colour palette, so adding a group never recolours the others.

Selections

The grammar lives in selection.module beside this component, and its README is the table of terms. lab:parseSelection(text) is the bench's way in to it and returns the same (selection, error) pair it always did.

Controls

lab.inputMap carries the bench's own controls on keyboard, gamepad and touch: labToggle (L, Start, the Lab button), labFocusNext and labFocusPrev (arrows or Tab, D-pad), labActivate (Enter, north), labAdjustLeft and labAdjustRight (arrows, D-pad, 5 percent of the slider's range) and labIdentify (mouse left, west, the ID button). The focused control draws a 2 px accent border, so every control is reachable with a pad alone or a keyboard alone. A "Lab" button sits at the bottom left of the screen for a finger, and the window's own hide and show button is where it always was.

labIdentify names the neuron under the pointer, or under the screen centre when nothing has moved the pointer recently, which is what a pad and the touch button aim with. A press the bench's own window took is ignored.

Fields and methods

Fields: brain, fly, open, refreshHz, inputMap. Method: parseSelection(text).

entity.spawn("Lab").component.add("FruitFlyLab", { brain = entity.find("Brain"), fly = entity.find("Fly") })

What the bench reads from the network

Everything the bench draws comes from the FruitFlyBrain on the brain entity: describe() for the header, the state line and every group's size and rate, classRates() for the hot classes, drives() for the live drives, groupActivity(name) for a raster, and neuronAt(x, y) for a pick. A network that publishes none of the last four still draws every other block, and the blocks that need them say what is missing rather than showing a number nobody computed.

The experiments guide (guides { path = "experiments" }) is the manual.