Skip to content
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

Wrong protein alignment but correct score #61

Closed
martin-steinegger opened this issue Apr 24, 2019 · 1 comment
Closed

Wrong protein alignment but correct score #61

martin-steinegger opened this issue Apr 24, 2019 · 1 comment

Comments

@martin-steinegger
Copy link

martin-steinegger commented Apr 24, 2019

I tried to align two sequences query WSAPSVLLNAS and target WHSSPSILLNS using the following command.

 ssw_test -c -p target.fas query.fas 

The resulting score is 56 according to ssw.

optimal_alignment_score: 56	strand: +	target_begin: 1	target_end: 11	query_begin: 1	query_end: 11

Target:        1    WHSSPSILL-N    10
                    |******|* *
Query:         1    WSAPSVLLNAS    11

However if I try to rescore the alignment than I end up with a score of 11

WW    HS     SA    SP    PS    SV   IL    LL    LN    -   NS
15 +  -1 +   1  +  -1 +  -1  + -2 +  2  +  5 +  -4 + -3 + 1  = 12

The correct alignment should look like this

optimal_alignment_score: 56	strand: +	target_begin: 1	target_end: 11	query_begin: 1	query_end: 11

Target:          1 WHSSPSILLN-S      11
                   | |*||*||| |
Query:           1 W-SAPSVLLNAS      11

The error occurs if there is a single match followed by a deletion at the beginning of the alignment.
The banded_sw function produces the error.

@martin-steinegger martin-steinegger changed the title Wrong protein alignment but correct score Wrong protein alignment and score Apr 24, 2019
@martin-steinegger martin-steinegger changed the title Wrong protein alignment and score Wrong protein alignment but correct score Apr 24, 2019
@martin-steinegger
Copy link
Author

The fix is to change line

while (LIKELY(i > 0)) {
to while (LIKELY(i > 0) || LIKELY(j > 0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants