When I do:


I get:


Clearly there is an extra 3 that is missing as a common sequence number at the end:


Is this a bug? (Using Mathematica 10.0.2)


2 Answers 2


Mathematica took the alignments in the following way

  • $\begingroup$ Yes, but why this behavior? $\endgroup$ Mar 10, 2015 at 14:09
  • 1
    $\begingroup$ @Giovanni Well, I haven't checked the details but it's using the Needleman-Wunsch algorithm. $\endgroup$ Mar 10, 2015 at 14:22
  • $\begingroup$ Ok. Thanks. I thought it was an exact method of finding these sequences. $\endgroup$ Mar 10, 2015 at 16:48

If you increase the `GapPenalty" (default is zero) you can pick up the 3; however, the difference sequences get longer and the total similarity score decreases.

SequenceAlignment["-0.999995756767227832383453368554576431549", \
"-0.999995756767227832383346049698547342279", GapPenalty -> 3]

{"-0.999995756767227832383", {"453368554", "346049698"}, "5", {"7643154", "4734227"}, "9"}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.