Rule historef¶
Purpose¶
The goal of historef rule is to match the histology image with the spatial coordinates of the spatial digital gene expression (SGE) matrix. This is achieved by aligning fiducial markers observable in both the histology image and the composite image of "sbcd", "smatch", and "sge" images. The current pipeline allows multiple input histology files.
Input Files¶
-
A histology image Th histology image with fiducial markers is required. The
historefidentifies fiducial marks by detecting the brightness in the input histology image, so it is crucial that fiducial markers are the brightest area in the histology image. -
The composite image The composite image, which shows "sbcd", "smatch", and "sge" images side-by-side, will also be applied to
historef.
Output Files¶
The rule generates the following output in the specified directory path:
1 | |
(1) A referenced Histology File¶
Description: The referenced histology file, which is in GeoTIFFformat, allows the coordinate transformation between the SGE matrix and the input histology image.
File Naming Convention:
1 | |
- The
magnificationandfigtypeare derived from themagnificationandfigtypefields within thehistologyin theinputsection of the job configuration file. - The
flowcell_abbreviationis derived by splitting theflowcell_id, which is sourced from theflowcellfield ininputsection of the job configuration file, by "-" and taking the first part.
File Visualization:
The image displayed above only serves an initial glimpse into the results but has been substantially reduced in size and is presented in PNG format.
For an in-depth examination, access the full-size referenced histology file in the example datasets for NovaScope-exemplary-downstream-analysis (NEDA).
(2) A Re-sized Referenced Histology File¶
Description: A TIFF file shares the identical dimensions with both the "smatch" image and the "sge" image, acilitating the comparison of consistency between the histology file and these images.
File Naming Convention:
1 | |
- The
magnificationandfigtypeare derived from themagnificationandfigtypefields within thehistologysection of the job configuration file. - The
flowcell_abbreviationis derived by splitting theflowcell_id, which is sourced from theflowcellfield ininputsection of the job configuration file, by "-" and taking the first part.
File Visualization:
An example re-sized referenced histology TIFF is provided in the access the full-size referenced histology file in the example datasets for NovaScope-exemplary-downstream-analysis (NEDA).
Output Guidelines¶
To verify the accuracy of the alignment, it is recommended to compare the re-sized referenced histology file against the "smatch" image and the "sge" image, ensuring a precise match with the histology images. A clear visibility of fiducial marks in both images indicates an accurate match with submicrometer resolution upon overlay. If the fiducial marks are insufficiently visible or aligned incorrectly, manual adjustment of the histology images is required.
Parameters¶
The following parameter in the job configuration file will be applied in this rule.
1 2 3 4 5 | |
- The
histologyParametersmin_buffer_size,max_buffer_sizeandstep_buffer_sizewill create a list of buffer size helphistorefto do the alignment. For example, the defaultmin_buffer_size,max_buffer_sizeandstep_buffer_sizeare 1000, 2000, and 100, respectively, and this will return a buffer size list of 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000.raster_channelspecifies which channel from the "sge" image will used forhistorefalignment
Dependencies¶
Rule historef commences only after Rule dge2sdge has successfully executed. An overview of the rule dependencies are provided in the Workflow Structure.
Code Snippet¶
The code for this rule is provided in b02_historef.smk