-
Notifications
You must be signed in to change notification settings - Fork 0
/
reference_interface_definition.py
48 lines (39 loc) · 1.46 KB
/
reference_interface_definition.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
'''
Define reference interface.
Required: reference_interfaces (list of list),
reference_pdb (path to reference pdb file)
'''
import os, sys
from patches import Patches
from utils import reslist_to_pdb_numbers
from pyrosetta import *
def get_reference_definition(reference_pdb, patches=True,
return_surface=False):
reference_interfaces = []
if not patches:
reference_interface_all = [126,127,125,19,124,80,79,128,78,18,76,129,11,16,
14, 81, 13, 116, 12, 115, 15, 9, 8, 7]
reference_interfaces = [[],[]]
for resnum in reference_interface_all:
if resnum < 90:
reference_interfaces[0].append(resnum)
else:
reference_interfaces[1].append(resnum)
reference_interfaces.append(reference_interface_all)
else:
#init()
reference_pose = pose_from_file(reference_pdb)
reference_patches = Patches(reference_pose)
reference_patches.determine_surface_residues()
reference_patches.map_residues()
if return_surface:
return reslist_to_pdb_numbers(reference_patches.reslist,
reference_pose)
for res in reference_patches.reslist:
reference_interfaces.append(reference_patches.nearest_n_residues(res, 8))
return reference_interfaces
if __name__=="__main__":
from utils import *
init()
for i in get_reference_definition(sys.argv[1]):
print(reslist_to_selstr(i))