Skip to content
Permalink
6d5cc671f5
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
23 lines (18 sloc) 497 Bytes
import numpy as np
import cython_align
from blosum62 import *
from numpy import argmin
from fasta import readFASTA
# this is an implementation of the needleman-wunsch algorithm
# and it should handle the affine gap situation
def mismatch_penalty(A,B):
if A!=B:
return -blosum62[A+B]
else:
return -blosum62[A+B]
s=readFASTA("rosalind_laff.txt")
A=s.values()[0]
B=s.values()[1]
print A,B
score=cython_align.build_dp_array(A,B,10,1,mismatch_penalty)
print score