-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to use extension #18
Comments
Hi,
No, I'm afraid it is not the same. If you specify the following:
You are telling the WFA that it can start the pattern/query alignment at pos=7 (previous deletions are for free) or the text at pos=11 (previous insertions are for free). Note that, in ends-free mode, it cannot do both (it is not local alignment). To do this properly, I'm afraid, you will have to run 2 alignment extensions: left and right from the seed ends. We had another request to offer this functionality in the API. We could probably offer this out-of-the-box (but don't wait for me).
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). Let me know. Cheers |
Thanks for the reply. Re score-only positions, that's great! I can access the struct directly. For extension, an API for that would be great. Meanwhile, I don't understand how to specify the values for both calls. An example would be great, or if the readme section for this used real values that matched the text instead of e.g. |
Hi brentp, Best Regards Dimi |
I am also not certain how extension works. The documentation says:
But "text_end_free" is not defined. What do I set it to, if I want to do a right-extension? I initially thought that these were boolean values and just set |
Ah, OK, so the value that one needs to set actually depends on the length of the sequences? I have previously only worked with NW and SW algorithms, so that's why I am confused, maybe. There I can have a right extension, where the extension continues computing to the end, but keeps track of the maximum score (best) in the matrix, and then it backtracks from there to the beginning. As a result, the alignment itself can contain gaps (that are not free), but the gaps "behind" the (clipped) alignment are free. It looks like this kind of "right-extension" is not possible here? Because gaps are always scored until a fixed position X and then never afterwards? |
Right! You can increment or decrement these values as you deem appropriate.
NW is usually presented as global (end-to-end) or semi-global (ends-free). WFA implements these two modes. SW is usually presented as local alignment, WFA cannot do local (not that I know).
From your description, it seems to me that you are looking for true local alignment; that cannot be done with WFA. What WFA can do is extend until the score drops below a certain threshold and return the alignment until that point back to the beginning allowing a trim/deletion at the beginning of the query or text for free. EDIT: It just occurred to me that, probably, if you were using another library (or tool) to achieve this behaviour, you could let me know the details so I can narrow down the behaviour you are looking for. That would help. |
Hi, I'm using the code below to evaluate using wfa-lib to extend given a seed. Based on the docs, I though it would have to extend left and then right in 2 different calls, but it seems that's not the case.
In brief, given:
I get the full alignment:
So, for seed and extend, is it only needed to do something like this and it will indeed extend right as well?
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.
thanks in advance.
here is the code I use for testing.
The text was updated successfully, but these errors were encountered: