-
Notifications
You must be signed in to change notification settings - Fork 0
/
w_3.py
400 lines (328 loc) · 27 KB
/
w_3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
#from __future__ import division
from collections import Counter
import copy
import sys
def reverseComplement(string):
myStr = []
for i in range(0, len(string)):
if string[i] == 'A':
myStr.append('T')
elif string[i] == 'T':
myStr.append('A')
elif string[i] == 'G':
myStr.append('C')
elif string[i] == 'C':
myStr.append('G')
myStr = myStr[::-1]
myStr = "".join(myStr)
return myStr
def CodonDictionary():
file = '../Downloads/RNA_codon_table_1.txt'
d = {}
with open(file) as f:
for line in f:
line = line.strip('\n')
l = line.split(' ')
if l[0] not in d:
d[l[0]] = l[1]
return d
def IntergerMassDictionary():
file = '../Downloads/integer_mass_table.txt'
d ={}
with open(file) as f:
for line in f:
line = line.strip('\n')
l = line.split(' ')
if l[0] not in d:
d[l[0]] = l[1]
return d
def ProteinTranslation(rna):
pattern = []
d = CodonDictionary()
rnaCodons = [rna[i:i+3] for i in range(0, len(rna), 3)]
for codon in rnaCodons:
pattern.append(d[codon])
pattern = ''.join(pattern)
return pattern
def SubstringEncodingAminoAcid(rna, aminoAcid):
substrings = []
substringLen = len(aminoAcid)*3
for i in range(0, len(rna) - substringLen + 1):
substrings.append(rna[i:i+substringLen])
encoders = []
for sub in substrings:
reverse = reverseComplement(sub)
reverseTranslated = reverse.replace('T','U')
translated = sub.replace('T','U')
if ProteinTranslation(translated) == aminoAcid or ProteinTranslation(reverseTranslated) == aminoAcid:
encoders.append(sub)
return encoders
def NumberOfSubpeptides(n):
return n*(n-1)
def SubpeptidesLinear(n):
return n*(n+1)/2 + 1
def LinearSpectrum(peptide, convolution):
integer_mass_dict = ExtendedMassDict(convolution)
peptide = list(peptide)
PrefixMass = [0 for i in range(len(peptide) + 1)]
for i in range(1, len(peptide) + 1):
PrefixMass[i] = PrefixMass[i - 1] + int(integer_mass_dict[peptide[i - 1]])
LinearSpectrum = []
LinearSpectrum.append(0)
for i in range(0, len(PrefixMass) - 1):
for j in range(i + 1, len(PrefixMass)):
LinearSpectrum.append(PrefixMass[j] - PrefixMass[i])
LinearSpectrum.sort()
return LinearSpectrum
def CircularSpectrum(peptide, convolution):
integer_mass_dict = ExtendedMassDict(convolution)
peptide = list(peptide)
PrefixMass = [0 for i in range(len(peptide) + 1)]
for i in range(1, len(peptide) + 1):
PrefixMass[i] = PrefixMass[i - 1] + int(integer_mass_dict[peptide[i - 1]])
peptideMass = PrefixMass[len(PrefixMass) - 1]
CyclicSpectrum = []
CyclicSpectrum.append(0)
for i in range(0, len(PrefixMass) - 1):
for j in range(i + 1, len(PrefixMass)):
CyclicSpectrum.append(PrefixMass[j] - PrefixMass[i])
if i > 0 and j < len(PrefixMass) - 1:
CyclicSpectrum.append(peptideMass - PrefixMass[j] + PrefixMass[i])
CyclicSpectrum.sort()
return CyclicSpectrum
def Expand(peptide, extended_mass_dict):
p = [chr(key) for key in extended_mass_dict]
q = []
if len(peptide) == 0:
return p
else:
for pep in p:
for pep_ in peptide:
q.append(pep + pep_)
return q
def PeptideMass(peptide, convolution):
d = ExtendedMassDict(convolution)
peptide = list(peptide)
mass = 0
for pep in peptide:
mass += int(d[pep])
return mass
def PeptideMassString(peptide, convolution):
d = ExtendedMassDict(convolution)
peptide = list(peptide)
mass = []
for pep in peptide:
mass.append(str(d[pep]))
mass = '-'.join(mass)
return mass
def CyclopeptideSequencing(spectrum):
peptides = ['']
result = []
d = ExtendedMassDict()
while len(peptides) != 0:
peptides = Expand(peptides)
for peptide in peptides[:]:
if PeptideMass(peptide) == spectrum[len(spectrum) - 1]:
if Counter(CircularSpectrum(peptide)) == Counter(spectrum):
m = PeptideMassString(peptide)
if m not in result:
result.append(m)
peptides.remove(peptide)
else:
l = LinearSpectrum(peptide)
for mass in l:
if mass not in spectrum:
peptides.remove(peptide)
break
result = ' '.join(result)
return result
def CyclopeptideScoring(peptide, experimental_spectrum, convolution):
spectrum = CircularSpectrum(peptide, convolution)
peptide_dict = {}
spectrum_dict = {}
for val in spectrum:
if val not in peptide_dict:
peptide_dict[val] = 0
for val in spectrum:
peptide_dict[val] += 1
for val in experimental_spectrum:
if val not in spectrum_dict:
spectrum_dict[val] = 0
for val in experimental_spectrum:
spectrum_dict[val] += 1
score = 0
for mass in peptide_dict:
if mass in spectrum_dict:
score += min(peptide_dict[mass], spectrum_dict[mass])
return score
def LinearScore(peptide, experimental_spectrum, convolution):
spectrum = LinearSpectrum(peptide, convolution)
peptide_dict = {}
spectrum_dict = {}
for val in spectrum:
if val not in peptide_dict:
peptide_dict[val] = 0
for val in spectrum:
peptide_dict[val] += 1
for val in experimental_spectrum:
if val not in spectrum_dict:
spectrum_dict[val] = 0
for val in experimental_spectrum:
spectrum_dict[val] += 1
score = 0
for mass in peptide_dict:
if mass in spectrum_dict:
score += min(peptide_dict[mass], spectrum_dict[mass])
return score
def Trim(leaderboard, spectrum, N, convolution):
if len(leaderboard) < N:
return leaderboard
linear_scores = []
for i in range(0, len(leaderboard)):
linear_scores.append(LinearScore(leaderboard[i], spectrum, convolution))
linear_scores, leaderboard = zip(*[(x, y) for x, y in sorted(zip(linear_scores, leaderboard))])
linear_scores = list(linear_scores)[::-1]
leaderboard = list(leaderboard)[::-1]
s = linear_scores[N - 1]
for i in range(N, len(leaderboard)):
if linear_scores[i] < s:
leaderboard = leaderboard[0: i]
return leaderboard
def LeaderboardCyclopeptideSequencing(spectrum, N, convolution):
leaderboard = ['']
leader_peptide = ''
best_score = 0
d_scores = {}
while len(leaderboard) != 0:
leaderboard = Expand(leaderboard,convolution)
for peptide in leaderboard[:]:
print(leaderboard)
if PeptideMass(peptide, convolution) == spectrum[len(spectrum) - 1]:
score = CyclopeptideScoring(peptide, spectrum, convolution)
if score > best_score:
leader_peptide = peptide
best_score = score
elif PeptideMass(peptide, convolution) > spectrum[len(spectrum) - 1]:
leaderboard.remove(peptide)
continue
leaderboard = Trim(leaderboard, spectrum, N, convolution)
print(best_score, '!!!!!!!')
return PeptideMassString(leader_peptide, convolution)
def ExtendedMassDict(convolution):
d = {}
for i in convolution:
d[chr(i)] = i
return d
def Convolution(spectrum):
spectrum.sort()
convolution = []
for i in range(0, len(spectrum)):
for j in range(0, len(spectrum)):
if i != j:
val = spectrum[j] - spectrum[i]
if val > 0:
convolution.append(val)
d = dict(Counter(convolution))
print(d)
return convolution
def RestrictConvolution(convolution):
for score in convolution[:]:
if score >=57 and score <=200:
continue
else:
convolution.remove(score)
return convolution
def RankConvWithTies(convolution, M):
if len(convolution) < M:
return convolution
d = dict(Counter(convolution))
l = sorted(d, key = d.get)
l = l[::-1]
s = d[l[M - 1]]
for i in range(M, len(l)):
if d[l[i]] < s:
l = l[0: i]
break
else:
continue
convolution = l
return convolution
def ConvolutionCyclopeptideSequencing(spectrum, N, M):
convolution = Convolution(spectrum)
#print len(convolution)
convolution = RestrictConvolution(convolution)
convolution = RankConvWithTies(convolution, M)
leader_peptide = LeaderboardCyclopeptideSequencing(spectrum, N, convolution)
#leader_peptide = LeaderboardCyclopeptideSequencing(spectrum, N)
#print len(convolution)
# I totally misunderstood what ties means
# focus on the count and then select the number
# just like the last few lines of leaderboard trimming
# define restrictConvolution() and BestConvWithTies()
return leader_peptide
#n = 24460
#print NumberOfSubpeptides(n)
#rna = 'GTTACCGTAGCCTCGTTCGGTCTTTATGATTAACAAAAACTTCGTGACCCGAGGGGCCGTCCACGCTCGTGTATTTTCGTGTACTGTCACCCCCACGGCAACATTGTTGAGATTAAAATACGGAGCATCTGAGCACGGGTAGTGAGATCTATTAGCAATCGATAGTATCTCGCGCGAAGGTTGCGATTTCTCTTTAGCCGAAGTCGCCTACGTTCCGGTTGAACTAGATGTGAAGCCAGGGTGGACCAGGTTCATACAGGGGAGGCGAGATAAATCGAAAAATTAGTCCCCAAGAGCGAGTACACCAAGTTCCTGAGTATCCAAGAACTGACCGCTCGATTCACCGAACACGAATGCTAACTTTTTATGGCGTCATTTCCGGGGGTGATTTCTACACATGGTAAACCTTCACACCATAGATGAGTCGAGTACGTCAACGTTTGGTGCGCGCGTGACGCACAGACGGTTCGGAATAAACTCAATGCCAGTCCCTATGGAAGGGTAACAACTCGTGAGGGCAGGAGATATCTGGTTCTCATAAAATATTACGGCCTCGATACGTAATCAGGCGAGTGATCTCGGGTGTGGTCACCGCATAATAGCAGTTCTGCATTATCCGCGAATTTTTCGGTTGATAGTGCTGGGTACGAAATGACCTGGCAGAATCGTAACTCACCGCTGTGGAAGGACTGGAACCCTGCACTATGGGATAGCCGCGGAGCCCTAGCTCGTTTGTCCAACCAGGTCATACAGCAGTCATCTGCCCTTCCGTATTCATAAGGCCTCTAGCGCATGGCGCTAGCGCAGCTTACCGGACTTTAGGCATAAACAATCGAAAGAACTTAGTTTCGTTACGACGATCCGCGATCGTACGGGATTTTGTCATAGATGGTAGGAAGTCCCGCACTCATGGCAGTTAATGATCGACCGATCGTCGTGGACGGACGGCACGGCTGGTCTGCCTTGATCGGATCAACTCTATGCCCGTTCCAATGCGGTTTCGAGCCAACCGAACAGTGAGGGAACTTGGCCGTGCAACCGTCAGTGATGGATCCAGCAAGCATAATCACCCTTGTGAGCTGGAAGCCAGTTCGGGCCTCGCTGGAAGGTCATACTCCGGCCCAGGTACAATTTGGCTCGATTCACTACGGTACTCGTTCGTGAGCTCTAGACCTAAGAACTCAGCTGATCTCCACGTCCTCCATACCGCGAAGCGCGTGATAGGCCTGAGAAGCAGTAGCGCCACTCTTAAGTGTGCGTAAATTGCTATTGGCACCCGTCAGCGAATAAGGTAATATGTCGGACCCTGAAACGGAGCTTTAACGACTTCTGGTCGATGTTGGTTGTGAAACTCTATTTTTTCTTGGTTCAGCTGAAACCAAACCTAGCCGGGTACCGTCAGGCGGCACTTGACTACTTGTACGCGATACCTTGGGGTCAGGTTACAGCAGTGTAAGGACCCCGCGAAGTGCAGGTGGAGGAGCCCAAGTTACCGCTCGCGACCATAAGATGGGCGTAGCGAACCCATCTATGATAGCTCCCGCGATTTCAATTTGTGCTCTTTATGAGCCTTACCCAGTCCACCGCAGGGGCTTACCGAGTTCTCGCAGATAGGCAAAATAATTGGGGGGCAATTAATTTTACGATAAATACATGCCTTCGCGGAGTCTGTGGGATCGCAGCAATGCTCACTACACCAGTCTTGCCTGCCTGGGCGAGAATGCGTGGGTGACGATATATTGAGCACCACACTATCGAGCATCGCCGCGATTTTGCCGTGTGGCGGACTGCTCCGAGATCGGGACCGGAAAAGTGGTTGTCCTCTAGATGTCGCACCTACGAGCGCCGCATTGGCACCGGCATACTGTTAATAGTGCATTATGGAAGAATAAGCAGCTATACTCCAGACTTGTGCACTTCCTATAGGGAGTATTTATGGCCGGACCGTAACCCATAGGGACCGGCATACTATTGATATCTCAACTAAACTTGCCACCTAAACCCCCACAAGGCTACATTAAAAACATGGGGCCACAGATGTATTGCATTATGTTTGCAGCAGTAACAGTGGGCGTTCTGGCGCAGTCCAGGTAACTAATGATAGTCATTAGCGGATAGTCACACAGCATATACCTCGACTGCTAAAGGTTACCCTACCGTTGTTTTAAATATCGGACCGGAACCTGCTGTGGTAAAACGCCCAATTACAGCTTAAGTCAATAGGGCATTAATAGTATGCCCGTACCAATGGCGCAACGGTGGGCGTGTGCGGTTAGCAAGGTATCGTTGCAGCTTCTTCAGATCTGATTGGAGTGTCGTCCCCAAAAAATTCATCCGTTTGGGCGATGACAACGGTCCAACAAAGCTTCTCGCGTCCGTAAGAGATTGGATTCAACTCGAGGAACTTTTGACCTAAGATGACCGCACCCAGTACCAATAAAGTGGATCAGTCCTAGTTACTACGGATAAGTGGGGACCACCCAATCAGTACGGACACTTCGACAAGTATAAGAGCACATGCCATGTTACCGATGTGATCCTATAGCGGGCTTAACCCTGTGGCGCCTACTATAAGCGGCATTCTCCGAGGTGCCATGATTTGGATTACCGGCGGTGCGCGGATCTTGGCCAACGGCAGCACGCAAAATACACCTTCCCGTGAAATGCAGGGATACTCATATACGGAGAACACGCATCCCGCACGATATATCTCGGTAGAAAGCAATGGGGCTGGGCAGTAAGCCCGATATTTATCGCACCTCCCCAAGGCAAGTCTAGTCATTCAAATCATACCGCCGTTTACTCTCCACACGCTGTACGGTTTATACCATGATGGTCGGTATGATACAGGGTCGCCTTCTGCTATTACGAACAGCGCGTAGTAATTTTGGAAGATAAATGCGCACAAATGAGATTTCTTGAGCTGGAACCTGGTCCCAAGGTCAGTGCCCCACTGGTGATCATGTATTAGTGAGGAGCCTATTTTCGCACGAGTCACAAGTGGTGACCTAGTGGTCCCTCGCGTTGTTACGCTGGTATCTCAGAGGAAATCCCTCACATTGCTACCGGGGGTGTGCTGCTCTGGCCCCGTGAGTGGCATCAATTCCATGCCCGTACCAATGTTTCGCACCGATCTCATGGGGACTGGCATAGAATTAATTTTCGGCTTTGGGCATTAGAAGCCGATGCAGACATTAACTAAAAAGACGATCCAGCAAGAGTTGGGTTGATACAGATACTAATTCCATAAGAGAAGACGTATCCCCCTTTCGCCAGCGTCTGCAAACTAATAGTCATCACTTGGACCAGTGAGTAGCCCAGGTAGTATTTTACGAGAGTTCGGGGAAAGGTCCTTCTGACACGTCCAGACTCAGTTTTCGCATAAGGTTCAAATCTATGGGTTTCCCTGACTGCTAGGGCCAGGGGTGACTCACGCGTCTTTCCTGATCCTCAGCCCTTTACCCTTCCAGACTACTGAATGACATCGGTACTGGCATTGAGTTAATAGGCGGGTCATACGTATGAGCTCCTTCCCTGGATAGCTATGATCTCTGACGGTCCGACAGGTAGAAGTGATGGGGGGCCCTGCCGCTTCGATGAAGCCAGTAGCTCGGCGGAAGACAATCACCCGTAAGTTGTCTTCCCTGATCGCGGTTCTGTCACCCCGGCCACTGCGGCTAGACGCAATGAGAAACCGCTCTGTCCCAGTTCGATAGCAATAAACAAATACGAACAGCGCACCGGGATTATGGCCCGCGCGCCTTCGGCACCTATAACATCGAGTGAATGCATGGACTACAGGCCTGGGCACCCTATTTGAGACCATCGACGTTTAAGTGAGAGGTGCCAAATTCATCCGGAGCGTGGCTTCCCGGAACTAACCCACAGTCGGCTAATTGAAATGAGATCGTCGACCTGTCTATGACTTAGACATGGCCCTCCAAGGGCCCCGATCTCCATCGCACACCACCTCGAAATTTGTTGGAATTAATTCTATGCCAGTTCCCATGTTTACCGCTTGTGTCCAGCTGATGCCGACTCCCCGTGGTCCAGTGTAATCTATGTGCCCACGAGACCTATAAGTGTCCTTGTACACTAATCCGAGTGCGATTATCGACACACAGCAGGCGGGAGGGGCTGGAAAGCATCTCCTTTCGGTCATTTAGTGAGTATCGTCGTTCATACTGGCTTCCGGTCCATGGTCCTCGCTATGCGAGGGCCTTCAACTATTCAGGTAACCCTATCGCCGCAGAGAAAGTGCAATGCGAACCAAACGATTGAACTATCTAACCTAGGCGGTGAGAACCGCCAGGGTTCATGGCGGATCAGCTAGTTCACCAACTCGCTTGACTCATTAGTCGGCTGCGGACTGTCTAGTACACCCGAAACCGCCATTGGTACAGGCATGGAGTTAATTGTGAGGAAGTCCGAATTAGAAGCGTATGTTGCGCCTGCATATGTCACCACTCCAAACTGTTTTGTTCAGTAACGGTTATGTTACTTGCCAGTACGCTGCGCGGTGACTTTAAACGGATCCTGCGTCAAGGGTTAGGAGTACTTCTGTACGATAACCCATAAACAGATTAGTGGAAGCATCCTGTTTAAGATTCCGCGGTGTTCGAACCGCCCGATGCGTCGAGGGTTCAGGTACACGCCAATAGCCCCATGGGCCATATGCTCGAAACTATTTCGTGTGTTGGTGTGCCAGTGATAACGTTATACAGCCAGTGTCTAAAGACCACGTTTCATTCCCCCGGCGGCCTCTGCGTTGCGAGCCCATAGGATCCTAGTTGCGCGACTCGTAGCCCAAGCGCGTGCTACTCGCTATGACTCCGTGATTCAATTTAATGCCATAGGAGACTGCAGGCACATCCTCGCTGAATCTGATCTCCGACCTGAAGGACGATTCTATGCTCACCTTGTCGTCTATAAGTTGGTGCATTAGTCTAACCGTCGCTAAATCGCTGCGGGACGCTTCCTCTCGCATAGGCACGCGCTCACTCTGTAACCATGGTATTTGATGCTCTAGCGTACATCAATAGCATGCCGGTGCCCATGGAAATGCATACGTCGAGCCGCATCGGGGTACGGAGCCTACACGTTGCTGCGCCCCGCGTCGTATTTACCACTGGCCCGAGTCGAAGGATTGTTTTAGCTGCGACAAGGATGGTCAGGTGGACATTGGCACGGGCATGGAGTTAATTTCCCTCTCACTTTTCACACGAAGTGGACAGCCAACGGGTTCATTGGGACCGGCATGCTGTTAATCGTTGCTTCATGGTTCTGATCATGACCCTTTCGGCTCTAGCCTACAGTCAAAGGCATGTGGTGCGTCACTCAGATTCACATTAGGATTGTTTTTTAAGCAGGATTCTAGTCTCGATTTTTGAGCAGCATTTAGTGTTCTGTGGCTTGCGGGCCAAGAATAGTTAAACTAGTAACAATGGGCAGGTGGAGGGAAGCGTATCTATCGTAGGGAATGTCGTATCCGAGTTGTACCTATCTGAGCCTCTCTCCCAATCCTAACGGCTGGTAACAAACCGCCAACAAGCGGTCTCAGTTTCTATGACTTCTTCAGCCCTGCAGTGTCTAAATTCTTCGGCTTGGTCATGCCAGCCTCTCCTGTGCGCGGTCAAAGCTCCTTACCCGAATATCGCAGACCGGTGTCCTACAGAGTTCAGGATAGTGTGTTACTGATTATCAGATAGGCGGCACCACTGACCGCAGGCTACGACGCGATAAGAAGAAGATGGCGGGGCCCTGCATATCGGCCCTGGCATGATTATCTGATACCCGTAGGTTCCTTCTAGCGTAGGTAAATTACTTCATACACGACCCTGTTTTTAGCACCACCCGCTTGATTGCGGGCGATCAATTCAATGCCGGTCCCTATGAGTTAATGTTTTATGTTCCCCATGTAGGGCAGGGATGTGCAATCACTGGCATAAGAGCAATGTCTTTCCCATAATCTCATATCCCTAACTACAGACTGCAAACATTAAGGGACAATTACCCTTATAAGACAGGTGATCTGATCGATCCGGCTTCAGATATGGTATGATGGTCTGCGTATTATTGCTGCCAACCCGCCAAATACAGTTCTCCCTCACGGGGACGGCGGGTTTGGGATAATGATTGAGTCACAGAAGTATTCGCTTTGCCTGCTTAAAACACCCGAGTTCGACACTGCTACTTTGACAACTCTGGGAATTGAAGCGTACGGCACGTACAGCCCCAATTTAGCGTCGTACATACGGTCCTTACATAGATATTCTGGGTACTCCAAACGGTCCGATGCCGCAAAAACATTAGCGGGCGCTCCGGTAATGTTCCGAAACATAGGCCTGGTAGACGTGCTCAAGCGTCACGCATTGGTACGGGCATCGAATTTATATTCTAAGCGCCCTAGGGCACATTAAAGCCCAATTGATAGATGCACGCGTAAGACATCCCAGCCCAGTTGCGCCAACGGACGCTGACTGAATATTGTAAAGTGCCTACAAACTATACTGCTTGCCAACTGTCTTCTAAGATTTAGGGAAGAAAGAGGATAGGGGAGTCTATAACCGGAGGATACATATAAACTCTATGCCGGTACCAATGTCAGAATATTTGCCCCGTGTGTTTGGATATTAGGTTTTCGTCCATGGTGAGCTGCGGTGTATTAGGGGGGCATCCGCACCGGCATGAAGTGTCCTCATACAAGACAAGCTGATCCAGACTACCCCATGCGTGTCTATTACGCTGGAGCAGCACAGCCCCTAATCCGTGGGGTATGTGACGTCTCCTGTAAAGTTCCCGCTAAGTGGACTCGTTAGTGCATCAGACGCGAGTGCCCGTACCACCGAAGCCTGACTCCCTTGGCTCTTTCACCTTTCCCAATTGGAGTTTGTTGTCCGATAAATACAAAATCAGGCCTATTTGTCGAATTAGAAAGGGGCAGAAAATCCATGAGGGTTTGCGGTACCCCGCTACGACCAATAAAGGTAGGTAGGGCCTCGGCGATCGTAGATTAAACTTGGTGGGTGTGTCGACAGTCCGCTCTGATCTGGCCGTAACAGATAAGCTGTGGGATGCACGCAGGACAGGGGCTGCGAGGTCACACCGATGCGATCACCGTCTTGGGCGTGTGGAGGAGCATAAAGGATTGGGAACAGAGGGTCTTGGGCAGAAATCTGTCATCGCCAGCCCAGAAGGTCGAATGTTCTCCGCGACAGGTGCCGTGAATGAGATGGGACTGGAATTCAGATTATGCGCCTGGTAAGAACTCACTAAAATTCGAAAATGTTTCCAGTATTACCTCGGACCAATGTGCTGACTAACGGCAGTGGTGCGAACTCTGAACGTCAGTAGTGCTCCAGGATCTCCACAACGACATCACGATCCATCACAGGGGCTCATGTCGGTTGTGATACAGTGACCAAACATACCTCCAGGGCGTGCCACCGGTGGACGCTCGCTGACGTAGGGTGGGTAGGTTAATCGCTCACGTATCCTCAGATTAATACGCCATCAGGCCGCTCTCTTTGTCATAAATTCGATGCCGGTGCCGATGCGATGCTCGTAGCTACTGGAGTCGGACGTACATATTGTATGCTATTGGTGGAGGTACCACTAGCAGTGCGGAATAGCACTAAGGACGAAGATATAAGCGATAATGCATACCTCCACGGTGACGCTCAATCCTGGTTCTATAAAACGTTGTGGATCCAAATATGGCAAGAAGGCTAATAAGTAAGGGCGACTCGCCATCTTATCAACTCCATGCCCGTCCCTATGCCCTGGTAGGCTGTATCATAGCCCCCCCGAAAACAACAGAGAATTTTCGGATGCAAAAACTAGTTTGCCTGACCGAATCCGTCCGAAGGCGGTCTGGGACGCCGCGACCTGTTTACAATGTGTCCAAGAGCCTAGGGATTGCGCACCGAGTGCGTGTTTCACGATCTCGAGGTCGAGCGTTTGTGGATCAACAGTATGCCTGTGCCGATGAGAGGAAATTGTCTATTGGCGAACCACATTCCCAACAATCTGTGCGTGGATGCTCATGGGTATGGTGACCGGGGTTGTCGCTGTATAAGCGCCTGTGACGGTTCCTGCTAGCTAGTAGTGGCTACAACCTCGCATGCTGTCTTGGAGGCCTGGGGGATCACCTCGCAAG'
#aminoAcid = 'INSMPVPM'
#encoders = SubstringEncodingAmninoAcid(rna, aminoAcid)
#for encoder in encoders:
# print encoder
#rna = 'AUGUAUGGCAAUGCUAUAUGCUUACUGUGCAACCCCUUACACGCCUUAGUACUCAGGGUGCUAUGCGCCCAGUCGGGCGAGCGCUAUUACUAUGGUAUCUUUAAGAAUCACUAUCCAAUGCAUUUUACCUUCUUAAAGACCGGGACCUGUCCGACGUACAAUCAAGUCUCAAGCACCCGUAUUUCAAAAGAAACAAUAGCACUUGUCUGGCCCACUACGCGGAAGCAACAUCGAACCGAUCUUAGAUCUUUUCUCACUAAAGUCGUAUACAGGGCGUAUCAUCAUCGGGCCUCUGCUGUCACUUGCAGUCUACUUAAGAUGUUGGAGCCAGUGGUCCAGGCCGCCGAGGUCUUCCUACCUUGGAAAGGUCCUAUUUUCGCACCGGUGGAGAGUGGAACUUUGUCUAACUUCUUCUUAACGCAGCUUUGGAUUUGUGGCCGCUUACAACGUAAAUUGGUCAUAGAGAUGUACGCUGAAAGAGGAUUAAUCCGGAAGGCCCCAACCAGCCUCUCUCGCAGAUUAAAAUGUGAUAGUGACUCAUUCUACCCAGGUUUUAUGAAAUUCGACACUAAGGUUGCCGAUCGGAAUCGGCCUAAGAAGGAAGAGACGAUCUCCACCACCCUCGACGGCGUGUCGUCUUUGCCAGUCUCCUCCC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UGCUGGAAGCCAACUUCAAUCAGGGGAGUGGAGUCGCCCGAGGGUUCCCUAGGACGAAGCAUCUGGUCAAGAAGACACGUUCUUCAGUCUCCCAAUACGAUCGCCGAUCUACAUUUCGAAUGCGAUAAGGUGCGUGGCAUAAGAGUCUUAACCGAGAUCGUGGAAAAGACCGCACAACAUAGGCCAGACGCGGCCUGGGAGAGCCACACAUUCCACCCAUGUGCACUUCACAUCAUCCGGAUUAGACUGCUCUAUCGGGUAAAACUCCCGCUAGAUGUCUCCUCGAACUUGGCGGGAGAUGAUAUUAGCACGACCUCCGAUGGAUUUAAACUCACAUGGCGGGUAAUGACACCAGGGAGGGUGCCGAUUCCGUACCUGUAUGGAUAUCAGAGUGCCUGUUCCCAGGCUAGCGCCUCGAAUUGA'
#print ProteinTranslation(rna)
#integer_mass_dict = IntergerMassDictionary()
#peptide = 'MPILEINAWWLLWS'
#l = CircularSpectrum(peptide, integer_mass_dict)
#l = ' '.join(map(str, l))
#print l
'''
N = 1000
file = '../Downloads/Tyrocidine_B1_Spectrum_25.txt'
spectrum = []
with open(file) as f:
for line in f:
line = line.strip('\n')
l = line.split(' ')
for element in l:
spectrum.append(int(element))
print LeaderboardCyclopeptideSequencing(spectrum, N)
'''
'''
#peptide = 'YNYYNHSTDMQRYKFNDTDVYGWHMCTDVYFACCYWCQL'
spectrum = []
file = '../Downloads/dataset_104_7.txt'
with open(file) as f:
for line in f:
line = line.strip('\n')
l = line.split(' ')
for element in l:
spectrum.append(int(element))
#print LinearScore(peptide, experimental_spectrum)
'''
'''
leaderboard = []
experimental_spectrum = []
file = '../Downloads/dataset_4913_3.txt'
with open(file) as f:
for line in f:
line = line.strip('\n')
l = line.split(' ')
for element in l:
try:
element = int(element)
experimental_spectrum.append(element)
except ValueError:
leaderboard.append(element)
N = 5
l = Trim(leaderboard, experimental_spectrum, N)
item = ' '.join(l)
print item
'''
'''
M = 16
N = 343
#spectrum = [57, 57, 71, 99, 129, 137, 170, 186, 194, 208, 228, 265, 285, 299, 307, 323, 356, 364, 394, 422, 493]
spectrum.sort()
print spectrum
print ConvolutionCyclopeptideSequencing(spectrum, N, M) #too slow for downloaded dataset; works with sample input
#need to optimize LeaderboardCyclopeptideSequencing
'''