smarco / WFA2-lib

WFA-lib: Wavefront alignment algorithm library v2
Other
162 stars 36 forks source link

Retrieving the extent of an alignment #47

Open marcelm opened 1 year ago

marcelm commented 1 year ago

Hi, there was a question by @brentp in issue #18 about how to retrieve the extent of an alignment:

Also, is there an efficient way for this to get the start, end of the alignment in the pattern and text? I don't need the full cigar or backtace, only the extents of the alignment. Ah. You mean, score-only alignment-extension, but returning the position where it stopped. Interesting idea. You can always access the position where the alignment stopped the extension HERE. I can provide a friendly API to retrieve this info (if useful).

The provided link seems to be out of date. Could you perhaps point out again which field to access?

Also, I am currently using the C++ WFAligner class and would be happy if there were a friendly API for getting this information. But this is not urgent as I can just to using the C interface.

Note that in my case, I would be interested in this information even when running the alignment with backtrace. I can get it by parsing the CIGAR, but it feels unnecessary to do so when – I assume – accessing an attribute would be all that is needed.

(Note regarding the out-of-date link: If you view a source code file on GitHub, press the y key to switch to a URL that includes the commit hash. When you use that as the link, it will continue to work even when the file changes.)