Skip to content

Commit

Permalink
def
Browse files Browse the repository at this point in the history
  • Loading branch information
HussainAther committed Apr 23, 2019
1 parent db93d8a commit 81bec7e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions biophysics/minenergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,22 @@ def V(x, y):
Energy of optimal structure of the subsequence from x through y
closed by (x, y).
"""
return min(eH
return min([eH(x, y), eS(x, y), V(x+1, y+1), VBI(x, y, x-1, y-1), VM(x, y)]

def VM(args):
"""
Energy of optimal strucutre of subsequence from x through y where (x, y)
closes a multibranched loop. The input is a list of tuple args that describe each (x, y) pair.
"""
summa = 0
for k in range((len(args)//2)):
summa += V(args[k][0], args[k][1])
return eM(args) + summa

def VBI(a, b, c, d):
"""
For exterior base pair (a, b) and interior base pair (c, d), find
the energy of an optimal strucutre of the subsequenc from a through b
in which (a, b) closesa bulge or an internal loop.
"""
return min(eL(a,b,c,d) +
return eL(a,b,c,d) + V(c, d)

0 comments on commit 81bec7e

Please sign in to comment.