smarco / WFA2-lib

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

Right score for score-only alignment? #81

Closed haojingshao closed 1 year ago

haojingshao commented 1 year ago

Hi Smarco, I'm testing the examples/basic.c to test the score-only alignment(_attributes.alignment_scope = computescore;).

In the output, I got two scores. Score1: alignment score (_wfaligner->cigar.score) Score2:SCORE (RE)COMPUTED (_cigar_score_gap_affine(&wf_aligner->cigar,&attributes.affinepenalties))

In normal full-cigar alignment mode, Score1 may equal to score2. But score2 is equal to the standard NW algorithm score. In score-only mode, Score1 is available but not equal to standard NW algorithm score. Score2 is not available, possibly because this mode does not calculate cigar.

Is there a way to use score-only alignment mode to get the correct NW algorithm score?

Best regards, Haojing

smarco commented 1 year ago

Hi,

Whether you get the score from wf_aligner->cigar.score or re-compute the score, the resulting score has to be the same (otherwise is a bug). Can you copy and paste the C-code example that reproduces the problem?

Thanks,

haojingshao commented 1 year ago

Thank you for your quick response. I solve this problem. My error code is in version V2.2. I get the same score when I use the newest version. :)