Overview#

High level view#

pyHiM software is running as a pipeline, executing sequentially a series of pre-defined routines. These routines can be classified into 5 groups:

diagram of visualization

  1. Preprocessing: Organization and formatting of the input data before proceeding with the analysis (e.g. registration or calculation of 2D projection).

  2. Identification: Image segmentation (e.g. detection of FISH spots, segmentation of nuclei or cells, etc.) and calculation of the 3D-coordinates.

  3. Matching: Addressing each detection to a unique mask.

  4. Postprocessing: Formatting output data to make post-analysis easier for the user (ex: pairwise distance matrices).

  5. Visualization: Indicating live-progress and results to the user (as .png images and .md file).

Note

Each step can be optimized with parallel computations thanks to Dask package. To use it, see --threads argument.

Data set#

To run the default pipeline, pyHiM needs two types of data:

  • A dictionary of initialization parameters, named parameters.json

  • 3D images in TIFF format (extension: .tif or .tiff).

Four types of images are accepted and will be processed in the following order:

  1. Fiducial

  2. Barcode

  3. Mask (like DAPI)

  4. RNA (optional)

Note

These types of images are called labels. Labels 1,2 & 3 are mandatory for running the default analysis pipeline.

Default pyHiM flow#

The default pipeline is composed of the following routines:

  1. project: Projects all 3D images in 2D.

  2. register_global: Computes the best shift to align all 2D fiducials. And (modules/preprocessing/applies_registrations.md) shifts 2D barcodes, masks and RNA according to the transformation computed at the register_global step.

  3. register_local: Takes 2D aligned fiducial images and finds the best shift along the Z-axis. This shift will be applied on the 3D segmented barcodes at register_localizations step.

  4. mask_2d: Segments 2D aligned masks.

  5. localize_2d: Segments 2D aligned barcodes.

  6. mask_3d: Segments masks in 3D.

  7. localize_3d: Applies 2D shift, computed at register_global step, to 3D barcodes. Then segments them in 3D.

  8. filter_localizations: Filters the localizations in 2D and 3D.

  9. register_localizations: Registers the 3D localizations with the local shifts.

  10. build_traces: Associates barcode coordinates with the relevant mask.

  11. build_matrix: Calculates the pairwise distance (PWD) matrix for each trace.

Note

You can find a description of all routines inside next section.