The behaviour of the fish was tracked online at 28 Hz, and 1-s-long videos at 560 Hz were recorded in response to DF and Acoustic Tap stimuli. Offline tracking on recorded videos was performed in MATLAB (MathWorks) using the script ‘TrackMultiTrackerTiffStacks_ParallelOnFrames.m’, as described previously, to track larval posture (Randlett et al., 2019). Tracks were then analysed using Python. Analysis code is available at https://github.com/owenrandlett/lamire_2022, (copy archived at Randlett, 2023).
Responses to DFs and taps were identified as movement events that had a bend amplitude greater than 3 rad and 1 rad, respectively. Behavioural fingerprints were created by first calculating the average value for each fish reflecting either the DF response during the specified time period (naive = DFs 1–5, training = DFs 6–240, test = DFs 241–300) or the average response during the entire stimulus period (Acoustic Taps, OMR, Free Swimming). Periods where the tracking data was incomplete were excluded from the analysis. DFs where larvae did not respond were excluded from the behavioural components other than the probability of response. The SSMD was then calculated for each of these average fish values for the compound-treated larvae relative to the vehicle (DMSO) control (Figure 3C). The threshold for determining hit compounds was set at . These analyses were performed using Analyze_MultiTracker_TwoMeasures.py.
Hierarchical clustering (Figures 3D and 4A–C) was performed using SciPy (Virtanen et al., 2020). Correlations across different behavioural measures (Figure 4B) were calculated computing all pairwise comparisons for each behavioural measure in the SSMD fingerprint across the 176 hit compounds.
Further details and code for the analyses used to create the figure panels are provided in the following notebook: 2022_LamireEtAl_BehavFigs.ipynb. Analyses made use of open-source Python packages, including NumPy (Harris et al., 2020), SciPy (Virtanen et al., 2020), matplotlib (Hunter, 2007), seaborn (Waskom, 2021), and open-cv (Bradski, 2000).
Do you have any questions about this protocol?
Post your question to gather feedback from the community. We will also invite the authors of this article to respond.