6 def NeedlemanWunsch(seqA
, seqB
, match
, mismatch
, gap
):
15 for i
in range(1, a
+1):
16 for j
in range(1, b
+1):
19 if (seqA
[i
-1] == seqB
[j
-1]):
23 if (F
[i
-1,j
-1] + chscore
> F
[i
,j
]):
24 F
[i
,j
] = F
[i
-1,j
-1] + chscore
26 if (F
[i
-1,j
] + gap
> F
[i
,j
]):
27 F
[i
,j
] = F
[i
-1,j
] + gap
28 if (F
[i
,j
-1] + gap
> F
[i
,j
]):
29 F
[i
,j
] = F
[i
,j
-1] + gap
31 # print "** ", a, b, F[a,b]
34 print NeedlemanWunsch(sys
.argv
[1],sys
.argv
[2],1,0,-1)