Skip to main content
Science Advances logoLink to Science Advances
. 2021 Oct 6;7(41):eabi7460. doi: 10.1126/sciadv.abi7460

Collective behavior emerges from genetically controlled simple behavioral motifs in zebrafish

Roy Harpaz 1,2,, Ariel C Aspiras 3,, Sydney Chambule 3, Sierra Tseng 3, Marie-Abèle Bind 4, Florian Engert 1,2, Mark C Fishman 3,*,, Armin Bahl 1,2,5,
PMCID: PMC8494438  PMID: 34613782

Emergent social behavior in larval zebrafish is altered by targeted gene mutations.

Abstract

It is not understood how changes in the genetic makeup of individuals alter the behavior of groups of animals. Here, we find that, even at early larval stages, zebrafish regulate their proximity and alignment with each other. Two simple visual responses, one that measures relative visual field occupancy and one that accounts for global visual motion, suffice to account for the group behavior that emerges. Mutations in genes known to affect social behavior in humans perturb these simple reflexes in individual larval zebrafish and change their emergent collective behaviors in the predicted fashion. Model simulations show that changes in these two responses in individual mutant animals predict well the distinctive collective patterns that emerge in a group. Hence, group behaviors reflect in part genetically defined primitive sensorimotor “motifs,” which are evident even in young larvae.

INTRODUCTION

Collective movements of animal groups are adaptive (1) because they provide protection from predation (2, 3), improve foraging (46), and enhance energy utilization (7, 8). Extensive evidence has shown that such group behaviors can emerge from local interactions among individuals (920). However, it is not known how the genetic makeup of animals affects the sensorimotor algorithms implemented by individual animals that give rise to emergent patterns of collective behavior.

Zebrafish display a variety of distinct group behaviors, including shoaling, where individuals swim in proximity, and schooling, where all members of the group move in the same direction. To achieve such synchronized movements in groups, individual members need to assess certain properties of their near neighbors, including their speed, distance, and orientation; they also need to rapidly respond to these features and execute the appropriate motor commands. The ability to perform such socially relevant sensorimotor transformations, and thereby the ability to form groups, varies among different genetic backgrounds (2124) and is modified by hunger (2527) and innate interindividual differences (2831). Furthermore, whereas inputs from several sensory modalities such as lateral line mechanoreception (32, 33), olfaction (34), and vision likely play a role in this process, vision is critical to certain attributes, such as the rapidity of turning responses, the necessary integration of distal cues, and the precision of the alignment responses (9, 10, 24). Mapping the algorithmic rules and neurophysiology underlying collective behaviors can be more readily accomplished in larval zebrafish when the brain is transparent and circuits are simpler than in adults (35). However, while reflexive responses to stimuli emanating from conspecifics have been described in various contexts (32, 33), there has been little evidence of robust shoaling- or schooling-like behavior in zebrafish larvae younger than ~10 days post fertilization (dpf) (13, 30, 36).

Here, we identify two visual reflexes that are present from 7 dpf. We believe that the implementation of these reflexes leads to emergent patterns of the groups as fish mature. First, young larvae appear to repel away from regions of high visual clutter, leading to a dispersal of the group. At later developmental stages, this dispersal reflex shifts to attraction and hence leads to the observed aggregation behaviors. Second, larvae are known to move along with external motion stimuli, a well-described behavior known as the optomotor response (OMR) (3739). We hypothesize that individuals swimming within a group can cue in on their neighbors’ relative motion and that this reflex might help in improving mutual alignment. The combined developmental maturation of both reflexes can thus explain emergent shoaling and schooling behavior.

Notably, mutations in genes associated with autism and schizophrenia quantitatively alter these two visuomotor responses, and these changes seem to be predictive of the distinct emergent behaviors of groups of mutant fish. Thus, subtle alterations in simple behavioral motifs in the individual can account for complex emergent patterns of groups.

RESULTS

Visually driven aggregation and alignment in larval and juvenile zebrafish

We examined the behavior of wild-type larval zebrafish in groups of five, swimming together in a circular arena, where an overhead camera was used to monitor the position, orientation, and speed of each individual over extended time periods (see Fig. 1A and Methods). As animals mature from 7 to 21 dpf, we observed that they swim more closely to one another (Aggregation7 dpf = −0.019 ± 0.04 [means ± SD], Aggregation21 dpf = 0.476 ± 0.19, PFisher < 1/100,000), are more aligned (Alignment7 dpf = 0.417 ± 0.018 [means ± SD], Alignment21 dpf = 0.458 ± 0.027, PFisher < 1/100,000), and exhibit faster swim speeds (Speed7 dpf = 0.34 ± 0.07 cm/s [means ± SD], Speed21 dpf = 0.6 ± 0.17 cm/s, PFisher < 1/100,000) (Fig. 1, A to C, and fig. S1A). In addition, at 21 dpf, larvae exhibit a positive correlation between mutual alignment and aggregation (rPearson = 0.44, P = 0.027) (Fig. 1D), a phenomenon that is consistent with the plausible concept that conspecifics that swim closer to each other evoke stronger alignment responses than do more distant fish. Even at 7 dpf, groups already exhibit evidence of interactions. However, at this early age, the aggregation indices appear to be negative [mean Aggregation7 dpf = −0.019, 95% bootstrap interval (BI): [−0.0362; −0.0004], two-sided Pbootstrap ≈ 0.047], indicating that young larvae may display mutual repulsion rather than attraction. Despite the resulting increase in interindividual distances, we observe that alignment is present at this early age (mean Alignment7 dpf= 0.417, 95% BI: [0.4086 0.4252], two-sided Pbootstrap ≈ 0.0002) and becomes stronger in older fish (Fig. 1C). This result also serves as a motivation to use higher-sensitivity assays to explore the mechanism by which fish align to global visual motion stimuli, as described later.

Fig. 1. Aggregation in developing zebrafish.

Fig. 1.

(A) Left: Groups of five fish were tested in circular arenas, while overhead cameras recorded their behaviors. Right: Position and body orientations of each fish were extracted from the movies. (B) Example traces of the aggregation index (left) and alignment index (right) (see Methods) of groups of 7- and 21-dpf wild-type fish. Dotted lines represent baseline dispersion and aggregation levels of shuffled control groups. At 21 dpf, fish show higher aggregation and alignment than 7-dpf fish. (C) Left: At 7 dpf, fish are less aggregated than shuffled control groups (PBootstrap ≈ 0.047, N = 18 groups; Cohen’s d = −0.49) (see Methods), while 21-dpf fish form tight groups (PBootstrap < 1/100,000; N = 25 groups, Cohen’s d = 2.5). Right: 7-dpf fish are more aligned than shuffled control groups (PBootstrap ≈ 0.0002, Cohen’s d = 0.8), and 21-dpf fish are more aligned than 7-dpf fish (PFisher < 1/100,000; Cohen’s d = 1.8). *P < 0.05, ***P < 0.0005. (D) Pearson’s correlation of alignment and aggregation in 7-dpf (left) and 21-dpf (right) fish. Uncertainty regions are based on pointwise 95% CIs of the linear regression model (Methods). (E) Effect of “visual clutter.” Left: We reconstruct the visual angle that each neighboring fish is expected to cast on the retina of a focal fish (see Methods). Middle: The difference between total angular area (or visual clutter) experienced by each eye modulates the probability to turn away (7 dpf) or toward (21 dpf) the more cluttered visual field. Bold lines represent turning probability calculated from left/right turning events recorded from all fish in 5° bins. Uncertainty regions are based on pointwise 95% CI of a fitted binomial distribution to the events in each bin. Right: The integral of the curves in the middle panels symmetrized such that repulsion from clutter is negative and attraction is positive.

To explore the algorithmic basis of the transition from dispersed to aggregated groups with age, we examined the turning behavior of fish in response to the occupancy of their right and left visual fields, i.e., the retinal “clutter” generated by the presence of conspecifics swimming in the vicinity (Fig. 1E, left) (11, 13). We observe that 7-dpf fish tend to turn away from the more highly cluttered area, whereas 21-dpf animals turn toward it [e.g., p(turn right) = 0.407, 95% confidence interval (CI): [0.339 0.479] for +25° clutter difference (more clutter to the right) at 7 dpf, whereas p(turn right) = 0.589, 95% CI: [0.580 0.597] for +25° at 21 dpf] (Fig. 1E). This simple visuomotor response to differences in retinal clutter leads to a dispersal (7 dpf) or aggregation (21 dpf) phenotype.

We next tested whether perturbations by targeted genetic mutations cause specific changes in the clutter avoidance curves (Fig. 1E), thereby generating quantitative changes in aggregation indices and the associated shoaling phenotype in mutant animals. To that end, we selected fish with mutations in two genes that have been shown to generate specific social phenotypes in adults (24). The first gene, scn1lab, codes for a sodium channel. Its mutation is associated with Dravet’s syndrome in humans and causes more scattered group behaviors in adult zebrafish. We evaluated heterozygous fish of two alleles (scn1laballele1 and scn1laballele2), because homozygous mutations are early lethal. The second gene, disrupted-in-schizophrenia (disc1), encodes a scaffolding protein associated with schizophrenia in humans; zebrafish with a homozygous deficiency in disc1 display increased group cohesion as adults (24). We find that larvae with mutations in both genes behave differently from wild-type fish in the group swimming assay in a manner that is consistent with the differences described in mutant versus wild-type adults (24). At 7 dpf, both scn1lab+/− alleles show an increase in dispersal when compared to their wild-type siblings, which manifests as a reduced aggregation index (Aggregation7 scn1lab + /− = −0.052 ± 0.047 [means ± SD], Aggregation7 scn1lab + /+ = −0.005 ± 0.073, one-sided PFisher ≈ 0.035) (Fig. 2A and fig. S1B). At 21 dpf, both scn1lab+/− and scn1lab+/+ switch from dispersal to aggregation, but mutant fish are still less aggregated than their sibling controls (Aggregation21 scn1lab + /− = 0.44 ± 0.17 [means ± SD], Aggregation21 scn1lab + /+ = 0.6 ± 0.13, one-sided PFisher ≈ 0.0001) (Fig. 2A and fig. S1B), which is in line with the reduced aggregation phenotype reported in adults (24). In contrast, 7-dpf disc1−/− fish show an increase in aggregation relative to their disc1+/+ sibling controls (Aggregation7 disc − /− = −0.012 ± 0.026 [means ± SD], Aggregation7 disc + /+ = −0.038 ± 0.024, one-sided PFisher ≈ 0.0128), an effect that is also present at 21 dpf (Aggregation21 disc − /− = 0.44 ± 0.13 [means ± SD], Aggregation21 disc + /+ = 0.32 ± 0.1, one-sided PFisher ≈ 0.0129) (Fig. 2B).

Fig. 2. Single-gene mutations affect aggregation and alignment of developing zebrafish.

Fig. 2.

+/+, +/− , and –/– refer to sibling-controlled wild-type and mutant fish. (A) Left: At 7 dpf, scn1lab+/− fish are more dispersed than wild-type siblings (PFisher ≈ 0.036, N+/+ = 10, N+/− = 16 groups, Cohen’s d = −0.8). Dashed lines represent values of shuffled groups. At 21 dpf, fish are more aggregated. Scn1lab+/− aggregate less than scn1lab+/+ (PFisher ≈ 0.0001; N+/+ = 25, N+/− = 26 groups, Cohen’s d = −1.09). Right: Group alignment increases with age; however, we could not detect an effect of the scn1lab mutation (P7 Fisher = 0.26, P21 Fisher = 0.47). *P < 0.05, ***P < 0.0005. (B) Left: At 7 dpf, disc1−/− are less dispersed than wild-type siblings (PFisher ≈ 0.0128; N+/+ = 7, N−/− = 17 groups, Cohen’s d = 1.04). At 21 dpf, disc1−/− show more aggregation compared to wild-type siblings (PFisher ≈ 0.0129; N+/+ = 12, N−/− = 13 groups, Cohen’s d = 0.95). Right: We could not detect effect of the disc1 mutation on alignment (P7 Fisher = 0.33, P21 Fisher = 0.40). (C) Pearson’s correlation of alignment and aggregation in scn1laballele2 7-dpf (top) and 21-dpf (bottom) fish. Positive correlation for 21-dpf scn1laballele2+/− fish. Uncertainty regions are the pointwise 95% CI of the linear regression model. (D) We could not detect correlation for disc1. (E) Left: scn1laballele2+/− turn away more from visual clutter at 7 dpf (top) and turn toward clutter less at 21 dpf (bottom). Right: Integral of the curves symmetrized. Repulsion is negative. Attraction is positive. (F) Same as in (E) but for disc1. Mutants show a flattening of the 7-dpf repulsion curve (top) and an enhancement in 21-dpf attraction (bottom). Bold lines in (E) and (F) represent turning probability calculated from left/right turns of all fish in 5° bins; uncertainty regions are the pointwise 95% CI of a fitted binomial distribution to the events in each bin.

We next examined whether the responses of the mutant fish to retinal clutter are concordant with the observed aggregation indices: Compared to wild-type siblings, we observed that scn1lab+/− fish have an enhanced tendency to turn away from high clutter at 7 dpf (symmetrized area under the curve sAUC7 scn1lab+/− = −1.7, sAUC7 scn1lab+/+ = −0.8), and they may have a slightly reduced tendency to turn toward high clutter at 21 dpf (sAUC21 scn1lab+/ = 5.3, sAUC21 scn1lab+/+ = 6.0) (Fig. 2E). The disc1−/− mutation, on the other hand, displays a slight “flattening” at the edges of the clutter response curve at 7 dpf (sAUC7 disc−/− = −0.93, sAUC7 disc+/+ = −1.10), suggesting less repulsion, and a similarly small enhancement of the tendency to turn toward high visual clutter at 21 dpf (sAUC21 disc−/− = 3.3, sAUC21 disc+/+ = 2.7) (Fig. 2F). These trends are both qualitatively in line with the increase in aggregation indices at both ages (Fig. 2B). However, uncovering the precise relationship between the turning curves and aggregation indices requires a more detailed and quantitative analysis, as we describe in our collective behavior models below.

Both wild-type and mutant fish show enhanced mutual alignment by 21 dpf compared to 7 dpf (Fig. 2, A and B). However, our data did not allow us to report an alignment difference between mutant and wild-type animals at any age or strain (PFisher ≈ 0.26 and 0.47 for 7- and 21-dpf scn1lab; PFisher ≈ 0.47 and 0.33 for 7- and 21-dpf disc1).

We observe a positive correlation of alignment with aggregation in scn1lab+/− 21-dpf mutants in both alleles (rPearsonallele2 = 0.55, rPearsonallele1 = 0.65) (Fig. 2C and fig. S1D), whereas in 21-dpf disc1−/− animals, no correlation can be inferred from the data (Fig. 2D). This observation suggests that mutations might cause subtle changes in alignment dependent on proximity, which we explore further using a more targeted approach to extract alignment phenotypes, as described below in the OMR experiments.

In summary, the tendency of 7-dpf animals to move away from visual clutter and their enhanced alignment indices indicate that conspecific fish, even at this young age, interact with each other. This interaction precedes the well-described tendency to move toward clutter by 21 dpf (13). Notably, we could estimate the effects of mutations associated with human social disorders on behavior as early as 7 dpf, and these effects become more pronounced as animals mature.

Mutant larval zebrafish show specific changes in their ability to align with motion

Alignment among adult fish can arise from attraction and repulsion alone, and in many cases, it has been shown that an explicit alignment process is not required (9, 10, 12). However, explicit alignment reflexes, in particular to moving cues, are known to exist in larval fish (3739), and we therefore explored this possibility by analyzing such explicit responses to motion cues in mutant and wild-type strains. Larval zebrafish turn in response to motion of dots in their visual fields, which can be quantified by a coherent dot–based optomotor response (OMR) assay (39, 40). We, therefore, presented 7-dpf free-swimming individuals with clouds of flickering small dots that drifted either to the right or left, relative to their body orientation (Fig. 3A and movie S1). The limited lifetime and partial global coherence of these dots make it more challenging to identify motion direction, such that fish have to temporally integrate information to make appropriate swimming decisions (39, 40). These decisions can be quantified as a function of dot coherence, the proportion of swims following the direction of the motion stimulus (“probability correct”), and the time of quiescence between consecutive swims (“interbout interval”) (Fig. 3, B and C). We also estimated the probability of swimming in the same direction for consecutive bouts, even when not stimulated by motion drift, to assess the tendency of larval zebrafish to repeat the same motor action over extended periods of time (Fig. 3D and fig. S2, B and C) (41).

Fig. 3. Mutant 7-dpf larval zebrafish display differential integration and alignment phenotypes, which can be quantitatively captured by a simple integrator model.

Fig. 3.

(A) Experimental setup [adapted from (39)]. A single larval zebrafish swims freely on top of a projected cloud of randomly moving dots. Dots move continuously at different coherence levels either to the right or left relative to the body orientation of the animal (movie S1). (B) Probability to correctly align with the coherent motion stimulus as a function of coherence strength. Scn1laballele2+/− mutant fish (bright green) show improved performance relative to scn1laballele2+/+ wild-type sibling controls (dark green). Our data did not allow us to report a difference in performance of the disc1 mutant (magenta) compared to sibling controls (black). (C) Interbout interval as a function of coherence. Values are elevated for both mutants relative to wild-type sibling controls. (D) Tendency to turn in the same direction as a function of the time since the last bout during randomly flickering 0% coherence stimulation. Responses are elevated for the scn1laballele2 mutant relative to wild-type sibling controls. (E) Integrator model with decision threshold (T), perceptual noise (σ), leak time constant (τ), and probabilities to make a turn or swim forward (pabove and pbelow, depending on whether the integrated value is above or below the threshold). (F to H) Optimized model results, analyzed and displayed as in (B) to (D). The model accurately captures the behavioral features of both wild-type and mutant larvae. N = 44, 36, 21, and 16 individually tested fish for genotypes scn1laballele2+/+, scn1laballele2+/−, disc1+/+, and disc1−/−, respectively, in (B) to (D). N = 12 models (different optimization repeats) for each genotype in (F) to (H). Error bars in (B) to (D) and (F) to (H) are ± SEM.

We find that, compared to wild-type siblings, fish of both scn1lab+/− alleles have an increased probability of responding correctly as a function of coherence (two-sided PFisher ≈ 0.95,0.045,0.001, and 0.001, for coherences of 0, 25, 50, and 100%) and that they respond with longer delays as seen by increased interbout intervals (two-sided PFisher <1/100,000, for all coherences) (Fig. 3, B and C, and fig. S2). They also show an increased probability of turning in the same direction for consecutive bouts (two-sided PFisher ≈ 0.08,0.0001,0.0001,0.00001,0.00001, and 0.0004 for time delays of 0.125 to 1.375 s) (Fig. 3D). The disc1−/− mutants, on the other hand, differ only in having longer interbout intervals than do their wild-type siblings (two-sided PFisher ≈ 0.08,0.18,0.35, and 0.51, for coherences of 0, 25, 50, and 100%) (Fig. 3C). Turning distributions of mutant animals and sibling controls indicate an increase in turn angle compared to controls, for both scn1lab alleles for the highest coherence level (two-sided PFisher ≈ 0.0001,0.8, and 0.0002 for scn1laballele2, disc1, and scn1laballele1) (fig. S2C). Hence, mutations in both genes cause subtle differences in the animals’ ability to integrate information over time and to align with motion drift in their environment.

Drift-diffusion model for motion integration to explain alignment with motion cues

We have previously shown that the responses of individual larval zebrafish to coherent dot motion can be well described by the computational framework of a “drift-diffusion model” (DDM) (Fig. 3E) (42, 43). This model uses only five parameters: the internal noise (σ), integration and decay time constants (τ), decision thresholds (T), and two swimming probabilities (pbelow and pabove; see Methods) to fully describe the behavior. Notably, none of these parameters can be measured directly through experiments. We therefore resorted to a multiobjective fitting approach, which allowed us to automatically extract those values and systematically explore their variation due to the mutations (see figs. S3 and S4 and Methods). We show that this strategy quantitatively captures subtle behavioral features across the different mutants. For example, we find that, when compared to the respective sibling control animals, the threshold variable (T) decreases in scn1lab mutant fish, whereas it increases for the disc1 mutant (fig. S4B). Thus, modeling wild-type and mutant fish behavior exclusively based on the DDM with these extracted variables allowed us to test whether this framework is sufficient to explain the behavioral results.

We find that the model predicts most of the experimental data (Fig. 3, B to D and F to H, and fig. S3, B, C, E, and F), which suggests that the DDM provides an adequate framework to quantitatively describe alignment behavior in groups and that it is capable of reliably extracting hidden integration and decision-making variables in mutant animals. Furthermore, a quantitative evaluation of these behavioral variables allows us to make specific predictions about corresponding neural circuit changes in mutant animals (39, 40), and they can also provide the critical substrate for model simulations of fish in more complex scenarios (see below).

Models based on two simple reflexes explain emergent collective behavior

We tested whether the two basic reflexes, i.e., the “clutter response” (Fig. 1E) and the coherent moving dot response (cdOMR) (Fig. 3A), are sufficient, when applied to individual fish, to explain the different emergent behaviors of the groups. To that end, we simulated groups of five virtual fish swimming in a circular arena, in which each individual agent follows only the computations predicted by our two assays (Fig. 4A). The “clutter response computation” is the measurement of the clutter projected by the four conspecifics onto the left and right eyes. The “moving dot computation” measures the retinal motion component generated by all other fish (see Methods). Both signals are integrated over time and compared to the threshold, allowing the model to make decisions about whether to move forward or make turns, as described by the DDM model (see Fig. 3E and Methods). Using these two computations, we simulated swim trajectories of groups of 7-dpf and 21-dpf “virtual” fish (Fig. 4B and movies S2 and S3) and extracted aggregation and alignment indices, as done for groups of real fish (Fig. 1). Simulations corresponding to the different experimentally obtained variables and response curves revealed that the model produces results that qualitatively match the experimental findings: 7-dpf wild-type virtual larvae show a tendency to repel each other (with slightly negative aggregation indices), whereas 21-dpf virtual animals show strong aggregation behavior (Aggregation7 dpf = − 0.15 ± 0.11, Aggregation21 dpf = 0.98 ± 0.2) (Fig. 4C). Alignment indices increase from 7 to 21 dpf (Alignement7 dpf = 0.44 ± 0.025, Alignment21 dpf = 0.46 ± 0.023), as observed in the experimental results (Fig. 4D). Because we used the same cdOMR variables for 7- and 21-dpf simulations, this improvement in alignment is likely a consequence of the enhanced aggregation values in older animals, which leads to a more pronounced effect of visual motion cues and consequently stronger alignment (Fig. 1D). To further, and explicitly, probe the interdependence of aggregation and alignment, we asked how well each rule by itself predicts aggregation and alignment indices, respectively (Figs. 4C and 4D) and how they interact when combined. We find that aggregation indices are, as expected, dominated by the clutter response rule (although the addition of the motion response rule slightly enhances aggregation). Alignment indices, on the other hand, which depend predominantly on the motion response rule, are modulated and brought into far better agreement with observed data when the clutter response is added. Thus, the combination of the two attributes, clutter response and dot motion response, predicts that the reduced aggregation of 7-dpf fish will lead to weaker alignment, and the strong aggregation in 21-dpf animals will lead to stronger alignment, both results that are concordant with the experimental data.

Fig. 4. Simple visuomotor reflexes qualitatively predict emergent group behavior across genotypes and development.

Fig. 4.

(A) Schematic of the model using only two simple algorithmic rules: First, fish are repelled or attracted to visual clutter (see Fig. 1E). Second, fish use global motion cues for turning decisions (see Fig. 2, A and E). Both cues are integrated over time and evaluated according to our integrator model (Fig. 2E). Model parameters for the clutter response strength are directly extracted from group swimming experiments (Fig. 2, E and F). Model parameters for the integration and decision-making process are taken from our multiobjective parameter fitting results (fig. S4B). The model is hence almost fully constrained by experimental data. (B) Example trajectories of simulated wild type 7 and 21 dpf based on the rules shown in (A). (C and D) Aggregation and alignment for wild-type simulations for all possible rule combinations (neither rule, only motion, only clutter, or both rules) for 7- and 21-dpf model fish. Alignment does not emerge with attraction alone; it additionally requires animals to perform motion integration. Conversely, motion integration induces some level of aggregation. Parameters for wild-type animals are the same as for the sibling controls for all tested mutant lines. (E and F) Aggregation and alignment for 7- and 21-dpf mutant model fish with respective sibling controls (left) and the corresponding data of real fish (right; same data as in Fig. 2). Our model can qualitatively predict all group behavior phenotypes across ages as found in our experimental group assay (Fig. 2, A and B). N = 36 model simulations (each model uses different parameter sets, following our repeated model optimization; fig. S4B) in (C) and (D) and N = 12 model simulations for each genotype in (E) and (F). Experimental data in (E) and (F) are the same as in Fig. 2 (A and B).

We next used this modeling framework to simulate mutant animals, by combining both clutter and motion computations and using the model parameters that we extracted from our experimental assays for each genotype (Fig. 2, E and F, and figs. S1E and S4B). Here we find, also in agreement with the experimental data, that the tendency of 7-dpf wild-type virtual larvae to repel each other is enhanced in scn1lab+/− mutant fish and diminished in disc1−/− animals (Fig. 4E). This phenotype carries robustly into 21-dpf animals, where disc1−/− zebrafish show an increased aggregation phenotype compared to wild-type virtual siblings. The success of this minimal model in qualitatively reproducing the experimental results suggests that, at least in the larval animal, genetic effects upon just the two visual responses suffice to explain core attributes of the emergent behavior of the group.

DISCUSSION

Here, we find that even young larval zebrafish interact with each other and that their swimming dynamics are well predicted by two visual responses: the retinal clutter response and the OMR. These two visuomotor assays explore the tendency of fish to attract to each other and to align their swimming direction with motion cues, respectively, both key attributes of collective behaviors. We show that mutations in genes associated with autism and schizophrenia alter these two visual responses in subtle ways and that these changes are qualitatively predictive of emergent mutant shoaling and whole field motion alignment phenotypes. The effects of the two mutations on group dynamics can be detected in fish as young as 7 dpf, and they are qualitatively similar to the effects of the same mutations in groups of adult fish (24). Specifically, mutation of the scn1lab gene, the ortholog of which is associated with Dravet’s syndrome of childhood epilepsy and autism, causes fish to swim in a more dispersed fashion, and a mutation of disc1, associated with schizophrenia, causes fish to huddle more closely.

Larvae at 7 dpf do not aggregate into shoals or seek the vicinity of other fish (13, 30, 36), so responses to conspecific stimulation observed at this early age (32, 33) have been assumed to be unrelated to shoaling or schooling behavior. Here, we find that larval zebrafish repel, rather than attract, each other at this young age, which leads to a distinct global dispersion—or negative aggregation—phenotype. This repulsion phenotype switches to attraction with age, so that by 21 dpf, the animals tend to form more familiar aggregates and shoals (13, 36). Because 7-dpf larvae are not very motile and tend to live in protected areas with little water flow, this repulsion might assure them of sufficient oxygenation from relatively unstirred surroundings (44), and it might help them avoid frequent collisions in the cramped quarters typical for densely populated clutches. The switch to aggregation at 21 dpf likely helps keep groups of older animals together when they start exploring larger areas of their environment and when they begin swimming over longer distances. We also note an alignment tendency between fish, weak at 7 dpf and stronger at 21 dpf, which we cannot fully explain by the clutter response, and which we find better predicted by turning responses of the individual fish to fields of moving dots. In adult fish, it has been shown that alignment can emerge purely on the basis of attraction and repulsion algorithms (9, 10, 12), although some have also speculated a need for specific alignment forces between fish (14, 16).

The mutations do not appear to affect alignment among the fish in free-swimming groups. However, 21-dpf scn1lab+/− mutant fish did show a correlation of alignment with proximity (Fig. 2C), suggesting that these mutants might be more responsive to nearby moving stimuli. Adult scn1lab+/− mutant fish also exhibit enhanced alignment when swimming in close proximity (24). In the coherent dot assay, scn1lab+/− mutant fish align more accurately with moving dots than do their wild-type siblings. Thus, the cdOMR can serve as a powerful tool to uncover subtle differences in responses to motion in larvae.

To combine both visuomotor transformations into a unified model, we extracted the interocular retinal clutter difference, calculated an induced turning weight (see fig. S5 on the computation of turning weight), and fed that turning weight as an additional gain into the DDM as detailed for the cdOMR (Fig. 3E). We have chosen this particular implementation based on the physiological and anatomical evidence for a multimodal hindbrain integrator circuit. A particular cluster of neurons in the ventral hindbrain of larval zebrafish has been shown to receive multimodal information relevant to turning responses, including luminance information (45) and dot motion OMR (39, 40). These data make it plausible that integration of visual clutter and motion information also occurs in the same brain area.

Our model, which is based solely on these two simple visuomotor transformations, can account for a large fraction of the complex collective interactions that occur in groups. The model’s simplicity and its applicability even to 7-dpf larvae with their relatively simple and accessible brains make it a practical entry point to dissect the cellular nature of the algorithms that drive collective behaviors. Although fish have many sensory inputs that likely contribute to group behaviors, zebrafish are highly visual (39, 41, 46), suggesting that visual drives likely play a dominant role. Other sensory modalities, such as somatosensation through the lateral line (32, 33) and olfaction (26, 34), undoubtedly play roles in modulating social interactions, as might currently less decipherable elements such as “internal state” (2527) and “personality” (2831).

The specific genetic perturbations that we have studied are in genes related to human psychiatric disorders. The human SCN1A gene (the ortholog of the zebrafish scn1lab gene) is associated with Dravet’s syndrome (where patients have epilepsy and developmental disorders including autism), and DISC1 is associated with schizophrenia. Atypical visual reflexes, including the optokinetic response, have been noted in both autism and schizophrenia (47), and there is evidence for linkage between such perceptual differences and social abnormalities in autism (48). Perhaps reduction of complex behaviors to simple underlying reflexive motifs may help to characterize complex disorders. Quantitative characterization of changes in these reflexes in mutant zebrafish facilitates analysis of the underlying cellular defects and enables screens for therapeutics (49).

METHODS

Zebrafish

To generate larvae for sibling-controlled experiments, heterozygous fish were incrossed. For scn1lab experiments, the scn1lab+/− fish were crossed with AB wild type. Clutches were raised in small groups (20 to 30) in 15-cm petri dishes with fish facility water in 14-hour light, 10-hour dark cycle at constant 28°C. At 4 dpf, larvae were fed rotifers or paramecia daily with 50% water change. Behavior experiments were done at 7 and 21 dpf. All experiments followed protocols approved by the Harvard Institutional Animal Care and Use Committee.

Group assay

We used custom-designed experimental arenas of different sizes: diameter of 6.5 and 12.6 cm (for groups of 7- and 21-dpf fish) and height of 1 cm made of 1/16 inch (~1.59 mm) polyethylene terephthalate glycol plastic (PETG). Arenas had a flat bottom and curved walls to encourage fish to swim away from the walls and were sandblasted to prevent reflections. Every experimental arena was filmed using an overhead camera and lit from below using infrared light (same as in the dot motion assay). Images were acquired at ~39 fps and were segmented online to separate fish images from the background. The segmented images were then analyzed offline to extract continuous tracks of the fish [see (50) for details of segmentation and tracking algorithms]. All acquisition and online segmentation were performed using custom-designed software written in MATLAB.

Individual and group properties of free-swimming fish

We used the extracted center of mass position of every fish (fish i;xi) to calculate the velocity of the fish vi(t)=[xi(t+dt)xi(tdt)]/2dt, where dt is 1 frame or 0.025 s. The speed of the fish is then Si(t)=vi(t), and the direction of motion is di(t)=vi(t)/vi(t).

For the group, we calculate a normalized measure of group aggregation: Aggregation = − log (NN1/NN1shuffled), where NN1 is the average nearest neighbor distance. NN1shuffled is the same distance calculated from control groups created by shuffling fish between groups such that all fish in a shuffled group were chosen from different real groups. Positive aggregation values mean that real groups are more aggregated than shuffled controls, and 0 means aggregation occurred at random. Group alignment was defined as alignment(t)=iNdi(t)/N, where N is the number of fish in the group, and alignment value is bounded between 0, all fish are pointing in different directions, and 1, all fish swim in the same direction.

Estimating visual occupancy using ray casting

To estimate the visual angle that each neighbor in the group cast on the eye of a focal fish (fish i), we cast 1000 rays from each eye spanning 165° from the direction of motion toward the back of the fish, leaving a total of 30° of blind angle behind the fish. This amounts to an angular resolution of ~0.165° per line. We then detected all pixel values representing fish in the paths of the rays and calculated the visual angle occupied by each fish and the total visual angle experienced by each eye (Fig. 1E).

Statistical analysis

We compared groups’ aggregation and alignment to the estimated “baseline” level obtained from shuffled groups (Fig. 1C) (see below), using a bootstrapping procedure (51). We estimated the sampling distribution based on the experimental sample by sampling with replacement N groups of five fish from the data 100,000 times. We constructed 95% BIs for the average statistic of these groups (i.e., alignment or aggregation) and also reported the associated Pbootstrap by inverting these intervals.

We also compared group aggregation and alignment between wild-type 7- and 21-dpf zebrafish. Here, we used groups of five zebrafish, which we denote by “j.” Let Aj denote the age of group j, where Aj = 0 for a 7-dpf group and Aj = 1 for a 21-dpf group, and assume a completely randomized assignment of the group age status. For each group j, we measure an outcome Yj, such as group aggregation or group alignment. We denote Yj(Aj = 0) the potential outcome had group j been 7 dpf and Yj(Aj = 1) the potential outcome had group j been 21 dpf. We test the sharp null hypothesis stating that, for each group j, the potential outcomes are equal, that is, Yj(Aj = 0) = Yj(Aj = 1). We choose Welch’s statistic (TWelch) as our test statistic. Following the procedure initially described in (52) and recently by various statisticians (5355), we calculated two-sided Fisher P values (or approximated ones based on 100,000 randomized allocations).

To estimate the turning response probability (Figs. 1E and 2, E and F), we calculated the proportion of right turns out of all turns (left + right turns) recorded for a given difference in clutter between the left and right visual field (discretized into 5° bins). Because the number of observation in each bin was too large for calculating the exact binomial, the CI around this point estimate was calculated using the normal approximation of the binomial distribution: p±z±1.96·p·(1p)n, where p is p(turn right), z±1.96 are the z scores defining the upper and lower bound containing 95% of a standard normal distribution, and n is the number of turns in a given bin. This estimation was performed independently for each bin, and the uncertainty region is shown as a continuous surface within the plots by connecting the edges of the individual estimates.

CIs for linear regression models (Figs. 1D and 2, C and D) were calculated as follows: CIi=yi±t(0.95,n2)·Sesty1n+(xix¯)2Σi(xix¯)2where yi′ is the regression value at point xi, t(0.95, n − 2) denote the upper and lower bounds comprising 95% of a Student’s t distribution with n − 2 df, and Sesty=Σi(yiy¯)2n2, where x¯ and y¯ are the averages of variables x and y. The uncertainty region is shown as a continuous surface within the plots by connecting the edges of the pointwise estimates.

We examined whether single-gene mutations in scn1lab and disc1 have an effect on group aggregation and alignment phenotypes measured at 7 dpf and at 21 dpf (Fig. 2). We used groups of five zebrafish of the same mutant type, which we denote by j. Let Gj denote the mutation status of group j, where Gj = 0 for a wild-type group and Gj = 1 for a mutant group, and assume a completely randomized assignment of the group mutation status. For example, Gj = 0 for a group of five scn1laballele2+/+ fish and Gj = 1 for a group of five scn1laballele2+/− fish. For each group j, we measure an outcome Yj, such as group aggregation or group alignment. We denote Yj(Gj = 0) the potential outcome had group j been wild type and Yj(Gj = 1) the potential outcome had group j been mutant. We test the sharp null hypothesis stating that, for each group j, the potential outcomes are equal, that is, Yj(Gj = 0) = Yj(Gj = 1). We use TWelch as our test statistic. For the aggregation phenotype, we calculated one-sided Fisher P values capitalizing on the results from (24); for the alignment phenotype, we calculated two-sided Fisher P values.

Using individual 7-dpf zebrafish in a cdOMR assay (Fig. 3), we also examined whether single-gene mutations in scn1lab and disc1 have an effect on alignment. Here, we denote an experimental zebrafish unit by “i” and its mutation status by Gi, where Gi = 0 for wild type and Gi = 1 for mutant, and assume a completely randomized assignment of the individual zebrafish mutation status. For each zebrafish i, we measure an outcome Yi, such as probability correct, interbout interval, or probability to turn in the same direction. We denote Yi(Gi = 0) the potential outcome had zebrafish i been wild type and Yi(Gi = 1) the potential outcome had zebrafish i been mutant. We test the sharp null hypothesis stating that, for each zebrafish i, the potential outcomes are equal, that is, Yi(Gi = 0) = Yi(Gi = 1). We chose TWelch as our test statistic and calculated two-sided Fisher P values (or approximated ones based on 100,000 randomized allocations). Using this method, we compared the probability of correct turns, the interbout interval, and the integral of estimated turning distribution (turn angles of >20°) for 0, 25, 50, and 100% coherence levels. In addition, we also compared the probability of the fish to turn in the same direction 0.125 to 1.375 s after a swim bout during 0% coherent motion (Fig. 3D). For each of these measured phenotypes, we estimated two-sided Fisher P values as described above.

To report a measure of effect size in Figs. 1 and 2, we chose the commonly used Cohen’s d (56). In the case of a two-sample statistical model, d=(x¯1x¯2)Sp, where x¯1 and x¯2 are the means of the two groups, and Sp is the pooled estimate of the SD of the two groups. In the case of a one-sample statistical model, we used d=(x¯1μ0)S1, where μ0 is the estimate of the mean of null distribution or the estimated baseline that we compared to. None of the reported P values and CIs were adjusted for multiple comparisons.

Motion assay

The assay has been described previously (39). In brief, 7-dpf larvae were placed in custom-designed acrylic dishes (12 cm diameter, 5 cm height, black rim, and transparent bottom). The scene is illuminated from below with infrared light-emitting diode panels (940 nm, Cop Security). The fish are tracked with a camera (Grasshopper 3), a zoom lens (Zoom 7000, 18 to 108 mm, Navitar), and a long-pass filter (R72, Hoya). Posture analysis is performed in real time using custom-written software using Python 3.7 and OpenCV 4.1. Stimuli were presented from below (Aaxa P300 Pico Projector) onto mildly scattering parchment paper and consisted of ~1000 small (2-mm) white dots on a black background. We showed 0% coherence as a baseline stimulus for 5 s and then switched to (25, 50, or 100%) coherent motion at a constant speed (1.8 cm/s) for 10 s. Motion either went rightward or leftward relative to the body orientation of the fish. Each dot persisted for only 200 ms on average and stochastically disappeared and reappeared at a new location, so as to prevent fish from tracking individual dots. Following the coherent stimulus, the stimulus reverted to 0% coherence baseline.

Genotyping

For group assays (Figs. 1 and 2 and fig. S1), fish were genotyped at 2 to 3 dpf using Zebrafish Embryonic Genotyper (wFluidx) or fin clipping and high-resolution melt analysis (HRM; primer sequences in table S1). Following all experiments, genotypes are confirmed by HRM following DNA extraction using hot shot genomic DNA preparation. Briefly, whole larvae are dissolved in 25 μl of alkaline solution (25 nM NaOH and 0.2 mM Na2 EDTA) for 1 hour at 95°C, and an equal volume of neutralizing solution (40 mM tris-HCl) is added afterward. The genomic preparation is diluted 1:20 before HRM.

Drift-diffusion model

To better understand the origin of the observed behavioral phenotypes during motion integration, we use computational modeling. This approach provides us with a more detailed characterization of the behavior and allows us to indirectly infer how a mutation affects specific components of the sensory-motor transformation algorithm.

Previous work indicated that a simple DDM with a decision threshold can explain many aspects of the responses to the dot motion stimulus [Fig. 3E and fig. S3, A and B; (39, 40)]. The model is based on the temporal integration of noisy [drawn from a Gaussian distribution N(0, σ)] motion evidence with certain coherence levels C(t). The integrator is leaky, and therefore, its signal X(t) increases slowly with a time constant (τ) when the motion stimulus starts and decays with the same dynamics when it stops

τ·dX(t)dt=C(t)X(t)+N(0,σ)

We solved this equation by using Euler’s method

τ·ΔX/Δt=C(t)X(t)+N(0,σ)
ΔX=(C(t)X(t)+N(0,σ))·Δt/τ
X(t+1)=X(t)+ΔX

Notably, we chose the same dt = 0.01 in all our model simulations (also see the agent-based model below). This was important as the noise term N(0, σ) in our stochastic differential equation would have a different influence on our results, depending on the choice of dt. This problem can be resolved by scaling σ by dt, which we did not do in our simulations. Therefore, the values of σ displayed in fig. S4B should be interpreted in the context of dt. In our model, fish swim spontaneously with two different probabilities. When the integrated motion evidence X(t) is below the decision threshold (T), animals swim forward with a probability of pbelow. When it is above the threshold, they make a turn with a probability of pabove. The exact values of these probabilities indicate whether fish will initiate a swim event within a time step dt of our stochastic differential equation stimulation or not. In case of such events, forward swim heading angle changes were drawn from a Gaussian distribution N(0,5), while turning angle changes were drawn from a Gaussian distribution N( ±22,25), following the general shape of the measured heading angle change distributions (fig. S2C). Notably, none of the underlying five model parameters can be measured directly through behavioral experiments, requiring us to resort to an indirect method, a multiobjective fitting strategy.

Multiobjective fitting algorithm

To uncover latent changes within the motion-integrating and decision-making circuits, we modified an evolutionary multiobjective optimization technique that can find the same global minimum and the same parameter set over repeated optimization runs (fig. S3C) (57, 58). This approach has been used in the past to solve highly nonlinear models that require multiple behavioral features to be optimized simultaneously (59, 60). One starts with a population of randomly chosen parameter sets (800 individuals in our case). Each parameter set gets evaluated, producing five behavioral features: (i) the probability to turn in the correct direction as a function of coherence (Fig. 3B), (ii) the interbout interval as a function of coherence (Fig. 3C), (iii) the probability to turn in the same direction for consecutive swims during 0% coherence (Fig. 3D), (iv) the binned probability to turn in the correct direction as a function of time and coherence (fig. S2B), and (v) the turn angle probability distribution (fig. S2, C and D). For features (i) to (iv), the algorithm computes the mean squared error (MSE) between model simulation results and experimental data. For feature (v), we determined the distance between model and experiment using a Gaussian mixture model approach: We first fitted each probability distribution with three overlapping Gaussian functions (one for left turns, one for right turns, and one for forward swims). We then computed the MSE between the weights (peak heights) of the three resulting Gaussian functions. We also performed model optimizations with alternative distance metrics, such as the mean squared logarithmic error, leading to comparable results. Using these five distance functions, the multiobjective algorithm then chooses which individuals are mutated and which ones will exchange parameter information, using crossover, to build the next generation.

We first sought to test that the used multiobjective optimization algorithm, a Python-based open-source package called pymoo (version 0.4), works as expected. To this end, we inspected the evolution of Pareto fronts during the optimization procedure. We found that all tested pairs of distances approached the origin (0, 0) of the coordinate system and that the distribution of individuals covered increasingly more space of the error landscape over generations. We then tested the algorithm on artificially created surrogate datasets (fig. S3, D to H), where we explicitly selected certain hidden variables. The extent of their successful recovery allows for a quantitative evaluation of the multiobjective optimization technique. Using a set of parameters closely following our recently hand-tuned parameter set (39), we find that the five extracted behavioral features generally capture what we find in the experiment (compare Fig. 3, B to D, and figs. S2, B and C, and S3D). After a few generations, the optimization algorithm was able to identify individuals that had near-zero error in at least one of the behavioral features. Last, to assign a compromise error value to each individual, we computed a weighted sum of the five normalized distance functions. To correct for the fact that each distance function has its own scale and unit, we first normalized values using the 75th percentile of the distribution of error values, which brought all distributions into a comparable range. As we consider the interbout interval as the most important behavioral feature that our model should definitely capture, we next multiplied the weight for the interbout interval distance function by 3; for all other distance functions, we used a weight of 1.

It took about 80 generations for this compromise error function to converge (fig. S3E). Notably, our algorithm does not find individuals with exactly zero error. This is expected as our simulation is stochastic and therefore does not produce the exact same behavior in every stimulation run. We repeated the optimization algorithm 12 times for four models with different parameter sets (fig. S3F). For each of the runs and models, we find that the algorithm successfully reduces the five error functions as well as the compromise error. At the end of each optimization run, we then picked the one individual with the smallest compromise error value and compared its parameter values to the parameters originally used to create the surrogate dataset (fig. S3G). We find that our algorithm can reveal these values and that repeated optimization runs produce more or less the same results. Looking at one of those optimized models, we confirm that the behavioral features do closely resemble the ones from the original dataset (fig. S3H). In summary, we conclude that our multiobjective evolutionary optimization is capable of extracting the hidden variables in our motion integration and decision-making model.

DDM parameters extracted from motion integration assay

Knowing that our multiobjective fitting algorithm can reveal the latent variables in our DDM, we next applied this strategy to real experimental behavioral data of larval fish with different genotypes. For all tested genotypes, the optimization algorithm produces behavioral dynamics closely mimicking the ones found in experiments (compare Fig. 3, B to D and F to H, and fig. S2, B to D and F to H). We repeated the optimization algorithm 12 times for each dataset. We find solutions to have similarly small error values (fig. S4A) and that the estimated model parameters are more or less identical after each run (fig. S4B).

Collective behavior model

We simulated groups of five fish freely swimming in a circular arena. The arena was modeled with a diameter of 1024 pixels. Each fish had a random starting position (x and y) and orientation in the arena and length of fishsize = 20 pixels. At every time point during the simulation, fish made swimming decisions based on two simple sensory-motor transformation rules: the tendency to avoid or approach clutter and the tendency to align with global motion drift.

To compute clutter, we determined how much space another fish (fish i) occupies in the visual field of the focal fish (fish j) and added all values from the right hemisphere and subtracted all values from the left hemisphere

Perceived clutterj(t)=ijNhemisphereweight·2·arctan(fishsize/2·di,j)

where di,j=((xixj)2+(yiyj)2) is the Euclidean distance between animal pairs and where hemisphereweight was either +1 or −1, depending on whether fish i was in the right or left hemisphere relative to the orientation of fish j. N is the number of fish (= 5 fish in our simulations). Hence, the sign and amplitude of the resulting signal reflect the asymmetry perceived by the focal fish.

To compute the perceived motion force [perceived motionj(t)] by the focal fish (fish j), we first performed projections of the motion vectors of all other fish (fish i) onto its circular field of view (fig. S5, A and B). As the vector length of the fish i is proportional to its momentary swim speed v(t), fast-swimming fish will produce a larger projection arc than slowly swimming fish. Notably, if fish i moves in the front or in the back of the focal fish (fish j), even when it moves in the same direction, this type of radial projection will produce different signs, which is not realistic. For example, when the other fish is in the front, moving left, the sign will be positive (projection arc is counterclockwise). When it is in the back, moving left, the sign will be negative (projection arc is clockwise). To correct this problem, we sign-inverted all projections where the other fish i started in the back of the focal fish j. Last, we multiplied these projections with a weight, depending on where on the retina the image is projected (fig. S5C). Our projections guarantee four important properties: (i) If the other fish approaches the focal fish directly—resembling a looming stimulus—or if it radially recedes, we will not obtain a motion force. This is biologically plausible because such stimuli would not specifically activate circuits tuned to object or global motion (fig. S5A). (ii) Motion force transitions between the back and the front are smooth. This is important as, otherwise, moving objects crossing this line would produce a sudden discontinuity in the motion force. (iii) Fish moving in parallel to the focal fish will not produce turning forces (fig. S5A). (iv) Movements in the distance will produce smaller motion forces than proximal ones.

To obtain the total momentary perceived evidence for fish j, we simply added the values for clutter and motion

Sensory evidencej(t)=wclutter·fclutter·perceived clutterj(t)+wmotion·perceived motionj(t)

where wclutter is the weight of the clutter system, fclutter is the genotype- and age-dependent factor of the clutter system, and wmotion is the weight of the motion system.

Following our DDM (Fig. 3E), we integrated this value over time. Accordingly, when the integrated value was between the positive and negative thresholds, animals swam forward; when it was above the positive threshold, they turned to the right, and when it was below the negative threshold, they turned to the left. When swimming forward, animals covered 20 pixels per bout (about one body length) along their momentary axis of orientation. Moreover, animals stochastically changed their body orientation by a bit. Following the experimentally measured heading angle change distributions (fig. S2C), we drew those angles from a Gaussian distribution centered at 0° with an SD of 5°. Similarly, for initiating right or left turns, we drew angles from a Gaussian distribution centered at 22° or −22°, respectively, with an SD of 25° (fig. S2C). To capture the length and short gliding phase of forward swims and turns, we applied a low-pass filter with a time constant of 100 ms to these events, resulting in bout-like animal movement.

Notably, wclutter and wmotion are the only free parameters of our model, and all other parameters are directly extracted from experimental data. Although tweaking those values would likely have resulted in overall improved model performance, we wanted to work with the most minimal model and, therefore, simply set both weights to 1. We further chose fclutter for the 7-dpf scn1laballele2+/+ wild type to be −1, which reproduced the weak avoidance and alignment of 7-dpf scn1laballele2+/+ wild-type larvae. The values for fclutter for the other genotypes and ages were then scaled according to the experimentally measured probability to turn toward clutter (Fig. 2, E and F, and fig. S1E). For example, the clutter response strength for the 7-dpf scn1laballele2+/− was twice as strong as the one for the 7-dpf scn1laballele2+/+. Hence, for this genotype, we scaled fclutter to −2. The clutter response of 21-dpf scn1laballele2+/+ fish was positive and about three times as strong in amplitude as the one for 7-dpf scn1laballele2+/− larvae. Hence, we scaled this value to +3. This procedure led to the following clutter response factors for the 7-dpf animals: scn1laballele2+/+: −1; scn1laballele2+/−: −2; scn1laballele1+/+: −1; scn1laballele1+/+: −1.5; disc+/+: −2; disc−/−: −1.5. For the 21-dpf animals, we obtained the following: scn1laballele2+/+: +3; scn1laballele2+/−: +3; scn1laballele1+/+: +3; scn1laballele1+/+: +2; disc+/+: +1; disc−/−: +2.

For all other parameters of our model (time constant, τ; noise, σ; decision threshold, T; swim probabilities below and above the threshold, pbelow and pabove), we chose exactly the results obtained from the multiobjective fitting procedure (fig. S4B). For testing the clutter or motion systems in isolation (Fig. 4, C and D), we simply set the weight of the respective other system to zero. Every time when an animal reached the circular border of the arena, we picked a new random orientation vector. We did not reflect or wrap trajectories across the border. We simulated the collective behavior model for 600 s with a time step of dt = 0.01 using the forward Euler method (see DDM above). We used Python 3.8 and the real-time compiler Numba. We stored the resulting trajectories in the exact same format as used for our experimental data, allowing us to use the same analysis scripts to extract values for aggregation and alignment (Fig. 1). The simulation source code is available online:

https://github.com/arminbahl/mutant_zebrafish_behavior.

Acknowledgments

We thank J. D. Davidson and M.C.F.’s and F.E.’s laboratory members for discussion and advice. We thank C. Santoriello for technical and logistical support in addition to discussion and advice. We thank I. Couzin, K. Herrera, M. Haesemeyer, and K. Vogt for critical reading of the manuscript and constructive feedback. Finally, we would like to thank Ed Soucy and Brett Graham from the neuroengineering core facility at the Center for Brain Science at Harvard for their technical support. Funding: This work was supported by a grant from Fidelity Biosciences Research Initiative and sponsored research support from NIBR to M.C.F. F.E. received funding from the NIH (U19NS104653, R43 OD024879, 2R44OD024879, and DP5OD021412), the NSF (IIS-1912293), and the Simons Foundation (SCGB 542973). A.B. acknowledges support from the Deutsche Forschungsgemeinschaft (German Research Foundation) under Germany’s Emmy Noether Program (BA 5923/1-1) and Excellence Strategy (EXC 2117-422037984) as well as from the Zukunftskolleg Konstanz. Author contributions: R.H., A.C.A., and A.B. helped to design the experiments and performed experiments, analysis, modeling, and manuscript writing. S.C. and S.T. performed behavioral experiments. M.-A.B. performed statistical analysis and contributed to manuscript writing. F.E. and M.C.F. helped to design and interpret experiments and contributed to writing and editing of the manuscript. Competing interests: The authors declare that they have no competing interests. Data and materials availability: All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials. All raw data used in the manuscript are available upon request from the authors.

Supplementary Materials

This PDF file includes:

Table S1

Figs. S1 to S5

Other Supplementary Material for this manuscript includes the following:

Movies S1 to S3

View/request a protocol for this paper from Bio-protocol.

REFERENCES AND NOTES

  • 1.C. Darwin, The descent of Man, and Selection in Relation to Sex (Princeton Univ. Press, 1981). [Google Scholar]
  • 2.Ioannou C. C., Guttal V., Couzin I. D., Predatory fish select for coordinated collective motion in virtual prey. Science 337, 1212–1215 (2012). [DOI] [PubMed] [Google Scholar]
  • 3.Ioannou C. C., Morrell L. J., Ruxton G. D., Krause J., Bolnick D. I., Geber M. A., The effect of prey density on predators: Conspicuousness and attack success are sensitive to spatial scale. Am. Nat. 173, 499–506 (2009). [DOI] [PubMed] [Google Scholar]
  • 4.Krause J., Hartmann N., Pritchard V. L., The influence of nutritional state on shoal choice in zebrafish,Danio rerio. Anim. Behav. 57, 771–775 (1999). [DOI] [PubMed] [Google Scholar]
  • 5.Torney C. J., Berdahl A., Couzin I. D., Signalling and the evolution of cooperative foraging in dynamic environments. PLoS Comput. Biol. 7, e1002194 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Harpaz R., Schneidman E., Social interactions drive efficient foraging and income equality in groups of fish. eLife 9, e56196 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Krause J., Differential fitness returns in relation to spatial position in groups. Biol. Rev. Camb. Philos. Soc. 69, 187–206 (1994). [DOI] [PubMed] [Google Scholar]
  • 8.Li L., Nagy M., Graving J. M., Bak-Coleman J., Xie G., Couzin I. D., Vortex phase matching as a strategy for schooling in robots and in fish. Nat. Commun. 11, 5408 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Bastien R., Romanczuk P., A model of collective behavior based purely on vision. Sci. Adv. 6, 1–9 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Katz Y., Tunstrom K., Ioannou C. C., Huepe C., Couzin I. D., Inferring the structure and dynamics of interactions in schooling fish. Proc. Natl. Acad. Sci. U.S.A. 108, 18720–18725 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Strandburg-Peshkin A., Twomey C. R., Bode N. W. F., Kao A. B., Katz Y., Ioannou C. C., Rosenthal S. B., Torney C. J., Wu H. S., Levin S. A., Couzin I. D., Visual sensory networks and effective information transfer in animal groups. Curr. Biol. 23, R709–R711 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.D’Orsogna M. R., Chuang Y. L., Bertozzi A. L., Chayes L. S., Self-propelled particles with soft-core interactions: Patterns, stability, and collapse. Phys. Rev. Lett. 96, 104302 (2006). [DOI] [PubMed] [Google Scholar]
  • 13.Hinz R. C., de Polavieja G. G., Ontogeny of collective behavior reveals a simple attraction rule. Proc. Natl. Acad. Sci. U.S.A. 114, 2295–2300 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Heras F. J. H., Romero-Ferrero F., Hinz R. C., de Polavieja G. G., Deep attention networks reveal the rules of collective motion in zebrafish. PLoS Comput. Biol. 15, e1007354 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Herbert-Read J. E., Perna A., Mann R. P., Schaerf T. M., Sumpter D. J. T., Ward A. J. W., Inferring the rules of interaction of shoaling fish. Proc. Natl. Acad. Sci. U.S.A. 108, 18726–18731 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 16.Calovi D. S., Litchinko A., Lecheval V., Lopez U., Pérez Escudero A., Chaté H., Sire C., Theraulaz G., Disentangling and modeling interactions in fish with burst-and-coast swimming reveal distinct alignment and attraction behaviors. PLoS Comput. Biol. 14, e1005933 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Aoki I., A simulation study on the schooling mechanism in fish. Nippon Suisan Gakkaishi 48, 1081–1088 (1982). [Google Scholar]
  • 18.Couzin I. D., Krause J., James R., Ruxton G. D., Franks N. R., Collective memory and spatial sorting in animal groups. J. Theor. Biol. 218, 1–11 (2002). [DOI] [PubMed] [Google Scholar]
  • 19.Huth A., Wissel C., The simulation of fish schools in comparison with experimental data. Ecol. Model. 75-76, 135–146 (1994). [Google Scholar]
  • 20.Huth A., Wissel C., The simulation of the movement of fish schools. J. Theor. Biol. 156, 365–385 (1992). [Google Scholar]
  • 21.Wright D., Nakamichi R., Krause J., Butlin R. K., QTL analysis of behavioral and morphological differentiation between wild and laboratory zebrafish (Danio rerio). Behav. Genet. 36, 271–284 (2006). [DOI] [PubMed] [Google Scholar]
  • 22.Kowalko J. E., Rohner N., Rompani S. B., Peterson B. K., Linden T. A., Yoshizawa M., Kay E. H., Weber J., Hoekstra H. E., Jeffery W. R., Borowsky R., Tabin C. J., Loss of schooling behavior in cavefish through sight-dependent and sight-independent mechanisms. Curr. Biol. 23, 1874–1883 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Wark A. R., Greenwood A. K., Taylor E. M., Yoshida K., Peichel C. L., Heritable differences in schooling behavior among threespine stickleback populations revealed by a novel assay. PLOS ONE 6, e18316 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 24.Tang W., Davidson J. D., Zhang G., Conen K. E., Fang J., Serluca F., Li J., Xiong X., Coble M., Tsai T., Molind G., Fawcett C. H., Sanchez E., Zhu P., Couzin I. D., Fishman M. C., Genetic control of collective behavior in zebrafish. iScience 23, 100942 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Filosa A., Barker A. J., Maschio M. D., Baier H., Feeding state modulates behavioral choice and processing of prey stimuli in the zebrafish tectum. Neuron 90, 596–608 (2016). [DOI] [PubMed] [Google Scholar]
  • 26.Wee C. L., Song E., Nikitchenko M., Wong S., Engert F., Kunes S., Social isolation modulates appetite and defensive behavior via a common oxytocinergic circuit in larval zebrafish. bioRxiv 2020.02.19.956854 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Wee C. L., Song E. Y., Johnson R. E., Ailani D., Randlett O., Kim J.-Y., Nikitchenko M., Bahl A., Yang C.-T., Ahrens M. B., Kawakami K., Engert F., Kunes S., A bidirectional network for appetite control in larval zebrafish. eLife 8, e43775 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Tunbak H., Vazquez-Prada M., Ryan T. M., Kampff A. R., Dreosti E., Whole-brain mapping of socially isolated zebrafish reveals that lonely fish are not loners. eLife 9, e55863 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Guayasamin O. L., Couzin I. D., Miller N. Y., Behavioural plasticity across social contexts is regulated by the directionality of inter-individual differences. Behav. Process. 141, 196–204 (2017). [DOI] [PubMed] [Google Scholar]
  • 30.Dreosti E., Lopes G., Kampff A. R., Wilson S. W., Development of social behavior in young zebrafish. Front. Neural Circ. 9, 39 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Jolles J. W., Boogert N. J., Sridhar V. H., Couzin I. D., Manica A., Consistent individual differences drive collective behavior and group functioning of schooling fish. Curr. Biol. 27, 2862–2868.e7 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32.Anneser L., Alcantara I. C., Gemmer A., Mirkes K., Ryu S., Schuman E. M., The neuropeptide Pth2 dynamically senses others via mechanosensation. Nature 588, 653–657 (2020). [DOI] [PubMed] [Google Scholar]
  • 33.Groneberg A. H., Marques J. C., Martins A. L., Diez Del Corral R., de Polavieja G. G., Orger M. B., Early-life social experience shapes social avoidance reactions in larval zebrafish. Curr. Biol. 30, 4009–4021.e4 (2020). [DOI] [PubMed] [Google Scholar]
  • 34.Jesuthasan S., Krishnan S., Cheng R.-K., Mathuru A., Neural correlates of state transitions elicited by a chemosensory danger cue. Prog. Neuro-Psychopharmacol. Biol. Psychiatry, 110110 (2020). [DOI] [PubMed] [Google Scholar]
  • 35.Ahrens M. B., Engert F., Large-scale imaging in small brains. Curr. Opin. Neurobiol. 32, 78–86 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 36.Larsch J., Baier H., Biological motion as an innate perceptual mechanism driving social affiliation. Curr. Biol. 28, 3523–3532.e4 (2018). [DOI] [PubMed] [Google Scholar]
  • 37.Orger M. B., Kampff A. R., Severi K. E., Bollmann J. H., Engert F., Control of visually guided behavior by distinct populations of spinal projection neurons. Nat. Neurosci. 11, 327–333 (2008). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 38.Naumann E. A., Fitzgerald J. E., Dunn T. W., Rihel J., Sompolinsky H., Engert F., From whole-brain data to functional circuit models: The zebrafish optomotor response. Cell 167, 947–960.e20 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Bahl A., Engert F., Neural circuits for evidence accumulation and decision making in larval zebrafish. Nat. Neurosci. 23, 94–102 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40.Dragomir E. I., Štih V., Portugues R., Evidence accumulation during a sensorimotor decision task revealed by whole-brain imaging. Nat. Neurosci. 23, 85–93 (2020). [DOI] [PubMed] [Google Scholar]
  • 41.Dunn T. W., Mu Y., Narayan S., Randlett O., Naumann E. A., Yang C.-T., Schier A. F., Freeman J., Engert F., Ahrens M. B., Brain-wide mapping of neural activity controlling zebrafish exploratory locomotion. eLife 5, e12741 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Shadlen M. N., Kiani R., Decision making as a window on cognition. Neuron 80, 791–806 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43.Ratcliff R., Smith P. L., Brown S. D., McKoon G., Diffusion decision model: Current issues and history. Trends Cogn. Sci. 20, 260–281 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 44.Green M. H., Ho R. K., Hale M. E., Movement and function of the pectoral fins of the larval zebrafish (Danio rerio) during slow swimming. J. Exp. Biol. 214, 3111–3123 (2011). [DOI] [PubMed] [Google Scholar]
  • 45.Wolf S., Dubreuil A. M., Bertoni T., Böhm U. L., Bormuth V., Candelier R., Karpenko S., Hildebrand D. G. C., Bianco I. H., Monasson R., Debrégeas G., Sensorimotor computation underlying phototaxis in zebrafish. Nat. Commun. 8, 651 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46.Dunn T. W., Gebhardt C., Naumann E. A., Riegler C., Ahrens M. B., Engert F., Del Bene F., Neural circuits underlying visually evoked escapes in larval zebrafish. Neuron 89, 613–628 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47.Robertson C. E., Martin A., Baker C. I., Baron-Cohen S., Atypical integration of motion signals in autism spectrum conditions. PLOS ONE 7, e48173 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48.Bolis D., Schilbach L., Observing and participating in social interactions: Action perception and action control across the autistic spectrum. Dev. Cogn. Neurosci. 29, 168–175 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 49.Peterson R. T., Fishman M. C., Designing zebrafish chemical screens. Methods Cell Biol. 105, 525–541 (2011). [DOI] [PubMed] [Google Scholar]
  • 50.Harpaz R., Tkačik G., Schneidman E., Discrete modes of social information processing predict individual behavior of fish in a group. Proc. Natl. Acad. Sci. U.S.A. 114, 10149–10154 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 51.Efron B., Bootstrap methods: Another look at the Jackknife. Ann. Stat. 7, 1–26 (1979). [Google Scholar]
  • 52.R. A. Fisher, Statistical Methods for Research Workers (Oliver and Boyd, Edinburgh Statistical Methods for Research Workers, ed. 11 rev, 1925), vol. 11. [Google Scholar]
  • 53.G. W. Imbens, D. B. Rubin, Causal Inference in Statistics, Social, and Biomedical Sciences (Cambridge Univ. Press, 2015). [Google Scholar]
  • 54.R. H. Lock, P. F. Lock, K. L. Morgan, E. F. Lock, D. F. Lock, Statistics: Unlocking the Power of Data (John Wiley & Sons, 2020). [Google Scholar]
  • 55.Bind M.-A. C., Rubin D. B., When possible, report a Fisher-exact P value and display its underlying null randomization distribution. Proc. Natl. Acad. Sci. U.S.A. 117, 19151–19158 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 56.D. C. Howell, Statistical Methods for Psychology (Cengage Learning, 2012). [Google Scholar]
  • 57.Blank J., Deb K., Pymoo: Multi-objective optimization in Python. IEEE Access 8, 89497–89509 (2020). [Google Scholar]
  • 58.K. Deb, Multi-Objective Optimization Using Evolutionary Algorithms (John Wiley & Sons, 2001). [Google Scholar]
  • 59.Bahl A., Stemmler M. B., Herz A. V. M., Roth A., Automated optimization of a reduced layer 5 pyramidal cell model based on experimental data. J. Neurosci. Methods 210, 22–34 (2012). [DOI] [PubMed] [Google Scholar]
  • 60.Druckmann S., Banitt Y., Gidon A., Schürmann F., Markram H., Segev I., A novel multiple objective optimization framework for constraining conductance-based neuron models by experimental data. Front. Neurosci. 1, 7–18 (2007). [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Table S1

Figs. S1 to S5

Movies S1 to S3


Articles from Science Advances are provided here courtesy of American Association for the Advancement of Science

RESOURCES