yinuozhang commited on
Commit
84bbd6a
1 Parent(s): 6a8393c

update more aa recog

Browse files
Files changed (1) hide show
  1. app.py +53 -0
app.py CHANGED
@@ -236,6 +236,59 @@ class PeptideAnalyzer:
236
  if not any(p in content for p in ['C(C)C', 'COC', 'CN(', 'C(C)O']):
237
  return 'Ala', mods
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  return None, mods
240
 
241
  def get_modifications(self, segment):
 
236
  if not any(p in content for p in ['C(C)C', 'COC', 'CN(', 'C(C)O']):
237
  return 'Ala', mods
238
 
239
+ # Tyrosine (Tyr) - 4-hydroxybenzyl side chain
240
+ if ('Cc2ccc(O)cc2' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
241
+ return 'Tyr', mods
242
+
243
+ # Tryptophan (Trp) - Indole side chain
244
+ if ('Cc2c[nH]c3ccccc23' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
245
+ return 'Trp', mods
246
+
247
+ # Serine (Ser) - Hydroxymethyl side chain
248
+ if '[C@H](CO)' in content or '[C@@H](CO)' in content:
249
+ if not ('C(C)O' in content or 'COC' in content):
250
+ return 'Ser', mods
251
+
252
+ # Threonine (Thr) - 1-hydroxyethyl side chain
253
+ if '[C@@H]([C@@H](C)O)' in content or '[C@H]([C@H](C)O)' in content:
254
+ return 'Thr', mods
255
+
256
+ # Cysteine (Cys) - Thiol side chain
257
+ if '[C@H](CS)' in content or '[C@@H](CS)' in content:
258
+ return 'Cys', mods
259
+
260
+ # Methionine (Met) - Methylthioethyl side chain
261
+ if ('C[C@H](CCSC)' in content or 'C[C@@H](CCSC)' in content):
262
+ return 'Met', mods
263
+
264
+ # Asparagine (Asn) - Carbamoylmethyl side chain
265
+ if ('CC(=O)N' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
266
+ return 'Asn', mods
267
+
268
+ # Glutamine (Gln) - Carbamoylethyl side chain
269
+ if ('CCC(=O)N' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
270
+ return 'Gln', mods
271
+
272
+ # Aspartic acid (Asp) - Carboxymethyl side chain
273
+ if ('CC(=O)O' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
274
+ return 'Asp', mods
275
+
276
+ # Glutamic acid (Glu) - Carboxyethyl side chain
277
+ if ('CCC(=O)O' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
278
+ return 'Glu', mods
279
+
280
+ # Lysine (Lys) - 4-aminobutyl side chain
281
+ if ('C[C@H](CCCCN)' in content or 'C[C@@H](CCCCN)' in content):
282
+ return 'Lys', mods
283
+
284
+ # Arginine (Arg) - 3-guanidinopropyl side chain
285
+ if ('CCCNC(=N)N' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
286
+ return 'Arg', mods
287
+
288
+ # Histidine (His) - Imidazole side chain
289
+ if ('Cc2cnc[nH]2' in content) and ('C[C@H]' in content or 'C[C@@H]' in content):
290
+ return 'His', mods
291
+
292
  return None, mods
293
 
294
  def get_modifications(self, segment):