DOI: 10.25338/b8nh1x
title: Data from: A laser-equipped tunnel for the assessment of multiple burst swimming traits in fishes

description: Burst swimming performance in fishes is relatively understudied despite
 its critical role in predation attempts and prey evasion, spawning events,
 and passing hydraulic challenges. Burst swimming is characterized by fast
 acceleration, over a short distance and of limited duration. The bulk of
 fast-start performance research uses analysis of high-speed recordings of
 fish behavior. While behavioral video analysis has improved, it is still
 expensive in both processing time and computational resources. Here we
 introduce a laser-gated burst tunnel that improved upon past designs by
 introducing an adjustable number of lasers (≤ 25) that facilitated greater
 resolution on burst performance as well as novel laser arrangements
 facilitating novel performance metrics (e.g., fatigue rate, burst
 capacity). We quantified the burst velocity, burst capacity and fatigue
 rate of rainbow trout (Oncorhynchus mykiss), a widely distributed and
 studied species. We directly compared the results measured by our device
 to simultaneously collected high-speed camera data and find the velocity
 estimates to be highly accurate (R2 = 0.97). We also compared the burst
 performance of individual rainbow trout with their individual UCRIT, a
 commonly measured metric of aerobic swimming performance. We found little
 correlation between the two traits, indicating that fish capable of rapid
 burst swimming are not necessarily fast sustained swimmers. Finally, we
 defined and quantified two novel traits of burst swimming performance:
 burst capacity (the number of burst events that can be elicited prior to
 performance decline), and fatigue rate (the rate of decline associated
 with repeated bursting). The burst tunnel is an adjustable platform for
 quantifying understudied elements of fish swimming physiology, improving
 design of fish passage technology, and facilitating discoveries in how
 burst swimming performance changes with environmental conditions.
description: This dataset was collected using a novel burst swimming
 performance tunnel. The Python script which controls the Raspberry Pi and
 collects data from the burst tunnel is included. Also included is the
 processing R script which converts the output of the Raspberry Pi into
 velocity measurements for each fish's burst performance. 
description: # A laser-equipped tunnel for the assessment of multiple burst swimming
 traits in fishes This dataset
 contains multiple files associated with a manuscript entitled "A
 laser-equipped tunnel for the assessment of multiple burst swimming traits
 in fishes". This is a methods paper describing the development and
 use of a chamber used to precisely measure the burst performance of
 fishes. This burst tunnel uses an array of lasers to enable the
 calculation of burst velocity. The first step occurs on a Raspberry Pi
 which monitors the array of lasers and when in use records the time that
 each laser beam is broken. The Python script which does this is provided
 and named "Submission_Code_Lasers.py". The output of this Python
 script can then be interpreted with the included R script
 "TITLE". We used this burst tunnel to evaluate the burst swim
 performance of Rainbow Trout and to use the burst tunnel to quantify novel
 metrics of burst performance and compare burst performance with sustained
 aerobic swim capacity (Ucrit). The data used in this analysis are
 contained in two included datasets, *Burst_MS_Analysis_Data.csv* which
 includes burst performance data for 30 fish across a suite of burst
 performance trials and *Burst_MS_Ucrit_Data.csv*, which includes the
 results of sustained aerobic swim performance (Ucrit) trials. Finally, we
 have also included .drl files which can be used to recreate the printed
 circuit boards (PCBs) we designed to build the laser-detecting arrays for
 the burst tunnel. ## Description of the data and file structure ####
 Burst\_MS\_Analysis\_Data.csv This dataset contains all the individual
 burst events for the two rounds of delayed burst and the two rounds of
 exhaustive burst trials. ##### Column Names TRIAL_TYPE: This column
 identifies the data as arising from a burst trial using the
 'DELAYED' or 'EXHAUSTIVE' protocol. PIT: A unique code
 for each fish based upon its implanted Passive Integrated Transponder
 (PIT) tag. ORIENTATION: Whether the burst event on the right (R) or left
 (L) of the burst tunnel FISH_ID: A unique fish ID that contains a
 fish's PIT tag number, the trial ID and the date (PIT_TrialID_Date)
 TRIAL_NUMBER: Identifies whether the trial represented the first (1) or
 second (2) delayed or exhaustive burst protocol. DATE: Date of the trial
 (mm.dd.yyyy) BURST_COUNT: An integer value describing what number burst
 event it is for each fish START_TIME: number if seconds between the
 initiation of the script and the specific burst event. 573 933 1404 1682
 1765 ... MASS: The fish's mass in grams. SL: The fish's standard
 length in centimeters FL: The fish's fork length in centimeters: NA
 indicates data not recorded TL: The fish's total length in
 centimeters STATUS: Identifies burst events wherein the fish refused to
 burst (R2B, n = 4) or where there was a user error that invalidated the
 trial (ERROR, n = 14). NA indicates that burst event occurred without
 error. PEAK_SPEED: The burst velocity of the fastest segment (body lengths
 per second). NA indicates velocity could not be calculated due to
 error'd STATUS. PEAK_SPEED_1_1H: The burst velocity of the fastest
 segment in the first half of the burst tunnel (body lengths per second).
 NA indicates velocity could not be calculated due to error'd STATUS.
 PEAK_SPEED_2: The second fastest burst segment velocity (body lengths per
 second). NA indicates velocity could not be calculated due to error'd
 STATUS. PEAK_SPEED_2_1H: The second fastest burst segment velocity in the
 first half of the burst tunnel (body lengths per second). NA indicates
 velocity could not be calculated due to error'd STATUS. PEAK_SPEED_3:
 The third fastest burst segment velocity (body lengths per second). NA
 indicates velocity could not be calculated due to error'd STATUS.
 PEAK_SPEED_3_1H: The third fastest burst segment velocity in the first
 half of the burst tunnel (body lengths per second). NA indicates velocity
 could not be calculated due to error'd STATUS. AVE_SPEED_TOP_3: The
 average velocity of the first, second, and third fastest segments. NA
 indicates velocity could not be calculated due to error'd STATUS.
 AVE_SPEED_TOP_2_4: The average velocity of the second, third, and fourth
 fastest segments. NA indicates velocity could not be calculated due to
 error'd STATUS. AVE_SPEED_TOP_3_5: The average velocity of the third,
 fourth, and fifth fastest segments. NA indicates velocity could not be
 calculated due to error'd STATUS. AVE_SPEED_TOP_10P: The average
 velocity of all segments in the top 10 percent of segments. NA indicates
 velocity could not be calculated due to error'd STATUS. AVE_SPEED_1H:
 The average velocity of all segments in the 1st half of the tunnel. NA
 indicates velocity could not be calculated due to error'd STATUS.
 AVE_SPEED_1Q: The average velocity of all segments in the 1st quarter of
 the tunnel. NA indicates velocity could not be calculated due to
 error'd STATUS. AVE_SPEED_2Q: The average velocity of all segments in
 the 2nd quarter of the tunnel. NA indicates velocity could not be
 calculated due to error'd STATUS. AVE_SPEED: The average velocity of
 all segments in the burst tunnel. NA indicates velocity could not be
 calculated due to error'd STATUS. #### Burst\_MS\_Ucrit\_Data.csv
 This dataset contains the maximum sustained aerobic swim speed (Ucrit) of
 30 individual rainbow trout. There are no missing values. ##### Column
 Names FISH_ID: A unique fish ID that contains a fish's PIT tag
 number, the trial id, tunnel used and the date (PIT_TrialID.Tunnel_Date)
 PIT: A unique code for each fish based upon its implanted Passive
 Integrated Transponder (PIT) tag. TUNNEL_ID: Ucrits were conducted in twin
 30L Loligo swim tunnels. They are identified as either '1' or
 '2'. DATE: Date of the trial (mm.dd.yyyy) MASS: The fish's
 mass in grams. SL: The fish's standard length in centimeters. UCRIT:
 The maximum sustained swim speed of each Rainbow Trout reported in Body
 lengths per second. The fish's standard length (SL) was used to
 calculate this size-corrected velocity. TRIAL_TYPE: The only value in this
 column is 'UCRIT' to distinguish it from the two types of burst
 trials contained in the Burst_MS_Analysis_Data.csv. ####
 Detector\_Boards-PTH.drl and Detector\_Boards-NPTH.drl These two files are
 drill (.drl) files for the fabrication of the custom printed circuit
 boards (PCBs) used to hold the light detectors that constitute the
 laser-gate array. These files can be used to recreate the same form of
 PCBs. Graphical illustrations of these drill files are located in the
 Supplementary materials of the associated manuscript. ## Code/Software
 #### Submission\_Code\_Lasers.py This is a Python script that can be run
 on a Raspberry Pi attached to the burst tunnel described in the present
 manuscript. This script will allow the user to run a burst swim
 performance trial. It will ask the user to enter details about the trial,
 enable the user to conduct test to ensure the burst tunnel is being
 properly interpreted and all the laser-gates are functioning. This script
 uses the GPIO pins on the Raspberry Pi to monitor up to 25 laser-gates.
 During a trial, when a laser-gate is obscured by a fish, the change in
 voltage at the GPIO pin induces the script to record the time of that
 voltage change. At the end of a burst event, a vector of timings of when
 each laser-gate was interrupted is stored in an output file. When the user
 elects to end the script (wishes to not conduct any further burst events)
 then the script saves the output file which can be analyzed in the R
 script entitled TITLE. This script requires three packages.
 'RPi.GPIO', 'time' and 're' For a more
 detailed and graphical description of how the code works, see Figure 2 in
 the manuscript. #### Zillig\_Burst\_Processor\_1.r This is an R script
 which takes the timing output produced from the Submission_Code_Lasers.py
 and uses a Burst Tunnel Spec dataframe to compute measures of fish
 velocity. This code is mean to process several burst experiments at once.
 It will create directories for each fish and each single burst event. It
 will ultimately produce a large dataframe with calculated metrics (e.g.,
 Peak Speed, Average Speed, etc.), plots of the burst performance, measures
 of experiment success (e.g., any gates missed? any errors?) which can then
 be analyzed to evaluate the burt performances of fish. The Burst Tunnel
 Spec dataframe should have two columns (see chunk below to generate the
 generic specs used in the study). The `GATE_ID` identifies each individual
 laser beam, and the `GATE_DISTANCES` indicates at what distances from the
 start (left) each laser is. A study using a tunnel with a different number
 or arrangement of lasers would need a modified `tunnel.specs` dataframe to
 accurately measure velocity. ``` tunnel.specs &lt;-
 data.frame("GATE_ID" = seq(0:24), # One gate ID per laser beam.
 Our code used 25 labeled 0 to 24 "GATE_DISTANCES" =
 c(0,1,2,4,6,10,15,20,25,35,40,45,50,55,60,65,70,75,80,84,86,88,89,90) #
 these are the distances (cm) used in the present study, they would be case
 dependent on the layout of the lasers. ) ``` This code requires the
 following packages. ``` library(ggplot2) library(plyr) library(dplyr)
 library(reshape2) library(tidyverse) library(Rfast) library(lubridate) ```