Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (19 sloc) 448 Bytes
wgts=[]
protein_mass={}
mass_to_p={}
with open("protein_masses.txt","rU") as f:
for line in f:
x=line.split()
protein_mass[x[0]]=float(x[1])
mass_to_p[float(x[1])]=x[0]
with open("rosalind_spec.txt","rU") as f:
for line in f:
wgts.append(float(line.strip()))
s=''
for i,x in enumerate(wgts):
if i==0:
last=x
continue
s+=mass_to_p[round(x-last,5)]
last=x
print s
You can’t perform that action at this time.