Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
util.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/relax/util.cc
11 /// @brief initialization protocols for relax and utility functions
12 /// @detailed
13 /// @author Mike Tyka, Monica Berrondo
14 /// @author Roland A. Pache
15 
16 //Project Headers
17 #include <protocols/relax/util.hh>
18 
19 //Core Headers
20 #include <core/pose/Pose.hh>
22 #include <core/scoring/MembraneTopology.hh> //pba
29 
30 //Protocol Headers
36 
37 //Basic Headers
38 #include <basic/datacache/BasicDataCache.hh> //pba
39 #include <basic/options/option.hh>
40 #include <basic/options/keys/relax.OptionKeys.gen.hh>
41 #include <basic/options/keys/edensity.OptionKeys.gen.hh>
42 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
43 #include <basic/options/keys/in.OptionKeys.gen.hh>
44 #include <basic/Tracer.hh>
45 
46 //Utility Headers
47 #include <utility/vector0.hh>
48 #include <utility/vector1.hh>
49 
50 // ObjexxFCL Headers
51 #include <ObjexxFCL/string.functions.hh>
52 
53 #ifdef BOINC_GRAPHICS
54 #include <protocols/boinc/boinc.hh>
55 #endif
56 
57 using basic::T;
58 using basic::Error;
59 using basic::Warning;
60 
61 static basic::Tracer TR("protocols.relax");
62 
63 using namespace core;
64 ////////////////////////////////////////////////////////////////////////////////////////////////////
65 
66 namespace protocols {
67 namespace relax {
68 ////////////////////////////////////////////////////////////////////////////////////////////////////
69 
71 generate_relax_from_cmd( bool NULL_if_no_flag ) {
72  using namespace protocols::moves;
73  using namespace scoring;
74  using namespace basic::options;
75  using namespace basic::options::OptionKeys;
76 
79  if ( option[ in::file::fullatom ]() || option[ OptionKeys::constraints::cst_fa_file ].user())
81  else
83 
84  // now add density scores
85  if ( option[ edensity::mapfile ].user() ) {
87  }
88 
89  RelaxProtocolBaseOP protocol;
90  if ( option[ OptionKeys::relax::sequence_file ].user() ) {
91  protocol = new FastRelax( scorefxn, option[ OptionKeys::relax::sequence_file ]() );
92  } else if ( option[ OptionKeys::relax::script ].user() ) {
93  protocol = new FastRelax( scorefxn, option[ OptionKeys::relax::script ]() );
94  } else if ( option[ OptionKeys::relax::quick ]() ){
95  protocol = new FastRelax( scorefxn, option[ OptionKeys::relax::default_repeats ]() /*default 5*/);
96  } else if ( option[ OptionKeys::relax::thorough ]() ){
97  protocol = new FastRelax( scorefxn, 15 );
98  } else if ( option[ OptionKeys::relax::fast ]() ) {
99  protocol = new FastRelax( scorefxn, option[ OptionKeys::relax::default_repeats ]() /*default 5*/);
100  } else if ( option[ OptionKeys::relax::classic ]() ) {
101  protocol = new ClassicRelax ( scorefxn );
102  } else if ( option[ OptionKeys::relax::mini ]() ) {
103  protocol = new MiniRelax( scorefxn );
104  } else if ( option[ OptionKeys::relax::centroid_mode ]()) {
105  protocol = new CentroidRelax();
106  } else {
107  // default relax should be a quick sequence relax
108  if ( NULL_if_no_flag ){
109  TR.Debug << "no relax protocol specified at command line" << std::endl;
110  return NULL;
111  }
112  protocol = new FastRelax( scorefxn );
113  }
114 
115  return protocol;
116 }
117 
119  //using core::pose::datacache::CacheableDataType::MEMBRANE_TOPOLOGY;
123  topology.initialize(spanfile);
124 }
125 
127  using namespace core::conformation;
128  //if DNA present set so it doesn't move
129  for ( core::Size i=1; i<=pose.total_residue() ; ++i ) {
130  if( pose.residue(i).is_DNA()){
131  TR << "turning off DNA bb and chi move" << std::endl;
132  mm.set_bb( i, false );
133  mm.set_chi( i, false );
134  }
135  }
136 }
137 
139  using namespace basic::options;
141  protocol->set_current_tag( tag );
142  protocol->set_scorefxn( scorefxn );
143  protocol->apply( pose );
144 }
145 
146 }
147 }