L
L
Liza132021-11-24 21:30:03
Python
Liza13, 2021-11-24 21:30:03

What is wrong with these code snippets for local sequence alignment?

def max3t(v1, v2, v3):
    if v1 > v2:
        if v1 > v3:
            return 1
        else:
            return 3
    else:
        if v2 > v3:
            return 2
        else:
            return 3

T[i][j] = max3t(S[i - 1][j - 1] + (match if Y[i - 1] == X[j - 1] else mismatch),
S[i][j - 1] + gap,
S[i - 1][j] + gap,
)
if T[i][j] < 0:
best = T[i][j]
optLoc = (i, j)

if T[i] [j] == 1:
res[0] = Y[i - 1] + res[0]
res[1] = X[j - 1] + res[1]
i -= 1
j -= 1
elif T[ i][j] == 2:
res[0] = "−" + res[0]
res[1] = X[j - 1] + res[1]
j -= 1
elif T[i][j] == 0:
res[0] = X[i - 1] + res[0]
res[1] = "−" + res[1]
i -= i

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question