July 2, 2012, midnight by Rosalind Team
Topics: Alignment, Dynamic Programming
Mind the Gap
An affine gap penalty is written as
We can view the gap opening penalty as charging for the first gap symbol, and the gap extension penalty as charging for each subsequent symbol added to the gap.
For example, if
Consider the strings "PRTEINS" and "PRTWPSEIN". If we use the BLOSUM62 scoring matrix
and an affine gap penalty with
PRT---EINS ||| ||| PRTWPSEIN-
Matched symbols contribute a total of 32 to the calculation of the alignment's score, and the gaps cost 13 and 11 respectively, yielding a total score of 8.
Given: Two protein strings
Return: The maximum alignment score between
>Rosalind_49 PRTEINS >Rosalind_47 PRTWPSEIN
8 PRT---EINS PRTWPSEIN-