Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DnaInterfaceMinMover.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 DnaInterfaceMinMover.cc
11 /// @brief
12 /// @author ashworth
13 
14 // Unit headers
17 
18 // Package headers
22 
23 // Project headers
27 #include <basic/options/option.hh>
30 #include <basic/Tracer.hh>
31 #include <utility/tag/Tag.hh>
32 
33 //// option key includes
34 #include <basic/options/keys/run.OptionKeys.gen.hh>
35 #include <basic/options/keys/score.OptionKeys.gen.hh>
36 
37 #include <utility/vector0.hh>
38 #include <utility/vector1.hh>
39 
40 
41 namespace protocols {
42 namespace dna {
43 
44 using utility::vector1;
45 using namespace core;
46  using namespace kinematics;
47  using namespace optimization;
48  using namespace basic::options;
49  using namespace scoring;
50 using namespace moves;
51 
52 using basic::t_warning;
53 using basic::t_info;
54 using basic::t_debug;
55 using basic::t_trace;
56 static basic::Tracer TR("protocols.dna.DnaInterfaceMinMover",t_info);
57 
60 {
62 }
63 
66  return new DnaInterfaceMinMover;
67 }
68 
71 {
72  return "DnaInterfaceMinMover";
73 }
74 
76  : protocols::simple_moves::MinMover("DnaInterfaceMinMover"),
77  interface_(0),
78  chi_(true),
79  bb_(false)
80 {
81  min_type( option[ OptionKeys::run::min_type ]() );
82  tolerance( option[ OptionKeys::run::min_tolerance ]() );
83 }
84 
86  //utility::pointer::ReferenceCount(),
87  protocols::simple_moves::MinMover( src )
88 {
89  *this = src;
90 }
91 
94 {
95  if ( src.interface_ ) interface_ = src.interface_->clone();
96  else interface_ = 0;
97  chi_ = src.chi_;
98  bb_ = src.bb_;
99  return *this;
100 }
101 
103 
105  : protocols::simple_moves::MinMover("DnaInterfaceMinMover"),
106  interface_( interface ),
107  chi_(true),
108  bb_(false)
109 {
110  runtime_assert( interface );
112  min_type( option[ OptionKeys::run::min_type ]() );
113  tolerance( option[ OptionKeys::run::min_tolerance ]() );
114 }
115 
116 void
118 {
119  runtime_assert( interface );
120  interface_ = interface;
122 }
123 
124 void
126 {
127  runtime_assert( interface_ );
128  MoveMapOP new_movemap( new MoveMap );
129  // sidechain minimization for all amino acids in the vicinity of nucleotide bases
130  // (according to 'interface', which need not represent the entire protein-DNA interface)
131  for ( DnaNeighbors::const_iterator itr( interface_->protein_neighbors().begin() ),
132  end( interface_->protein_neighbors().end() ); itr != end; ++itr ) {
133  if ( itr->second.close() ) {
134  // avoid adding pointless 'false' values to std::map if chi_ or bb_ are false
135  if ( chi_ ) new_movemap->set_chi( itr->first, true );
136  if ( bb_ ) new_movemap->set_bb( itr->first, true );
137  }
138  }
139  movemap( new_movemap );
140 }
141 
142 void
144 {
145  if ( ! interface_ ) {
147  interface_->determine_protein_interface( pose );
149  }
150  if ( ! movemap() ) reset_from_interface(); // just in case
151  if ( ! score_function() ) {
152  std::string const weights( option[ OptionKeys::score::weights ]() );
154  }
155 
156  AtomTreeMinimizer minimizer;
157 // (*score_function())(pose_);
158  minimizer.run( pose, *movemap(), *score_function(), *min_options() );
159 }
160 
164 }
165 
166 ///@brief parse XML (in the context of the parser/scripting scheme)
167 void
169  TagPtr const tag,
170  moves::DataMap & datamap,
172  moves::Movers_map const &,
173  core::pose::Pose const &
174 )
175 {
176  if ( tag->getName() != "DnaInterfaceMinMover" ) {
177  TR(t_warning) << " received incompatible Tag " << tag << std::endl;
178  assert(false);
179  return;
180  }
181  if ( tag->hasOption("scorefxn") ) {
182  std::string const key( tag->getOption<std::string>("scorefxn") );
183  if ( datamap.has( "scorefxns", key ) ) {
184  score_function( datamap.get< ScoreFunction* >( "scorefxns", key ) );
185  }
186  }
187  if ( tag->hasOption("dna_interface_finder") ) {
188  std::string const key( tag->getOption<std::string>("dna_interface_finder") );
189  if ( datamap.has( "dna_interface_finder", key ) ) {
190  use_interface( datamap.get< DnaInterfaceFinder* >( "dna_interface_finder", key ) );
191  }
192  }
193  if ( tag->hasOption("min_type") ) {
194  min_type( tag->getOption<std::string>("min_type") );
195  }
196  if ( tag->hasOption("tolerance") ) {
197  tolerance( tag->getOption<Real>("tolerance") );
198  }
199 }
200 
201 ///@brief required in the context of the parser/scripting scheme
202 MoverOP
204 {
205  return new DnaInterfaceMinMover;
206 }
207 
208 ///@brief required in the context of the parser/scripting scheme
209 MoverOP
211 {
212  return new DnaInterfaceMinMover( *this );
213 }
214 
215 } // namespace dna
216 } // namespace protocols