-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocking_single.py
71 lines (58 loc) · 1.9 KB
/
docking_single.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
# Project Ideas:
# (1) Apply PyRosetta Docking to confirm native = lowest energy MHC binding structure
# (2) recapture binding orientation of native conformation (sampling)
# (3) See if protein has any regions that would be loaded onto MHC, if so remove and re-dock (in native conformation)
# import pyrosetta
from pyrosetta import *
init()
# import and clean pdb (superantigen + TCR + MHC)
from pyrosetta.toolbox import cleanATOM
cleanATOM("2ICW_MHC.pdb")
pose = pose_from_pdb("2ICW_MHC.clean.pdb")
# make full-atom starting pose
fa_starting = Pose()
fa_starting.assign(pose)
# make a full-atom working pose
fa_working = Pose()
fa_working.assign(pose)
# make a centroid pose
switch = SwitchResidueTypeSetMover("centroid")
switch.apply(pose)
centroid = Pose()
centroid.assign(pose)
# print pdb pose_tree
print(fa_working.fold_tree())
# change fold tree to keep DEF fixed and move H
from pyrosetta.teaching import *
setup_foldtree(fa_working, "DEF_H", Vector1([1])) # "DEF_H"
print(fa_working.fold_tree())
# see jump information
jump_num = 1
print(fa_working.jump(jump_num).get_rotation())
print(fa_working.jump(jump_num).get_translation())
# rotate and translate superantigen (8 degrees rot, 3 ang trans)
import rosetta.protocols.rigid as rigid_moves
pert_mover = rigid_moves.RigidBodyPerturbMover(jump_num, 8, 3)
pert_mover.apply(fa_working)
# minimize the energy
scorefxn = get_fa_scorefxn()
from rosetta.protocols.minimization_packing import *
min_mover = MinMover()
movemap = MoveMap()
movemap.set_bb(True)
min_mover.movemap(movemap)
min_mover.score_function(scorefxn)
min_mover.apply(fa_working)
# see in PyMOL
from pyrosetta import PyMOLMover
pymol = PyMOLMover()
pymol.keep_history(True)
pymol.apply(fa_starting)
pymol.apply(fa_working)
# score pose
print('starting pose energy: ')
print(scorefxn(fa_starting))
print('working pose energy: ')
print(scorefxn(fa_working))
# testing
print(fa_working.pdb_info().pose2pdb(500))