Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
docking.py
Go to the documentation of this file.
1 # (c) Copyright Rosetta Commons Member Institutions.
2 # (c) This file is part of the Rosetta software suite and is made available under license.
3 # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
4 # (c) For more information, see http://www.rosettacommons.org. Questions about this can be
5 # (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
6 from rosetta import *
7 init()
8 
9 p = Pose()
10 pose_from_pdb(p, "test_dock.pdb")
11 
12 starting_p = Pose()
13 starting_p.assign(p) #saving the starting structure
14 
15 print "setting up docking fold tree"
16 dock_prot = DockingProtocol() #DockingProtocol object contains many useful docking functions
17 dock_prot.setup_foldtree(p)
18 dock_jump = 1
19 
20 print "set up scoring functions"
21 scorefxn_low = create_score_function('interchain_cen')
22 scorefxn_high = create_score_function('docking')
23 scorefxn_high_min = create_score_function_ws_patch('docking','docking_min')
24 
25 print "setting up movers"
26 
27 #centroid/fullatom conversion movers
28 to_centroid = protocols.simple_moves.SwitchResidueTypeSetMover('centroid')
29 to_fullatom = protocols.simple_moves.SwitchResidueTypeSetMover('fa_standard')
30 recover_sidechains = protocols.simple_moves.ReturnSidechainMover(starting_p)
31 
32 #initial perturbation movers
33 randomize1 = RigidBodyRandomizeMover(p, dock_jump, rigid.partner_upstream)
34 randomize2 = RigidBodyRandomizeMover(p, dock_jump, rigid.partner_downstream)
35 dock_pert = RigidBodyPerturbMover(dock_jump, 3, 8) #3A translation, 8 degrees rotation
36 spin = RigidBodySpinMover( dock_jump )
37 slide_into_contact = DockingSlideIntoContact( dock_jump )
38 
39 #docking lowres movers
40 docking_lowres = DockingLowRes( scorefxn_low, dock_jump )
41 
42 #docking highres movers
43 docking_highres = DockingHighRes( scorefxn_high_min, dock_jump )
44 
45 print "set up job distributor"
46 jd = PyJobDistributor("dock_output", 20, scorefxn_high)
47 jd.native_pose = starting_p
48 
49 print "beginning docking..."
50 
51 print "convert to centroid mode"
52 to_centroid.apply(p)
53 starting_p_centroid = Pose()
54 starting_p_centroid.assign(p)
55 
56 while (jd.job_complete == False):
57  p.assign(starting_p_centroid)
58 
59  print "initial perturbation"
60  dock_pert.apply(p)
61  slide_into_contact.apply(p)
62 
63  print "low resolution stage docking"
64  docking_lowres.apply(p)
65 
66  print "convert to fullatom mode"
67  to_fullatom.apply(p)
68 # recover_sidechains.apply(p)
69  #dock_prot.recover_sidechains(p) # <-- requare native pose, C++ function changed signature, commenting out for now
70 
71  print "high resolution stage docking"
72  docking_highres.apply(p)
73 
74  print "outputting decoy..."
75  jd.output_decoy(p)
76 
77 print "docking complete!"
void init()
set global 'init_was_called' to true
Definition: init.cc:26