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
historef
identifies 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
magnification
andfigtype
are derived from themagnification
andfigtype
fields within thehistology
in theinput
section of the job configuration file. - The
flowcell_abbreviation
is derived by splitting theflowcell_id
, which is sourced from theflowcell
field ininput
section 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
magnification
andfigtype
are derived from themagnification
andfigtype
fields within thehistology
section of the job configuration file. - The
flowcell_abbreviation
is derived by splitting theflowcell_id
, which is sourced from theflowcell
field ininput
section 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
histology
Parametersmin_buffer_size
,max_buffer_size
andstep_buffer_size
will create a list of buffer size helphistoref
to do the alignment. For example, the defaultmin_buffer_size
,max_buffer_size
andstep_buffer_size
are 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_channel
specifies which channel from the "sge" image will used forhistoref
alignment
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