Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RandomConformerMover.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file protocols/ligand_docking/RandomConformerMover.cc
11 ///
12 /// @brief
13 /// @author Ian W. Davis
14 
15 
17 
18 #include <core/graph/Graph.hh>
23 #include <core/pose/Pose.hh>
26 #include <numeric/random/random.hh>
27 
28 // option key includes
29 
30 #include <utility/vector1.hh>
31 
32 static numeric::random::RandomGenerator my_RG(810106); // <- Magic number, do not change it!!! That's Ian Davis's thing- not sure why
33 
34 namespace protocols {
35 namespace ligand_docking {
36 
37 
39  Mover(),
40  resid_(resid)
41 {
42  Mover::type( "RandomConformerMover" );
43 }
44 
45 
47 {
48 }
49 
50 
52 {
54  using namespace core::pack::task;
56  // Dummy parameters that the ligand rotamer library doesn't use:
57  core::scoring::ScoreFunction dummy_scorefxn;
58  PackerTaskOP dummy_pack_task = TaskFactory::create_packer_task(pose);
59  dummy_pack_task->initialize_from_command_line(); // -ex1 -ex2 etc.
61  core::graph::GraphCOP dummy_graph = new core::graph::Graph();
62  // Retrieve conformers
64  if( reslib.get() == NULL ) return;
65  reslib->fill_rotamer_vector(
66  pose,
67  dummy_scorefxn,
68  *dummy_pack_task,
69  dummy_graph,
70  &pose.residue_type(resid_), //ResidueTypeCOP
71  pose.residue(resid_),
72  dummy_extra_chi_steps,
73  true /* sure, let's pretend it's buried */,
74  conformers // output appended here
75  );
76  // If -include_current push back current conformer
77  // This is rarely necessary...
78  //if( option[ OptionKeys::packing::use_input_sc ] ) {
79  // ResidueOP curr_copy = new Residue( pose.residue(resid_) );
80  // conformers.push_back(curr_copy);
81  //}
82  // Choose one at random
83  ResidueOP selected_res = conformers[ my_RG.random_range(1, conformers.size()) ];
84  // Residue library has already superimpose residues appropriately, so don't orient again
85  pose.replace_residue(resid_, *selected_res, false /*orient backbone*/);
86 }
87 
90  return "RandomConformerMover";
91 }
92 
93 
94 } // namespace ligand_docking
95 } // namespace protocols