Example #1
0
    newalign_y = ""
    trail = True
    for ith, jth in zip(align_x, align_y):
        if (ith or jth) == "-" and trail == True:
            trail = True
        else:
            newalign_x += ith
            newalign_y += jth
            trail = False '''
        
    oldscore = score 
    score = 0       
    for ith, jth in zip(align_x, align_y):
        score += scoring_matrix[ith][jth]
    #score = alignment_matrix[len(seq_x)][len(seq_y)]  
    print "Oldscore = ", oldscore
      
    print "VALIDANCE = ", oldscore == score    
        
    return (score, align_x, align_y)


pro1 = LoadHelper.read_protein(LoadHelper.HUMAN_EYELESS_URL)
pro2 = LoadHelper.read_protein(LoadHelper.FRUITFLY_EYELESS_URL)
matr = LoadHelper.read_scoring_matrix(LoadHelper.PAM50_URL)

alimat = PR.compute_alignment_matrix(pro1, pro2, matr, False)

print compute_local_alignment(pro1, pro2, matr, alimat)