Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
idealize_jd2.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 /// @author Mike Tyka
11 /// @author Phil bradley
12 /// @author Christopher Miles (cmiles@uw.edu)
13 /// @brief
14 #include <protocols/idealize/IdealizeMover.hh>
15 #include <protocols/idealize/IdealizeMover.fwd.hh>
16 #include <protocols/simple_moves/symmetry/SetupForSymmetryMover.hh>
17 #include <protocols/moves/MoverContainer.hh>
18 #include <protocols/jd2/JobDistributor.hh>
19 #include <basic/options/option.hh>
20 #include <devel/init.hh>
21 
22 // Utility
24 #include <basic/options/keys/symmetry.OptionKeys.gen.hh>
25 
26 // C++ headers
27 #include <iostream>
28 
29 //#include <protocols/jobdist/Jobs.hh>
30 #include <utility/vector0.hh>
31 #include <utility/vector1.hh>
32 
33 //Auto Headers
35 
36 OPT_KEY( Real, atom_pair_constraint_weight )
37 OPT_KEY( Real, coordinate_constraint_weight )
38 OPT_KEY( Boolean, fast )
39 OPT_KEY( Boolean, chainbreaks )
40 OPT_KEY( Boolean, cis_omega )
41 
43  NEW_OPT( atom_pair_constraint_weight, "atompair constraint weight", 0.0 );
44  NEW_OPT( coordinate_constraint_weight, "coordinate constraint weight", 0.0 );
45  NEW_OPT( fast, "fast protocol", false );
46  NEW_OPT( chainbreaks, "keep chainbreaks", false );
47  NEW_OPT( cis_omega, "fix non-pro cis omegas", false );
48 }
49 
50 int main( int argc, char * argv [] ) {
51  try {
52  using namespace protocols::idealize;
53  using namespace protocols::jd2;
54  using namespace protocols::moves;
55  using namespace protocols::simple_moves::symmetry;
56  using namespace basic::options;
57  using namespace basic::options::OptionKeys;
58 
59  // initialization
61  devel::init(argc, argv);
62 
63  // configure the idealize mover
64  IdealizeMoverOP idealizer( new IdealizeMover() );
65 
66  if ( option[ coordinate_constraint_weight ].user() ) {
67  idealizer->coordinate_constraint_weight( option[ coordinate_constraint_weight ]() ) ;
68  }
69 
70  if ( option[ atom_pair_constraint_weight ].user() ) {
71  idealizer->atom_pair_constraint_weight( option[ atom_pair_constraint_weight ]() );
72  }
73  idealizer->fast( option[ fast ]() );
74  idealizer->chainbreaks( option[ chainbreaks ]() );
75  idealizer->cis_omega( option[ cis_omega ]() );
76 
77  MoverOP mover (idealizer);
78 
79  // optionally set pose for symmetry
80  if ( option[ OptionKeys::symmetry::symmetry_definition ].user() ) {
81  SequenceMoverOP seqmov( new SequenceMover() );
82  seqmov->add_mover( MoverOP( new SetupForSymmetryMover() ) );
83  seqmov->add_mover( mover );
84  mover = seqmov;
85  }
86 
87  // start the job
88  try {
89  JobDistributor::get_instance()->go( mover );
90  } catch ( utility::excn::EXCN_Base& excn ) {
91  std::cerr << "Exception: " << std::endl;
92  excn.show( std::cerr );
93  }
94  }
95 catch (utility::excn::EXCN_Base const & e ) {
96  std::cout << "caught exception " << e.msg() << std::endl;
97  return -1;
98 }
99 }
ocstream cerr(std::cerr)
Wrapper around std::cerr.
Definition: ocstream.hh:290
virtual std::string const msg() const
Definition: EXCN_Base.hh:70
vector0: std::vector with assert-checked bounds
void init(int argc, char *argv[])
Command line init() version.
Definition: init.cc:23
BooleanOptionKey const user("options:user")
Definition: OptionKeys.hh:40
int main(int argc, char *argv[])
Definition: idealize_jd2.cc:50
virtual void show(std::ostream &) const =0
rule< Scanner, options_closure::context_t > options
Definition: Tag.cc:377
#define OPT_KEY(type, key)
double Real
Definition: types.hh:39
#define NEW_OPT(akey, help, adef)
ocstream cout(std::cout)
Wrapper around std::cout.
Definition: ocstream.hh:287
void register_options()
Definition: idealize_jd2.cc:42
vector1: std::vector with 1-based indexing
base class for Exception system
Program options global and initialization function.
rule< Scanner, option_closure::context_t > option
Definition: Tag.cc:378