Commit 0dd9df5d authored by Roman Sarrazin-Gendron's avatar Roman Sarrazin-Gendron
Browse files

folded fewer candidates

parent c7d67b47
......@@ -109,29 +109,30 @@ def returner(scores,seq,ss="",m=4,n=4):
returner = []
final_top = {}
for z in topitems:
poz = ast.literal_eval(z[0])
current_score = z[1]
cons = scores[i][1]
cons_dict = {}
cons_seq = ""
for p in range(len(poz)):
cons_dict[poz[p]]=cons[p]
for nuc in range(0,len(seq)):
if nuc in cons_dict.keys():
cons_seq = cons_seq + (cons_dict[nuc])
else:
cons_seq= cons_seq + ('.')
#print(cons_seq)
if "." in cons_seq:
#start1 = time.time()
nocons_score = testSS.call_rnafold(seq)
cons_score = testSS.call_rnafold(seq,cons_seq)
quotient = (nocons_score/cons_score)
current_score = current_score+0.2*math.log(quotient)
final_top[str(poz)] = current_score
#end1 = time.time()
#print("FOLDING TIME")
#print(end1-start1)
if topitems[z]>11:
poz = ast.literal_eval(z[0])
current_score = z[1]
cons = scores[i][1]
cons_dict = {}
cons_seq = ""
for p in range(len(poz)):
cons_dict[poz[p]]=cons[p]
for nuc in range(0,len(seq)):
if nuc in cons_dict.keys():
cons_seq = cons_seq + (cons_dict[nuc])
else:
cons_seq= cons_seq + ('.')
#print(cons_seq)
if "." in cons_seq:
#start1 = time.time()
nocons_score = testSS.call_rnafold(seq)
cons_score = testSS.call_rnafold(seq,cons_seq)
quotient = (nocons_score/cons_score)
current_score = current_score+0.2*math.log(quotient)
final_top[str(poz)] = current_score
#end1 = time.time()
#print("FOLDING TIME")
#print(end1-start1)
final = heapq.nlargest(n,final_top.items(),key=itemgetter(1))
for t in final:
poz = ast.literal_eval(t[0])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment