Question : Definition of alignment extension
Closed this issue · 4 comments
Hi @lh3,
Thanks for the excellent lightweight ksw2 library! I'm working on a small C++-style wrapper since I'm interested in using ksw2 in some of our code. Perhaps I missed it in the existing documentation, but can you provide a brief description of what is meant by "alignment extension" (is it e.g. semi-global) compared to the normal global alignment, and when you might wish to use one compared to the other? Thanks!
Extension alignment is like the one used in BLAST: the start of both query and target sequences are forced to be aligned; the end of both are free to change. You typically apply such alignment for seed extension.
I have seen different interpretation of semi-global, so I have been trying to avoid it.
Thanks, Heng!
You typically apply such alignment for seed extension.
Perfect; this is exactly the use case I'm looking for. I also prefer to avoid the term semi-global / glocal, as it is somewhat ambiguous (though it seems to be common). In particular, I find the terms "fitting alignment" (i.e., one string is required to align globally to a substring of the other) and "end free" / "end-gap free" alignment (i.e., gaps before or after one or both of the strings are "free") to be at least a little bit more informative.
I see term "glocal" is often used consistently: query is globally aligned; reference is locally aligned. In the context of read mapping, end-to-end alignment has the same meaning because we know end-to-end can't be applied to the reference.
I consider semi-global alignment to be anything between global and local alignment. By this definition, overlap alignment, glocal alignment and extension alignment I described above are all semi-global alignment. Another type of semi-global alignment is: the start of both query and reference are forced to be aligned; the end of query has to be aligned somewhere; the end of reference may not be aligned. When you do extend alignment with this type of alignment in both directions, you will end up with a glocal alignment.