Skip to content

Contains functions for fitting septal images and analysing constriction vs. time data

Notifications You must be signed in to change notification settings

HoldenLab/septal_constriction_analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

septal_constriction_analysis

Contains functions for fitting septal images and analysing condensation and constriction vs. time data

This is the version of code used in Whitley, Jukes et al. bioRxiv 2020 and Whitley, Jukes et al. 2021 Nature Communications.

Users should first open the script fit_septum_explicit_1D_batch_wrapper_v2_example.m and modify parameters as needed (each should be adequately commented). To use, this script should be in a directory containing (i) a video of growing and dividing cells that ends with 'bgsub.tif' (we always used denoised and background-subtracted videos, although this is not required), (ii) an accompanying data file containing tracked septa/Z-rings as output from MicrobeJ (v5.13I), and (iii) if using the 'param.segment' option, a second directory called 'segmented' with an accompanying video file output from ilastik (v1.3.3post2) ending with 'binary.tif' where pixels inside bacterial cells have a value of 1 and all others have value 0. When run, this script calls fit_septum_explicit_1D_batch_stripped_v2.m.

fit_septum_explicit_1D_batch_stripped_v2.m calls two functions to fit bacterial Z-rings/septa to an explicit model: separate_microbej_tracks_v2.m and fit_septum_explicit_1D_general_v2.m, then plots raw data traces with all fitting data saved in the UserData variable 'ud'. The UserData can be extracted from any saved Matlab fig file by opening it and running 'ud = get(gcf,'UserData');' from the command line.

separate_microbej_tracks_v2.m takes the tracking data output from MicrobeJ and extracts a small box around the corresponding centroid regions in the video file for each frame of the trajectory.

fit_septum_explicit_1D_general_v2.m goes through each extracted, tracked Z-ring/septum and fits it to obtain relevant parameters. It first identifies the septal axis either using segmented data (if provided) or by guessing, and then obtains line profiles across both the septal axis and cell axis. It then fits the line profiles across the septal axis to an explicit 1D model (see Whitley, Jukes et al. 2021 Nature Communications Supplementary Note 1 for derivation) to obtain diameters and other parameters, and fits the line profiles across the cell axis to a super-Gaussian model to obtain thicknesses and other parameters. All of these parameters are saved into the UserData of the raw data fig file.

plot_constriction_results2.m takes a variable named 'alldat2' (users can simply run 'alldat2 = ud;' from the command line), fits, and plots various aspects of the data. To run, users should open this script and choose the fitting parameters as well as which plots are desired at the top of the script. Data can be fitted to several models that are described in fit_constriction_data.m with default guess parameters, upper and lower bounds.

fit_septum_explicit_1D_SINGLE_wrapper_example.m is used separately. This script analyzes single frames of Z-rings/septa that have been manually selected by the user - not tracks - and puts the results in matrix called 'results'. To use, this script should be in a directory with (i) another directory called Indiv_rings that contains individual frames of septa outputted from the 'Batch Crop Rings 1frame' script in RingAnalysisIJ in Fiji, and (ii) if using the 'param.segment' option, another directory called segmented\Indiv_rings that contains individual frames of septa cropped from a video file outputted from ilastik containing the segmented cells. When run, this script runs each frame through the function fit_septum_explicit_1D_general_v2.m.

plot_f_constrict_diam.m takes a variable named 'results2' and makes various plots. To run, users should open this script and choose which plots are desired at the top of the script. The matrix 'results2' contains all the columns of 'results', but users need to fill in some of the columns manually (namely, column 8: did Z-rings constrict or not?, and column 17: did Z-rings condense or not?).

About

Contains functions for fitting septal images and analysing constriction vs. time data

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages