Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Protocol.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
11 /// @brief
12 /// @detailed
13 ///
14 ///
15 ///
16 /// @author Oliver Lange
17 
18 // Unit Headers
20 
21 // Package Headers
26 
27 // AUTO-REMOVED #include <core/pose/Pose.hh>
28 
29 // Utility Headers
30 #include <basic/Tracer.hh>
31 
32 #include <basic/options/option.hh>
33 
34 
35 // option key includes
36 
37 #include <basic/options/keys/out.OptionKeys.gen.hh>
38 #include <basic/options/keys/abinitio.OptionKeys.gen.hh>
39 
41 #include <utility/vector1.hh>
42 
43 
44 
45 static basic::Tracer tr("protocols");
46 using namespace core;
47 
48 void
50  using namespace basic::options;
51  using namespace basic::options::OptionKeys;
52  option.add_relevant( OptionKeys::abinitio::debug_structures );
53 }
54 
55 namespace protocols {
56 namespace abinitio {
57 // Project Header
58 
59 
61  checkpoints_("Protocol"),
62  evaluator_( NULL ),
63  return_centroid_( true )
64 {
65  if ( basic::options::option[ basic::options::OptionKeys::out::file::silent ].user() ) {
66  silentout_file_name_ = basic::options::option[ basic::options::OptionKeys::out::file::silent ]();
67  }
68 }
69 
70 void
72  core::pose::Pose &pose,
73  std::string tag,
75 {
76  if ( evaluator_) {
77  evaluator_->apply( pose, tag, pss );
78  }
79 }
80 
81 void
83  if ( !evaluator_ ) {
85  }
86  evaluator_->add_evaluation( ev );
87 }
88 
89 void
91  evaluator_ = ev;
92 }
93 
94 void
96  using namespace core::io::silent;
97  using namespace basic::options;
98  if ( option[ basic::options::OptionKeys::out::file::silent ].user() ) {
99  std::string silent_file="_"+prefix;
100  if ( get_current_job() && get_current_job()->output_file_name() != "" ) {
101  silent_file = get_current_job()->output_file_name()+silent_file;
102  } else silent_file = silentout_file_name_+silent_file;
103 
104  SilentFileData sfd;
105  //filename might have been changed -- e.g., to also have an MPI rank in there
106 
107  // ProteinSilentStruct pss;
108  io::silent::SilentStructOP pss = io::silent::SilentStructFactory::get_instance()->get_silent_struct_out();
109  pss->fill_struct( pose, get_current_tag() );
110 
111  evaluate_pose( pose, get_current_tag(), *pss );
112 
113  sfd.write_silent_struct( *pss, silent_file, !option[ OptionKeys::abinitio::debug_structures ]() /* bWriteScoresOnly */ );
114  } // if option[ out::file::silent ].user()
115 }
116 void
118  reset_status();
119  // structure_store().clear(); // keep this to avoid memory leaks
120  // if (! bInitialized_ ) {
121 // tr.Warning << "WARNING: ClassicAbinitio::apply is called without previous call to init(). Will self-initialize now... this overrides any"
122 // << " custom settings if they existed... ;" << std::endl; // could call init at
123 // init( pose );
124 // }
125 }
126 
129  return "Protocol";
130 }
131 
132 
133 }
134 }