Skip to content

Averaging of basal bodies per cell

Eugene Katrukha edited this page Sep 1, 2025 · 24 revisions

This first part of the workflow calculates averages of basal bodies per volume (cell surface). See the illustration below.
part1

For this part, we would need the contents of part1_cells_processing folder.
Please download all macro files and store them in some folder on a hard drive.
It consists of multiple macros that are supposed to run one after another
(their filenames have prefixes s1_.., s2_..., etc), performing a sequence of steps.

There are two ways to run this part:

  • batch processing of many folders (images) with all steps at once;
  • running individual steps (macros) at individual image files.

We are going to start with

Batch processing

There is a special requirement on how the input data should be organized.

input folder structure

You need to make the following folder structure:
(all_data_folder in the provided data corresponds to Figure4/part1_cells_processing)

all_data_folder
├── proteinName1_proteinName2_decov_001
│   ├── CellStackAnyNameXYZ.tif
│   └── RoiSetAnyName.zip
├── proteinName1_proteinName2_decov_003
│   ├── CellStackAnyNameXYZ.tif
│   └── RoiSetAnyName.zip
├── proteinName3_decov_001
│   ├── CellStackAnyNameXYZ.tif
│   └── RoiSetAnyName.zip
...
  • The main all_data_folder (can have any name) contains multiple folders. Each folder corresponds to a single image (Z-stack).
  • Inside this folder should be only two files:
    • TIF file with the multichannel Z-stack (any filename);
    • ZIP file with the corresponding ROIs exported from FIJI (any filename, see more info below).
  • It is assumed that the reference "total protein" channel is always the last channel in the TIF file.
  • The TIF file itself can have 2, 3, or 4 channels. In the case of 4 channels, channel #3 is going to be ignored.
  • The folder containing TIF and ROIs should have a name in the format of
    • proteinName1_proteinName2_decov_00N for 2 protein stainings, corresponding to channels 1 and 2;
    • proteinName3_decov_00N for a single protein staining, corresponding to channels 1.
  • so protein names should be written without gaps and separated by underscores.
    You need to add _decov_00N suffix in the end, where N could be any number.

NB: It is assumed that the TIF files have the same voxel size/calibration and it is specified in the properties (Fiji->Image->Properties...)

initial ROIs per file

For each Z-stack, there should be a ZIP file containing multiple ROIs, exported from FIJI's ROI Manager.
The ROI type could be a circle or rectangle, with its center
approximately aligning with the center of a basal body at an arbitrarily selected z-plane.
It is important that the ROI is assigned to the specific z-plane.
ROIs creation can be performed manually or using (part 1) Step 0: auto ROIs generation procedure (faster and preferable).

run batch processing

Drag and drop the main batch_many_folders_.ijm macro to FIJI and press Run in the newly opened Script editor.
This macro will execute all other macros in the folder in proper order and generate final averages.
First, a dialog with the analysis parameters should appear. These are the values we used in our publications. If you want to adjust them for your dataset,
the description of parameters is provided at (part 1) Processing parameters page.
Next, a folder chooser dialog will prompt you to select the main all_data_folder location.
Next, another folder chooser dialog will ask for the folder with code/macro (part1_cells_processing) location on the hard drive.
It can take considerable time to run an analysis (around one hour per z-stack or more).
It is not recommended to use the PC during the run, since you can break the process.
During execution, some errors may appear in the Console window, but they can be ignored.
If analysis continues to run, it should be ok :)

output

The output of the workflow for each file is stored in the same folder.
Upon successful completion, the structure of the all_data_folder should look like this:

all_data_folder
├── proteinName1_proteinName2_decov_001
│   ├── logs
│   │   ├── 20240715123837_log_s1_detect_BB_macro.txt
│   │   └── ...
│   ├── s1_detected
│   │   ├── 01.csv
│   │   └── ...
│   ├── s2_extracted
│   │   ├── 01_straight.tif
│   │   └── ...
│   ├── s3_rotated_XY2
│   │   ├── detected
│   │   ├── 01.tif
│   │   └── ...
│   ├── s3_rotated_XY2_avg
│   │   ├── intermediate
│   │   ├── registered
│   │   ├── proteinName1_proteinName2_decov_001_XY2_final_avg_4.tif
│   │   ├── proteinName1_proteinName2_decov_001_XY2_final_avg_4_diam.csv
│   │   └── ...
│   ├── CellStackAnyNameXYZ.tif
│   └── RoiSetAnyName.zip
├── proteinName1_proteinName2_decov_003
│   ├── logs
│   ├── s1_detected
...

The final average volume (per cell) is stored in the s3_rotated_XY2_avg folder
under the name proteinName1_proteinName2_decov_00N_final_avg_M.tif.
The number M at the end of the filename specifies the final (best) averaging iteration.
The csv file proteinName1_proteinName2_decov_00N_final_avg_M_diam.csv
stores diameter and XY coordinates of the central BB axis (total protein stain channel) along Z.
The folder log contains logging output of macros.

The output of intermediate steps in other folders is described
in details below.

Alternatively to batch processing, one can perform

Individual steps analysis/description

In this case you can run each step on a single proteinName1_proteinName2_decov_001
(or any other name) folder.

Clone this wiki locally