-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRosalind Problem 19 PRTM.py
17 lines (14 loc) · 1.11 KB
/
Rosalind Problem 19 PRTM.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#Create mass dictionary
file = open('/Users/gtiao/Desktop/Rosalind/Monoisotopic_mass_table.txt')
mass = dict()
for line in file:
pair = line.strip('\n').split(" ")
key = pair[0]
mass[key] = pair[1]
def weight(string):
m = 0
for x in string:
m += float(mass[x])
print m
#weight('SKADYEK')
weight('EGFMWELHMNHKHMPVPQIYQWRHTWCWHMIQGVYSTRSYPTSLINGEWFDIKWSGNFQWKSRRPSRGMSDQGATHCLPDEPELWCFTMGDACWIIAEQEDDALYGCYATGCEFKCGIILTWMCYYWPFCSSKQYHWMIRKHSIDKIIYHGSAHVAMEELHTHGTNTCPGYVCPGRYVIEICDVPCNTYEPSFHEVGPSIMSTNVIVNGFKARKDCDMQWAPNALQKRIKAFQTYQGYWPTSWRNVSKKWLSTIAHIMIETLGPKIGTIRMKSIGISRNTLCIMNLHQVSHRNRMLDMFTVVAGIWVLKCECGKSVKYATVDVQWPGSLFPAKPTRAYCSAKIHQNRTQFPCVHNRCCMRPNRDCKQTQNVNGFNHVMHVDLDLICRDTKFCGTSSNEWIHTLELTWAFHDMWWHAHDHSSGGVVNDKSLKWNIMADECFRLFALHPQLNWTFFRMPGNVLRIVVASRICPFNCKPCTGIDVHNDVFTPTHEHREMPEHKEKQATIKLTFSGQKFKITQWVYFYMSPLVWSVDAILNEDGAKANMHDVCTWRHPMVELDRHNVTKYEMFCSSAETIMNRHGRLQPCFAMWGGSQYREMGVQEFCQMSGNHCNRQFHLARMRYFICTDDVAHVAIIWQEAQNELPRKPWSWGIWRSHGDKKYPCIEKDVTQQHLKWMELSNRCTTSNTKVQNKHWVLLIMQPAIIPHCLYGTTWDDFYEEFPCGDWDITPKYMQDYQMEYFCHKHQRRMLEGHIWCEKYIHESYGVWKIICQVWYPMMYLERWTSYQMRVKGSYFHYRQEQLCHCKT')