File: gen.py

package info (click to toggle)
isospec 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,476 kB
  • sloc: cpp: 9,530; python: 2,095; makefile: 180; ansic: 100; sh: 88
file content (15 lines) | stat: -rw-r--r-- 527 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from masserstein import peptides
from string import printable
from collections import Counter

for i in range(255):
    if chr(i) in printable and not chr(i) in "\t\n" and not i in [11, 12, 13]:
        s = ["/* Code:", str(i).rjust(3), " ASCII char:", chr(i), "*/      "]
    else:
        s = ["/* Code:", str(i).rjust(3), " unprintable   */      "]

    chnosse = list("CHNOS") + ["Se"]
    s.append(", ".join(str(peptides.daminoacids.get(chr(i).upper(), Counter())[el]) for el in chnosse)+',')
    print(' '.join(s))