Description of data =================== This a dataset of joint angles obtained from tracking the joints of fruit flies in 3D at 300 fps. This data is collected by Evyn Dickinson and Sarah Walling-Bell, and is part of a larger experiment. In this setup, fruit flies are tethered and walking on a ball. The experimenter presents them with visual stimuli to make them walk straight, rotating clockwise, or rotating counterclockwise. The dataset consists of 39 flies from a wide variety of days. All the flies are of the "wild-type Berlin" Drosophila fly strain. The methods for tracking are detailed in the following paper: Anipose: a toolkit for robust markerless 3D pose estimation Pierre Karashchuk, Katie L. Rupp, Evyn S. Dickinson, Elischa Sanders, Eiman Azim, Bingni W. Brunton, John C. Tuthill Data format =========== The data is packaged as a Parquet file, which is an efficient columnar data format, readable in both Matlab and Python. To load it in Python, we recommend using the Pandas library. For instance, here is some code to load the data and restrict to only walking: import pandas as pd data = pd.read_parquet('evyn-sarah-Berlin-WT-phase.pq') check = data['walking_bout_number'] > 0 data_walk = data.loc[check] Leg joints ========== Flies have 6 legs, which we done as follows: - L1 - front left leg - L2 - mid left leg - L3 - hind left leg - R1 - front right leg - R2 - mid right leg - R3 - hind right leg We track 5 points on each leg, denoted A-E: - A - body-coxa joint - B - coxa-femur joint (this point is roughly positioned at the trochanter) - C - femur-tibia joint - D - tibia-tarsus joint - E - tarsus tip Each joint is uniquely specified by the leg and joint name. For instance, L1A would be the left front leg body-coxa joint. The 3D positions of the legs are stored for each joint leg combination, with the following suffixes: - x y z - the relevant coordinate axis (e.g. "L1A_x" is the position of L1A along x-axis) - score - the minimum score of the neural network detections of the points used to triangulate this joint at this frame - ncams - how many cameras detected this point - error - the reprojection error for the triangulation, in pixels Note that we use an optimization process to smooth out these coordinates in time and space, so this helpfully fills in missing values. Thus, you may see values where the score or ncams is low (even 0) but can still be treated as a valid value. Note also that due to the way we perform camera calibration, the scale of the x y z coordinates is in arbitrary units. If you want to get units of mm, we recommend scaling the coordinates such that the length of the left leg coxa ||L1A - L1B|| is 0.456 mm, our empirical measurement of the average coxa length for these flies. The x y z axes are not arbitrary. We rotate the coordinate frame according to the following orthogonal axes: - x axis goes L1A -> R1A - y axis roughly goes L3A -> L1A, but orthogonalized with x axis - z axis is cross product of x and y axes, roughly down -> up Angles ====== There are three types of angles: - rot: rotation about the axis of the leg - flex: flexion of the joint - abduct: abduction of the joint We use the 3D positions of the legs to infer the angles of the fly legs. In order to identify the angles in a unique way, we use a simple model for the leg, with the following assumptions: 1. only the body-coxa joint can abduct 2. all limbs can rotate, except the tarsus 3. all joints except body-coxa are restricted with up to 180 degrees of flexion Refer to the attached diagram (leg_angles.png) to see the possible angles. The angles are then encoded, in degrees, according to each joint and angle type. A rotation of a limb (e.g. femur) is thought of as a rotation of the preceding joint (e.g. coxa-femur or B joint). The rotation angles wrap around 360 degrees, which can add discontinuities to the data. We found we can get them to be continuous most of the time with this simple code: r[r > -20] = r[r > -20] - 360 .. where r is an array containing a rotation angle. Note also that, due to some error with the code, the A_flex and A_abduct angles should be swapped for each leg (e.g. L1A_flex and L1A_abduct should be swapped) Finally, the sign of the C_flex (femur-tibia flexion) angle should be flipped, so that the angle is always positive. Other data ========== experimental variables - fnum - frame number from the video - date - date of the experiment - date_parsed - a parsed version of the date - fly - fly number for one date - rep - experiment repetition number - condnum - experiment condition number (you can ignore this, other vars have the info on the condition) - stimlen - length of optogenetic stim, in seconds (the opto stimulus is disabled for WT Berlin flies, only relevant for others) - type - type of stimulus (straight or rotating) - dir - direction of rotating stimulus (ignore values when straight) walking bout variables - walking_bout_number - id number of the detected walk bout - walking_prob - detected probability of walking Fictrac variables - fictrac_speed - ball speed in cm/s - fictrac_rot - ball rotation in deg/s Error estimates relative to manual annotations - median position error is about 0.050 mm. - median angle error is about 5 degrees Any variations found below this scale are probably noise in the tracking. Metadata ======== (This is mostly for Pierre.) This was processed using the 2020-08-10-sarah template, using the network flypose-TuthillLab-2020-07-31 .