As a test I am aligning the following reads
@sequence1
CCTCATCAGGCACCCTG
+
FFFFFFFFFFFFFFFFF
@sequence2-X
CCTCATCAGGCACCTCTG
+
FFFFFFFFFFFFFFFFFF
to the reference sequence
CCTCATCAGGCACCCTG
using the arguments (just to play around and understand with alignment scores and penalties)
--ma 2 --mp 1,1 --rdg 1,1 --rfg 1,1 --local --score-min C,10 -N 1 -L 2 -i C,1 --threads 12 -a
Three of the alignments I get are
sequence1 0 0 1 39 17M * 0 0 CCTCATCAGGCACCCTG FFFFFFFFFFFFFFFFF AS:i:34 XS:i:14 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:17 YT:Z:UU
sequence2-X 272 0 1 25 8S10M * 0 0 CAGAGGTGCCTGATGAGG FFFFFFFFFFFFFFFFFF AS:i:14 XS:i:14 XN:i:0 XM:i:2 XO:i:0 XG:i:0 NM:i:2 MD:Z:3C2C3 YT:Z:UU
sequence2-X 0 0 1 25 12M1I5M * 0 0 CCTCATCAGGCACCTCTG FFFFFFFFFFFFFFFFFF AS:i:29 XS:i:14 XN:i:0 XM:i:1 XO:i:1 XG:i:1 NM:i:2 MD:Z:13C3 YT:Z:UU
As you can see first one is 17M and so score is 17x2 = 34 as denoted in the AS field. But second alignment is 8S10M and since this is local should be 20 but alignment score is 14. Similarly third one is 12M1I5M which should be 17x2 - 1-1 = 32 but it denotes the score as 29. The second one is 6 lower and the third one 3. Am I miscalculating alignment scores?
Thanks
Huh, thanks I thought M was always a match should have looked at the sequences manually. Now that I did it is obvious there should have been some mismatches.