-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathprocess_oe_surface_area.py
More file actions
46 lines (28 loc) · 1.21 KB
/
process_oe_surface_area.py
File metadata and controls
46 lines (28 loc) · 1.21 KB
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
#!/usr/bin/python
'''
'''
import sys
from collections import OrderedDict
if __name__ == '__main__':
atom_sasa_filename = sys.argv[1]
per_atom_tsv_filename = atom_sasa_filename + '.tsv'
data = OrderedDict()
# PARSE ATOM SASA PDB FILE
with open(atom_sasa_filename, 'rb') as fo:
for line in fo:
line = line.strip()
if line.startswith('HETATM') or line.startswith('ATOM'):
chain = line[21:22]
resnum = line[22:26].strip()
inscode = line[26:27].strip()
atom_name = line[11:15].strip()
pymol_string = '/{}/{}{}/{}'.format(chain,
resnum,
inscode,
atom_name)
solv_acc = float(line[60:66])
data[pymol_string] = solv_acc
# PER-ATOM OUTPUT
with open(per_atom_tsv_filename, 'wb') as fo:
for k, v in data.iteritems():
fo.write('{}\t{}\n'.format(k, v))