“Quantitative analysis reveals the basic behavioural repertoire of the urochordate Ciona intestinalis”

Quantitative analysis of animal behaviour in model organisms is becoming an increasingly essential approach for tackling the great challenge of understanding how activity in the brain gives rise to behaviour. In addition, behavioural analysis can provide insight on the molecular basis of nervous system development and function as demonstrated by genetic screens focused on behavioural phenotyping in some genetically tractable model organisms. The progress in building low-cost automated tracking setups, together with advances in computer vision machine learning have expanded the repertoire of organisms which are amenable to quantitative behavioural analysis. Here we used automated image-based tracking to extract behavioural features from an organism of great importance in understanding the evolution of chordates, the free swimming larval form of the tunicate Ciona intestinalis which has a compact and fully mapped nervous system composed of only 231 neurons. We analysed hundreds of videos of larvae and we extracted basic geometric and physical descriptors of larval behaviour. Most importantly, we used machine learning methods to create an objective ontology of behaviours for C. intestinalis larvae. We identified eleven behavioural modes using agglomerative clustering. This approach enabled us to produce a quantitative description of the basic larval behavioural repertoire. Furthermore, we tested the robustness of this repertoire by comparing different rearing conditions and ages. Using our pipeline for quantitative behavioural analysis, we successfully reproduced the known photoresponsive behaviour and the first demonstration to our knowledge that C. intestinalis larvae exhibit sensory arousal and thigmotaxis, both of which can be modulated by the anxiotropic drug modafinil. Remarkably, by comparing the behaviour between animals assayed individually or in small groups, we found that crowd size influences larval behaviour. This study shows that C. intestinalis larval behaviour can be broken down to a set of stereotyped behaviours that are used to different extents in a context-dependent manner. Furthermore, it raises exciting possibilities such as mapping behaviour to specific neurons of this compact chordate nervous system and it paves the way for comparative quantitative behavioural studies as a means to reconstruct the evolution of behaviour, especially in the chordate lineage.


Introduction 53
Close observation of living animals can reveal the large repertoire of behaviours they use to interact 54 with the world. Animals can crawl, swim, run and fly to move from one place to another. Many 55 animals perform extremely complex behaviours to attract mates, exhibit parental care and establish 56 their position in social hierarchy. Numerous species are able to build elaborate structures, ranging 57 from spider webs for catching preys to bird nests for shelter and raising of offspring. Some can even 58 make and operate tools. These observations have led to two important challenges for the scientific 59 community to pursue. 60 The first is to obtain a detailed understanding of how nervous systems generate behaviour. 61 Modern approaches to tackle the first challenge include techniques for recording and targeted 62 manipulation of neuronal activity using a wealth of molecular and cell type information (1). However, 63 to fully understand the function of neural circuits, we need to obtain an equally precise and detailed 64 understanding of behaviour (2, 3). 65 Behaviour is a process that is characterised by dynamic changes, and complex sequences of events 66 that are often convoluted with noise. Therefore, measuring animal behaviour using manual 67 approaches can be time consuming, and prone to errors, the latter especially in cases where a 68 behavioural event is taking place over a very short or very long time scale, making it difficult to be 69 detected by the experimenter. Modern computational analysis methods and accessible hardware for 70 recording videos with high temporal resolution make it possible to observe and quantify behaviour in 71 a more comprehensive, accurate and automated approach (4-7). 72 Automated behavioural analysis has been used to divide and classify behaviour into distinct 73 modules, and has been extensively demonstrated in several organisms, including worms (8,9), 74 flies(10), zebrafish (11,12) and mice (13). Despite the morphological and locomotor differences 75 between these organisms, automated tracking systems coupled to machine learning can transform 76 what appears as complex behaviours into a sequence of more basic motor patterns that are 77 (A) Setup: C-camera, F-IR filter, Sring with stimulation LED-s, T1 -Thermometer 1 measuring local temperature in the agarose, T2 -Thermometer 2 measuring cooling plate temperature, Pcooling plate, Hsheat sink, R -PLA ring holding the arena, Ag-agarose, Ar-Arena with animals, IR -IR illumination. (B) Arena dimensions and areas used in thigmotaxis measures I-inner arena with radius 3.55 mm and O-outer thigmotaxis zone; with t= 1.45 mm the zones have equal surface area and the width of the thigmotaxis zone is above one animal body-length. (C) Workflow chart. (D) An example animal being tracked with the ToxTrac software (E) Some example trajectories of wild type animals swimming for 5 minutes (F) examples of different local complexity of a trace -each trajectory is coloured by local complexity which is calculated over a 3 s window and the total span of each trace is 6 s (G) Examples of traces spanning 50 frames based on which the current behavioural mode was calculated. In green are the 25 frames before the current time-point and in red the 25 frames later. Collision or deceleration event 06 Mode change 1 07 Mode change 2 08 Slow active swimming 09 Medium active swimming 10 Fast swimming 1 11 Fast swimming 2 209 Adaptation to the arena 210 The introduction of an animal to a new environment, such as a tracking arena, is one of several 211 potential triggers of generalised nervous system arousal (59)(60)(61). Arousal can also be observed in 212 response to stimuli associated with harm, such as strong mechanical stimuli. In the case of the 213 nematode C. elegans, transferring an animal from one plate to another using a metal pick can result 214 in a temporally defined state of arousal demarked by higher motor activity that eventually returns to 215 baseline roaming locomotor activity(62). A similar observation has been made with mice when 216 placed in an open-field arena(63). This period is often termed the adaptation period. Given that 217 arousal mechanisms are evolutionarily conserved (64), we asked whether C. intestinalis larvae were 218 subject to generalised nervous system arousal as a result of the transferring process to the tracking 219 arena and the exposure to a new environment. 220 In order to answer this question, we decided that before recording the videos used for analysing 221 baseline behaviour, each animal would first be recorded for a 15 min period (Fig 2). In the first 222 minutes of the animal being exposed to the new environment its speed was generally higher (see Fig  223   2A for example traces), which we quantified as the slope of linear regression over the average speed 224 values of around 100 animals (Fig 2B, C). From these results, we inferred that the animals adapted to 225 the arena within approximately 6 minutes. We compared some basic behavioural parameters of 226 individual animals between the first, second and last third of the 15 min adaptation period (Fig 2 D-Fig 2. Adaptation of animals to the arena Analysis of adaptation behaviour of larvae in the first 15 minutes after introduction to the arena. (A) An example trajectory of a path during the adaptation period. The path is plotted in thirds each corresponding to 5 minutes of the recording as illustrated by the dotted lines linking this and the next panel (B) Average speed of 105 animals during the 15 minutes after introduction to the arena shows higher speeds immediately after the animals were exposed to the new environment. (C) Slope of linear regression fitted to the average speed (window 5 min, step size 10 s) shows the stabilisation of speed after ca 6 min. We compared (D) median speed, (E) maximum speed, (F) minimal reached path complexity and (G) activity coefficient between the first, second and last third of the 15 min adaptation period (N1= 105, N2=102, N3=92 ).  Table) (F) Example ethograms of individual animals in crowdsize experiments. Each line represents a 5 min recording and is coloured based on the assigned behavioural mode, black colour represents missing frames where modes could not be assigned. (G) Polar scatterplots of filtered speed values vs turn values for different crowdsizes (N1=33, N2=22, N3=46; number of points per polar plot is 100000).
The behaviour of C. intestinalis larvae in large groups has been studied to some extent, e.g. the 254 change in distribution because of water agitation(29) or stimulation with light (30). In our study, we 255 focused on the possibility of behavioural effects of small group interactions. To achieve this, we 256 compared animals that were alone in the arena with animals recorded in pairs or groups of three. We 257 found small differences in the basic behavioural parameters (Fig 3). Crowd size did not affect median 258 ( Fig 3A) or maximum speeds of movement significantly, but had a weak effect on the path complexity 259 and activity coefficient (Fig 3B, C). The average path complexity was lowest for animals in the crowd 260 size 3 group (6.281 bits, compared to 6.290 bits for animals in crowd size 1 group, p=0.05) and so was 261 the median AC value (0.63 compared to 0.82 and 0.75 for animals in crowd size 1 and 2 groups 262 respectively, p(1. vs. 3.) =0.045). We also found slightly more animals with higher thigmotaxis values, 263 with the difference only significant for TDO ( Fig 3D) between crowd size 1 and 3 (median TDO is 0.17 264 for crowd size 1 vs. 0.47 for crowd size 3, p= 0.0227). The distribution of different behavioural modes 265 shows higher representation of the less active modes corresponding to more time spent inactively in 266 crowd size 3 animals ( Fig 3E). In Fig  at 14 °C, we observed that in the first hour after hatching they were mostly inactive, followed by a 277 period of time when the larvae twitched very actively and flicked their tails but would not cover a lot between ages of WT animals reared at 14°C. Both maximum and median speeds were lowest for 280 animals immediately after hatching (Fig 4A, B), accompanied by very low AC ( Fig 4C). While animals 281 1h post fertilisation already achieved higher median speeds and generally had a very high AC, their 282 movement was less directional as can be seen by the distribution of turn values versus speed values 283 ( Fig 4E) and the high representation of twitching modes in their behavioural repertoire (Fig 4D). To 284 minimise any potential skewing of the data because of age-dependent changes, we used animals of 285 2-8 hours post hatching age for all later comparisons, unless specified otherwise. 286

Rearing temperature effects on a developmentally regulated behaviour 287
We (Fig 4) and others have shown that as the C. intestinalis larvae go through the post-hatching 288 motile phase of their life cycle they change their behavioural responses at multiple levels. Such 289 behavioural changes are thought to be tightly linked to developmental changes taking place in the 290 larvae. An interesting question that arises is whether this developmental regulation of locomotor and 291 sensory behaviours is robust to different environmental circumstances, possibly through a 292 mechanism of canalization (80-83) or whether it shows plasticity (84-86). Temperature is one key 293 physical parameter that has been shown to affect the speed of most biological processes, acting as a 294 major environmental factor influencing the rate of animal development (87-89) and behaviour(90, 295 91). The two Ciona species (Ciona intestinalis and Ciona robusta) (92)occupy a very large part of the 296 world's coastline from high to low latitudes(93) and they show great adaptability to a range of 297 temperatures. Published studies have used 18°C as rearing and assay temperature for C. intestinalis 298 and Ciona robusta larvae. However, our local animals belong to the C. intestinalis species and 299 develop best at lower rearing temperatures, possibly due to an adaptation to the lower water 300 temperatures in the Norwegian Fjords. We tested whether the lower rearing temperature of 14°C 301 affected the onset of the light-off response that has previously been described by Nakagawa et 302 al.(28). The increase in swimming speed immediately after a light stimulus is considered a hallmark of 303 the older larva that will in its later age seek to settle utilising negative phototaxis. In animals reared 13 at 18°C, the first notable response to a light-off signal was detected at 4 h post fertilisation, 305 coinciding with a reduced average speed of the animals in absence of the stimulus. 306 The sensitivity of this response has been shown to peak in the green part of the spectrum (28), so we 307 tested for light-off response in our animals using a green light (515-530 nm). We calculated the 308 change of speed (i.e. Δ speed (Off), Fig 5B) between the last 10 s during a 1 min light stimulus and the 309 first 2.5 s after the light was turned off (after a 0.5 s latency period). In Fig

Rearing temperature effects on behaviour 319
Animals reared at 18°C had a much narrower time window after hatching in which we could observe 320 active swimming behaviour, with the majority of animals being highly inactive by age 4 h post 321 hatching (data in S2C). We therefore only compared animals of age 0-3 h reared at 18°C to the 14°C 322 reared animals of ages 2-8 h, since we assumed they correspond to the same post hatching 323 development stages. Even when comparing what we assumed to be animals at a similar 324 developmental stage, animals reared and recorded at 18°C still exhibited some differences compared 325 to the ones at 14°C (Fig 6). Their traces were similar in median speed values ( Fig 6A)   representation of medium-high speeds (around 1000-1500 µm/s) in combination with a wider range 332 of turn values, while at lower speeds the variability of turns was smaller ( Fig 6G). This was matched 333 with a lower representation of twitching modes and more occurrences of the modes representing 334 swimming at medium speeds ( Fig 6H). 335

Dechorionation effects 336
The eggs of C. intestinalis are nested in a chorion surrounded by follicle cells (Fig 7A)   The animals affected by modafinil also exhibited an overall more active set of behaviours with much 368 higher representation of the active-swimming modes and less time spent inactively (Fig 8G, H). This 369 resulted in increased median and maximum speeds (Fig 8A, B)  The chordate Ciona intestinalis in its larval form is emerging as a promising organism for 382 neuroethological studies. The present study provides a quantitative description of larval behaviour in 383 different contexts, using biologically relevant features. We performed unsupervised clustering of our 384 data and identify clusters, with which we generate a behavioural ontology. We uncovered some of 385 the behavioural effects of post-embryonic development and dechorionation on larval behaviour and 386 pinpoint the behavioural consequences of crowd size and sensory arousal. Furthermore, we provide 387 evidence that C. intestinalis larvae exhibit thigmotactic behaviour that can be modulated by the drug 388 modafinil. 389

Quantitative description of Ciona intestinalis larval behaviour 390
The potential of the C. intestinalis larva as an organism to perform neuroethological studies has been 391 noticed for several decades. There have been several efforts to perform behavioural studies with 392 increasing sophistication over the years (26-33). However, automated quantitative analysis of C. 393 intestinalis behaviour had been hindered by the lack of suitable open-source software with the ability 394 to follow the larvae providing precise positional information over long time series, with few or no 395 identity switches in case multiple animals are tracked simultaneously. In this study, we identified 396 Toxtrac (43) as a suitable open-sourced tracking software, we built customizable hardware and 397 developed an automated behaviour analysis pipeline for C. intestinalis larvae. 398 Our analysis suggests that C. intestinalis larvae show a surprising amount of complexity in their 399 spontaneous swimming behaviour. Notably, the larvae exhibited a large range of swimming patterns 400 showing significant variation in path complexity (Fig 1F), and individuals used a broad range of 401 behavioural mode sequences (e.g. Fig 3F). The advent of tracking methods has revealed the presence 402 of multiple characteristic scales of organisation in single and multiple animal traces that can be 403 explained only if we consider theoretical frameworks for mobility that extend beyond simple 404 diffusion mechanisms (96, 97). In the future it would be interesting to study the temporal structure 405 of spontaneous swimming in C. intestinalis larva in greater detail. Intriguing topics to investigate are 406 for example whether some of the swimming patterns of C. intestinalis exhibit a Lévy-like 407 behaviour(49, 98) and whether they may play a role in a dispersal strategy(99, 100) . In accordance 408 with our expectations, external sensory cues seemed to influence the swimming strategy of the 409 larvae. Interestingly, path complexity appeared to be modulated in opposite ways by sensory arousal 410 and crowd size (Fig 9). 411 The sensitivity of our measurements allowed us to quantify the activity levels of the animals in 412 different experimental contexts. We found that larvae showed both bursts of activity and bouts in 413 irregular intervals. Intermittent locomotion (101)  Quantitative behavioural analysis has been moving from subjective observation, and imprecise 420 annotation of behavioural data, towards the automated recognition and classification of behaviours 421 amongst very large data sets (2, 4, 7, 108). Some of the breakthroughs that have permitted this 422 progress have focused on generating low-level representations of behaviour for automated analysis 423 and automated classification algorithms of behaviours. The ultimate goal is to break down complex 424 behaviours into their constituent building blocks. In this study, we employed a clustering 425 methodology, using first unsupervised clustering of a minimal feature-set to identify behavioural 426 modes, followed by training a K-Nearest-Neighbours classifier in order to classify all of our data 427 corresponding to approximately 1.8 million observations from 850 data-frames. We found 11 distinct 428 clusters that were classified in an equal number of basic behavioural modes. These 11 behavioural 429 modes provide an unbiased way to dissect the structure of behaviour and will allow us to 430 systematically classify complex behavioural phenotypes that result from pharmacological, genetic or 431 optogenetic perturbations (109-112). However, our current automated image based tracking 432 approach is relying on marking each animal with a centroid rather than segmenting out the entire 433 shape of the animal in order to generate an outline or a skeleton. We therefore are lacking postural 434 information that would enrich our dataset significantly. This presents an important next step towards 435 obtaining a complete ethogram of C. intestinalis larval behaviour. We note however, that clustering 436 data points from centroid analysis already allowed us to describe a number of behavioural modes 437 accurately. Furthermore, we are testing our animals in an open field arena that is suitable for 438 recording a relatively small number of animals, possibly in a setting that is relatively distant to the 439 natural ecological niche of the larvae. This problem is faced by numerous experimenters who are 440 trying to obtain high quality tracking data in a controlled environment(5). We envision that in the 441 future the use of larger arenas and the ability to deliver multiple sensory stimuli reaping the benefits 442 of the open architecture of the behavioural setup, will allow us to study other ecologically relevant 443 behaviours such as settlement behaviour and metamorphosis more closely. 444 445

Arousal from transfer to new environment 446
Animals have the ability to modulate their readiness to react to sensory cues, in a phenomenon 447 known as arousal. This modulation is very obvious when comparing the states of sleep and 448 wakefulness. In addition, during the awake period, animals are able to enter short-term behavioural 449 states, during which they exhibit heightened activity and general or specific sensory stimulus 450 responsiveness and thus are able to anticipate and address sudden challenges (113). Here we report 451 that C. intestinalis larvae are in a state of arousal during the first minutes of being placed in the arena 452 (Fig 2, 9). Generalised arousal is thought to be widespread across vertebrates (59, 60) but the 453 detailed neuronal and molecular mechanisms are still poorly understood. In fact, amongst 454 invertebrates, there is evidence that sensory arousal is present in Aplysia(114) and in ecdysozoans, 455 like the nematode worm C. elegans (62, 115) and Drosophila melanogaster (116,117). In the case of 456 C. elegans, sensory circuits involved in sensing high threshold mechanical and noxious stimuli are 457 implicated in the heightened state of arousal. Given that the arousal exhibited by the C. intestinalis 458 larvae is likely due to mechanical stimulation from transfer to the arena it would be interesting to 459 study the contribution of mechanosensory circuits to this behavioural state. In the case of 460 Drosophila, acute sensory arousal is more apparent when comparing between states of wakefulness 461 and sleep(118). A first clue as to which circuits might be involved comes from the observation that 462 arousal in C. intestinalis is modulated by the drug modafinil (Fig.9). Modafinil has been classified as a 463 psychostimulant and has been extensively used in narcoleptic patients in order to address sleep 464 related disorders. It is thought to act as a selective dopamine (119) and norepinephrine transporter 465 inhibitor (120), thus raising the possibility that monoamine signalling plays an important role in 466 modulate the arousal state in C. intestinalis larvae. In this study we show that beyond modulating the 467 arousal state of the animals, modafinil appears to alter the activity coefficient. The larvae also 468 showed less quiescent periods with a higher activity coefficient. This has also been observed in mice 469 and zebrafish. In mice, modafinil results in wake-promoting action, possibly via dopamine 470 transporters (121) Previous work in C. intestinalis has shown that larvae can aggregate into a column when placed in a 501 three dimensional chamber and that they can form swarms, especially upon agitation of the 502 water(29). Also it has been shown that larval distribution can change in the presence or absence of 503 light(30). Notably, it has been reported that ascidian behaviours prior to settlement are largely 504 influenced by conspecifics, while the larvae exhibit a form gregariousness (35,127). However, these 505 are largely qualitative observations that were made in the course of experiments that were not 506 designed to specifically address the interactions between conspecifics. Further difficulties for 507 providing a quantitative description of larval interactions stem from the lack (until recently) of 508 automated tracking software that faithfully maintained the identity of each tracked animal(5). Taking 509 advantage of the ability of ToxTrac to maintain the identity of multiple animals in the same arena we 510 21 attempted to determine whether there are differences when single vs multiple individuals are placed 511 in the arena. We find that the presence of two or three animals in the arena can already result in a 512 few changes in the measured behavioural parameters (Fig 9). Notably, a significant change in one of 513 the thigmotactic indices is also observed (Fig 3D). Interestingly, an enhancement of thigmotaxis in 514 individual versus group context has been observed in the case of ants(128). Given the past literature 515 it will be interesting to determine if and how C. intestinalis larvae achieve coordinated movement. It 516 is believed that the type of distributed sensing required to generate robust collective behaviour is 517 rather simple, requires rudimentary circuits and thus it may be widespread across different animal 518 taxa(129). C. intestinalis has a small nervous system and thus is ideal to study the neural circuits 519 controlling pairwise and group-level behaviours. We note that a limitation of our method is that our 520 crowd size experiments were conducted in an extremely small volume of sea water compared to the 521 ethologically relevant volumes that these animals would encounter in the sea. Future experiments 522 should be conducted in larger arenas that may be ethologically more relevant for crowd size 523 experiments. 524 525

Behavioural robustness to altered rearing conditions 526
Temperature is a known modulator of key physiological processes and behaviours in numerous 527 animals(130). For example, thermal rearing conditions can affect the dispersal of adult spiders(131), 528 the host-seeking behaviour of parasitic nematodes(132), mating behaviour in Drosophila(133), and 529 the feeding behaviour in the mud snail Heleobla australis(134). To contextualise our data we 530 compared our main wild type group reared and recorded at 14°C to animals at 18°C, since behaviour 531 of C. intestinalis larvae has previously often been studied at 18°C e.g. (27,31,32) or even at room 532 temperature (29) . We describe the distinct difference in the speed of post hatching development at 533 different rearing temperatures (Fig 4, S2 ) At 18°C the period of higher spontaneous locomotor 534 activity coinciding with the lack of significant responses to light-off stimuli lasts for ca. 4 h post 535 hatching (28). In animals at 14°C we can detect the first significant, yet still weak, responses to the 536 22 light-off signal at 6 h post hatching (Fig 5), coinciding approximately with the period of higher 537 locomotor activity in animals up to 8 h post hatching. Apart from this clear influence in the rate of 538 post hatching development, the higher temperature seemed to have little effect on the animals' 539 behaviour, but we do note the higher representation of medium-high speeds in combination with a 540 wider range of turn values (Fig 6). It may be the case that rearing temperature has no strong 541 behavioural defects in Ciona intestinalis larvae, possibly through a buffering mechanism. 542 Alternatively, we may have not identified the behaviours and sensory modalities affected by rearing 543 temperature. This is a plausible explanation in light of significant evidence suggesting that not all 544 sensory modalities are affected equally by the rearing temperature or from deviations from that, 545 since olfaction appears to be particularly strongly affected (135-139) compared to other sensory 546 modalities in other organisms. 547 Yet another treatment that can challenge the behavioural robustness of Ciona intestinalis larvae is 548 the enzymatic removal of the chorion that envelopes the eggs, a process termed dechorionation. 549 This enzymatic treatment is an essential step in the generation of transgenics via electroporation. 550 However, it can potentially interfere with the establishment of brain asymmetry in the ascidian brain, 551 which is dependent on an intact chorion(140). Given that left-right asymmetries in behaviour and in 552 nervous system structure are abundant phenomena across different animal taxa(141), it was of 553 paramount importance to understand, in the first instance, the effects of dechorionation to 554 spontaneous larval swimming. The behavioural comparison of chorionated versus dechorionated 555 animals revealed differences in speed and thigmotaxis. Unexpectedly, dechorionated animals swam 556 faster and showed higher thigmotaxis levels ( Fig 10D). These observations suggest that future 557 quantitative behavioural studies making use of electroporated transgenic animals need to use 558 dechorionated animals for 'wild-type' controls rather than larvae hatched from chorionated eggs. 559 Nonetheless, it is encouraging to see that dechorionated larvae are in many behavioural parameters 560 indistinguishable from chorionated egg derived larvae. 561 562

Thigmotaxis and modafinil effects 563
Using an open-arena to monitor our animals, we noticed that a large fraction of larvae exhibited 564 strong thigmotactic behaviour. This appears to be an adaptive behaviour that has been observed in 565 numerous organisms, where the circular wall of the arena allows the animals to exhibit a defensive 566 response (i.e. to hide from potential predators) and facilitates their orientation in space (142). 567 Therefore, it is not unlikely that thigmotaxis presents an evolutionarily conserved behaviour. One 568 may wonder what role thigmotaxis plays in the larvae of C. intestinalis. In fact, almost thirty years 569 ago it was hypothesised that thigmotaxis, amongst other behaviours, may be involved in the 570 selection of habitats for larval settlement(35). Interestingly, we have been able to demonstrate that 571 physiological (rearing temperature) and morphological changes (dechorionation) can affect the 572 animal's ability to perform thigmotaxis. Moreover, we found that modafinil increased thigmotaxis 573 levels in C. intestinalis larvae. This is interesting in light of the fact that the effects of modafinil 574 treatment in both humans and other animals has shown variable effects. In some cases, it acts as an 575 anxiogenic drug like in one study in humans (143)and in others as an anxiolytic drug such as in 576 marmosets(144). Notably, one study showed that modafinil increased the exploratory behaviour of 577 mice in a dose dependent manner (145). It has also been shown that Modafinil can reduce 578 thigmotaxis levels in zebrafish, (95). The strong effect that the anxiotropic drug modafinil has on C. 579 intestinalis larval thigmotaxis is evidence that a common mechanism might mediate thigmotaxis 580 across taxa (63,95,146). Future work should explore the molecular and cellular underpinnings of 581 thigmotactic behaviour in C. intestinalis larvae and aim to understand the ecological context in which 582 it may be used. with the ultimate aim to elucidate the neural networks underlying behaviour. With our approach, we 607 were able to show that we can quantify larval behaviours automatically and identify novel 608 behaviours (thigmotaxis) and behavioural states (arousal). This approach also allowed us to 609 investigate the robustness of the behavioural repertoire under diverse environmental, 610 developmental and pharmacological conditions. Future work, includes obtaining a more detailed 611 mechanistic understanding of the stimulus driven behaviours, social interactions and learning 612 paradigms. 613

Fig 9. Summary
During the adaptation period (A) C. intestinalis larvae exhibited sensory arousal, which translated to higher speeds and increased path complexity. The presence of conspecifics in the arena (B), resulted in reduced locomotor activity, reduced path complexity and a change in the distribution of behavioural modes. We tested the robustness of behaviour in the context of rearing temperature (C) and dechorionation (D) treatments. Finally, the anxiotropic drug Modafinil (E) was able to modulate thigmotaxis, arousal and the overall state of animal activity, by changing the distribution of the behavioural modes.

Methods 615
Animals 616 Adult Ciona intestinalis were collected locally from the Bergen area and Sotra Island, Norway. We 617 incubated them in filtered seawater at 10°C under constant illumination to stimulate egg production. 618 Eggs and sperm were obtained from individual animals to perform in vitro fertilisation. Part of the 619 eggs were dechorionated using Na-Thioglycolate and mechanical dechorionation(155). Both eggs 620 with and without chorion were fertilized at the same time and incubated in artificial sea water (ASW, 621 Red Sea Salt) at either 14 or 18 °C. The post hatching age of animals is referred to relative to the 622 onset of hatching of larvae from the chorion. 623 624

Set-up for behavioural experiments 625
Animal behaviour was recorded in a custom-made setup developed in our lab (Fig 1A). Using a 3D-626 printed PLA mould, we made single-use agarose arenas (0.8% in ASW, by Invitrogen, USA,). The arena 627 was nested inside a PLA ring with infrared (IR, peak emission 850 nm) LEDs, which provided dark-field 628 illumination of the animals without stimulating their photoreceptors. The ring also held a small 629 thermometer (DS18B20, Maxim Integrated) positioned close to the arena and was placed on top a 630 Peltier element with a thin layer of ASW underneath the agarose to improve heat conduction and 631 image quality. Light stimulation was performed using LED illumination (green LED in NeoPixel LED 632 array; emission 515-530nm) and an IR filter (cut-of at 780 nm) positioned in front of the camera. 633 Videos were recorded using an IR sensitive monochrome camera (DMK 33UP1300, The Imaging 634 Source, Germany) and IC Capture software. An Arduino based circuit, interfacing with a GUI written 635 in Python, provided stimuli and PID-controlled temperature control. Videos were analysed using ToxTrac software and custom-made software using OpenCV and python 648 environment ( Fig 1C). For each video all frames were enhanced with Contrast Limited Adaptive 649 Histogram Equalization (CLAHE) with a clip limit of 1 and a tile grid size of 50x50 pixels. After 650 histogram equalization noise was reduced with a median blur with a tile grid size of 5x5 pixels. To 651 input bright-background videos into the ToxTrac software, all frames were inverted by subtracting 652 from a true white frame of equal size. Within the ToxTrac software, the ID algorithm used in our 653 study was 2TCM sel. by Hist (MEE). To identify objective behavioural modes we attempted unsupervised clustering of a minimal feature-680 set that describes the behaviour of the larvae. The featureset was created as follows: 681 For each good recording the velocity vectors (ρ, φ) were calculated from coordinates 5 frames apart. 682 Values ρ, Δρ and Δφ were used as measures for speed, acceleration and turns respectively. For each 683 point the mean of a sliding window of [-25:+25] frames was used to include information of past and 684 future movement. This results in a dataset of three features and ca. 1.8 million observations. 685 Clusters in the dataset were identified using an agglomerative clustering algorithm with ward-686 linkage. To determine the optimal number of clusters we identified the point where adding more 687 clusters would not reduce the total distance of all points to their respective cluster centre drastically. 688 689 Classifying 690 Using the clustered dataset, we trained a K-Nearest-Neighbours classifier that takes a recording 691 expressed in the features mentioned above, and assigns each point in this recording to a cluster. We 692 28 classified all collected traces with this classifier, and inspected the original videos with the assigned 693 clusters superimposed in order to assess the biological relevance of each cluster. We found that 694 apart from cluster 0, which turned out to be the result of an artefact from data were there was 695 insufficient datapoints in the window for averaging, we could identify distinct behaviours for the 696 remaining eleven clusters. Several of these clusters described the same biological behaviour but 697 resulted in different clusters as a result of the tracking marker being placed in either the head or the 698 neck of the animal by the tracking software (For an illustration of the speed and turn values present 699 in the different clusters see data in S1). 700 701