Welcome back to our four-part series, “Image Alignment Demystified.” In our previous article, we acquainted ourselves with the foundational concepts of image alignment in the world of Melanie. Here, we’re on a deeper exploration, navigating through the intricacies of alignment quality assessment and pinpointing potential alignment issues.

While current alignment algorithms generally produce very convincing results, automatic alignment results should always be critically reviewed. That’s because relatively minor mismatches can have very impactful results. Things are not different for Melanie. Therefore, in this second part of our blog series on image alignment in Melanie, we’ll touch on various criteria that can be used to evaluate alignment quality and introduce tools that can be used to detect and correct alignment issues.

Match percentage to evaluate alignment quality relative to other alignments

Melanie’s match percentages give an insight into the efficiency of the alignment with respect to all spots detected on a reference image and helps to compare different alignments. To comprehend match percentages fully, it is essential to grasp how they are calculated and what they represent.

Understanding match percentage

The match percentage is derived by dividing the number of total matches (comprising automatic matches and user matches) by the number of spots detected in the reference image. This calculation provides a relative measure of alignment success.

When inspecting the match percentage in the Tree view, hovering over it reveals a tooltip that explains the calculation in detail. This tooltip displays the number of automatic matches, user matches, and the total number of spots in the reference image.

It’s imperative to realize that the match percentage, as well as the number of matches, is exclusively tied to the Alignment step. The final spot detection, where 100% of spots will be matched, will not change these numbers.

Rating match percentage

Interpretation of match percentages can be a nuanced matter. Influenced largely by the density and number of spots on the reference image, this percentage can vary greatly depending on the type of sample being examined. For gels with fewer spots, most of which are matched, the percentage may be high, whereas dense patterns may give a lower percentage despite many matches.

It is therefore important not to be misled into thinking that a high match percentage equates to perfect alignment, or vice versa. Even with a match percentage as low as 10%, the alignment may be satisfactory if the matches are accurate, aligning spot patterns without causing undue distortion. Conversely, higher percentages such as 70-80% may still be associated with alignment discrepancies.

Rather than being an absolute metric, the match percentage shines as a comparative measure to contrast different alignments against the same reference image. By experimenting with alternative alignment setups, such as changing alignment groups or reference images, you can see which configuration maximizes match percentages, indicating the most effective setup for your dataset.

Tools for visual evaluation

There are other criteria to evaluate alignment quality, such as match length, match orientation, image deformation, etc. Melanie offers a number of visualization tools that allow you to look at some of these criteria to evaluate the quality of an alignment and find and correct alignment issues:

Warp + Grid

With the Grid and Warp options activated, you can locate areas that are excessively distorted due to one or several wrong vectors. You should particularly pay attention to kinks in the grid lines.

Match vector length and direction

Once you locate an excessively distorted area, you can look at the unwarped image to identify incorrect match vectors: Turn the ‘Warp’ option off, double-click the mouse scroll wheel in the problematic area to recentre, and identify match vectors that have inconsistent length and/or direction compared to neighbouring vectors.

Ratio table

The Ratio table equips you with the means to identify the most distorted spots and consequently, the most distorted regions within the aligned image. Specifically, when ‘Area’ is chosen from the drop-down list in the Ratio table, the ratio metric offers an insight into the degree of spot shape distortion. A ratio deviating significantly from a value of 1 suggests that the shape of the spot has been altered due to alignment corrections. Therefore, it is crucial to scrutinize the appropriateness of matches located in the vicinity of such deformed spots.

Dual colour

In this view, the reference image and the aligned image are stacked on top of each other in dual colour mode; with spots on the reference image in red and spots on the aligned image in cyan (by default). When the images are properly aligned and warped, the complementary red and cyan combine to display black spots. Differentially expressed spots will show up red or cyan. As colored areas could also indicate alignment problems, these areas should be carefully investigated.

Blink

This view animates between the reference image and the aligned image stacked on top of each other. In this view, areas that show movement should get particular attention to make sure there are no wrong matches.

3D view

The 3D view is fantastic to precisely position matches. You can activate “Use white color” in the 2D/3D options, so that the tips of the spots appear brighter when seen from the top in 3D view. This works really well to check that matches are positioned on the top of the peak, or simply to precisely position matches.

Conclusion

Automatic alignment results, no matter how advanced, require meticulous review. The combination of match percentages and visual tools offered by Melanie ensures you’re equipped to critically evaluate and rectify alignment anomalies.

As this chapter concludes, remember that our journey through alignment isn’t over. Keep an eye out for our next article, in which we will offer a series of Recommendations for Effective Alignment. Whether you’re charting unknown alignment waters or refining your existing skills, our upcoming guide will be a valuable resource.