Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 340 Bytes
from math import log,exp
with open("rosalind_eval.txt","rU") as f:
N=int(f.readline())
S=f.readline().strip('\n')
A=map(float,f.readline().split())
print N
print S
print A
k=len(S)
nAT=sum(x in {'A','T'} for x in S)
for x in A:
z=round((N+1-k)*(x/2)**(k-nAT)*((1-x)/2)**nAT,3)
print "%.3f" % (z),
You can’t perform that action at this time.