Hi, My name is Devika Torvi and I am a 4th year Bioengineering: Bioinformatics Student. I enjoy learning about new technologies and solving biological problems through programming. My favorite thing about San Diego are the sunsets.
“To define is to limit” - Oscar Wilde
Here is a snippet of code that outputs the most optimal alignment of two DNA strings using dynamic programming and backtracking.
def OutputLCS(backtrack, v, w, i, j):
if i == 0 or j == 0:
return(v,w)
if backtrack[i][j] == 'down':
w = w[0:j] + '-' + w[j:]
return OutputLCS(backtrack, v, w, i-1, j)
elif backtrack[i][j] == 'right':
v = v[0:i] + '-' + v[i:]
return OutputLCS(backtrack, v, w, i, j-1)
elif backtrack[i][j] == 'diagonal':
return OutputLCS(backtrack, v, w, i-1, j-1)
else:
return(v[i:], w[j:])
Link to the Beginning: Introduction