DOI: 10.5061/dryad.sbcc2frj6
title: Quantification of flagellar gait changes with combined shape mode analysis and swimming simulations

description: Many different microswimmers propel themselves using flagella that beat
 periodically. The shape of the flagellar beat and swimming speed have been
 observed to change with fluid rheology. We quantify changes in the
 flagellar waveforms of Chlamydomonas reinhardtii in response to changes in
 fluid viscosity using (1) shape mode analysis and (2) a full swimmer
 simulation to analyze how shape changes affect the swimming speed and to
 explore the dimensionality of the shape space. By decomposing the gait
 into the time-independent mean shape and the time-varying stroke, we find
 that the flagellar mean shape substantially changes in response to
 viscosity, while the changes in the time-varying stroke are more subtle.
 Using the swimmer simulation, we quantify how the swimming speed is
 affected by the dimensionality of the flagellar shape reconstruction, and
 we show that the observed change in swimming speed with viscosity is
 explained by the variations in mean flagellar shape and beat frequency,
 while the changes in swimming speed from the different time-varying
 strokes are on the scale of variation between cells. 
description: [https://doi.org/10.5061/dryad.sbcc2frj6](https://doi.org/10.5061/dryad.sbcc2frj6) ## Code/Software MATLAB programs related to the paper. There are two main scripts: one to generate lower dimensional shape model using the data attached and determining how many shape modes and frequencies in the time-dependent coefficients and one to perform the numerical swimming simulation. Supporting routines for both the shape model script and the simulation script are in appropriately named source directories, 'ShapeModel_Source' and 'Simulation_Source'. The folder titled 'Shape Models' is where the .mat files containing the data structure for reconstructing the flagellar shapes are saved to, and already contains sample shape model reconstructions for the different cells in the data set, using 4 shape modes and 2 Fourier coefficients, as is used in the majority of the paper. The folder titled 'Simulation_Data' is currently empty, but if you run the simulation script, information from the simulation will be saved there.  ##### generate\_shapemodel.m Generate a shape model utilizing a shape basis of all the cells included in the data set.  The first two lines in the script allow a choice of the number of shape basis modes and frequencies used in the Fourier series reconstruction of the time-dependent coefficients. The shape model for each cell is saved in a .mat file inside the folder ‘Shape Models’ and is appropriately labeled based on the cell chosen from the data set, the number of shape modes, and the number of frequencies. The source files needed for this script are found in the folder 'ShapeModel_Source'. The output of this script will be saved as a .mat file to the folder 'Shape Models': * shapemodel: A structure that includes structures relevant to the reconstruction of the flagellar shapes, including: * shape_mode: the requested number of shape basis modes * omega: the frequency * len: the length of the flagellum * per: the period of the flagellar beat * phase: the approximate phase angle * Nmode: the number of shape modes * Ncoeff: the number of frequencies for the Fourier series * Ns: the number of space discretization points along the flagellum * Nt: the number of time discretization points * ds: spacing between space discretization points * Acossin: the coefficients of the Fourier series * phibar: mean shape of the flagellum in tangent angles (mean across time) * SpaceMeanPhi: mean of tangent angles of the flagellum across space * space_scale: data space scale, pixel to length factor, 1 pixel ~ 0.2 microns * time_scale: data time scale, frame rate per second of data * V: time-dependent coefficients * modelname: string denoting cell of data used * atch_angle: angle from data where flagellum is attached to cell * side: denotes chirality of flagellum, -1 for left and 1 for right * diameter_FGLAlength: body diameter to flagella length aspect ratio * XT: position of the flagellum according to data * fluidtype: string denoting cell used from dataset * viscosity: viscosity of the fluid that cell from dataset swims in ##### simulation.m Simulation of *C. reinhardtii* swimming in a Newtonian fluid with prescribed shape using previously generated shape model. Note that you need to generate a shape model using the previously script with the desired number of shape modes and frequencies before using this script. The code produces the numerical swimming speed used in Figures 9-13 in the paper. This code will run the swimming simulation using source code from the 'Simulation_Source' folder. Note that the reconstruction of the cell body is made using pre-determined maximum determinant points on a sphere, which are included as .csv files. These files are originally from Rob Womersley's collection of point sets on a sphere (Womersley R., Maximum determinant (Fekete, Extremal) points on the sphere. https://web.maths.unsw.edu.au/∼rsw/Sphere/MaxDet/, 6 2020.)  The output of the simulation will be saved to the 'Simulation_Data' folder as a .mat file: * XT: position of body and flagella computed in the simulation - FT: forces computed in the simulation at each discretization point - shapemodel: structure used to prescribe motion to flagella - Ns: number of space discretization points along each flagellum - Nt: number of time discretization points used per period - Nper: number of periods of data computed - X0_save: position of a single reference point at each time discretization point - UT: speed of *C. reinhardtii* computed in the simulation at each time discretization point - omega: rotational speed of *C. reinhardtii* computed in the simulation at each time discretization point   ## Data The folder titled "Data" includes 10 .mat files which contain experimental data used throughout the paper. Data was originally published in Qin, B., Gopinath, A., Yang, J. *et al.* Flagellar Kinematics and Swimming of Algal Cells in Viscoelastic Fluids. *Sci Rep* **5**, 9190 (2015). [https://doi.org/10.1038/srep09190](https://doi.org/10.1038/srep09190).  Each .mat file includes the following information: * aspect ratio: *C. reinhardtii* body diameter to flagellum length aspect ratio - atch_angle: attachment angle of the flagellum to the body (radians) - flagella_length: average flagellum length across time points (pixels) - fluidtype: string denoting cell used from dataset - phi: tangent angles of flagellum - side: denotes chirality of flagellum, -1 for left and 1 for right - space_scale: data space scale, pixel to length factor, 1 pixel ~ 0.2 microns - speed: *C. reinhardtii* swimming speed (pixels per frame) - time_scale: data time scale, frame rate per second of data - viscosity: viscosity of fluid (cP) - XX: X position of flagellum (pixels) - YY: Y position of flagellum (pixels) ## Access information Data was derived from the following sources: * Qin, B., Gopinath, A., Yang, J. *et al.* Flagellar Kinematics and Swimming of Algal Cells in Viscoelastic Fluids. *Sci Rep* **5**, 9190 (2015). [https://doi.org/10.1038/srep09190](https://doi.org/10.1038/srep09190) * Womersley, R. Maximum determinant (Fekete, Extremal) points on the sphere. https://web.maths.unsw.edu.au/∼rsw/Sphere/MaxDet/, 6 2020.