Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AbrelaxApplication.hh
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 AbrelaxApplication
11 /// @brief Application-level code for Abrelax, fold_cst and JumpingFoldCst protocols
12 /// @detailed
13 /// use -help to see options
14 /// usage of class:
15 /// call AbrelaxApplication::register_options() before core::init
16 /// in main program make instance and call run() method.
17 ///
18 /// @author Oliver Lange
19 
20 #ifndef INCLUDED_protocols_abinitio_AbrelaxApplication_hh
21 #define INCLUDED_protocols_abinitio_AbrelaxApplication_hh
22 
23 // Unit Headers
24 
25 // Package Headers
26 
27 // Project Headers
28 #include <protocols/jobdist/JobDistributors.hh> // keep first
29 
30 #include <core/pose/Pose.fwd.hh>
31 #include <core/types.hh>
32 
34 
36 
38 //#include <core/scoring/constraints/ConstraintForest.fwd.hh>
40 // AUTO-REMOVED #include <core/scoring/MembraneTopology.fwd.hh>
42 
45 
46 // AUTO-REMOVED #include <protocols/abinitio/ClassicAbinitio.fwd.hh>
47 // AUTO-REMOVED #include <protocols/abinitio/MembraneAbinitio.fwd.hh>
50 
51 /// The instance of Loops contained by AbrelaxApplication should be replaced by a LoopsOP
52 #include <protocols/loops/Loops.hh>
53 
54 /// The instance of CheckPointer contained by AbrelaxApplication should be replaced by a CheckPointerOP
56 
60 
61 // ObjexxFCL Headers
62 
63 // Utility headers
64 // #include <utility/pointer/ReferenceCount.hh>
65 
66 //// C++ headers
67 // AUTO-REMOVED #include <cstdlib>
68 #include <string>
69 #include <vector>
70 
71 #include <utility/vector1.hh>
72 
73 
74 namespace protocols {
75 namespace abinitio {
76 
77 /// @brief application level code for Abrelax, Foldconstraints and JumpingFoldconstraints
78 
80 public:
82 
83  /// @brief Explicit virtual destructor since AbrelaxApplication contains OPs
84  /// NOTE: any time you define a class that is derived from by other classes
85  /// and which contains polymorphic functions, it needs to have a virtual destructor.
86  /// If your class derives from ReferenceCount, then it will inherit a virtual destructor
87  /// If it does not, as AbrelaxApplication does not, then you must declare the
88  /// destructor virtual.
89  virtual ~AbrelaxApplication();
90 
91  /// @brief Explicit copy constructor since AbrelaxApplication contains OPs
93 
94  static void register_options();
95 
96  /// @brief diagnostic stuff, i.e., computing numbers like an RMSD for each decoy and storing in silent-score-file
97  /// put everything in here. --- actually it mainly calls the evaluator_->apply method.
98  /// add diagnostic stuff either here as explicit code or
99  /// in form of a PoseEvaluator to evaluator_ ( see setup () )
100  /// the latter has the advantage that the specific evaluation can be carried out during the run of the protocol
101  /// e.g., for abinitio:debug ( output to stage1_outfile stage2_outfile... )
102  void process_decoy(
103  core::pose::Pose &pose,
105  std::string tag,
107  ) const;
108 
109  /// @brief read constraint set (self-initializing) and connect it to pose
110  void add_constraints( core::pose::Pose &pose );
111 
112  /// @brief initialization of application: read some pdb files, set evaluator_
113  void setup();
114 
115  /// @brief run application code: calls do_rerun() or fold() depending on cmd-options
116  void run();
117 
118  /// @brief run process_decoy on all poses in silent-in file
119  void do_rerun();
120 
121  /// @brief run process_decoy on all poses in silent-in file -- use of JobDistributor
122  void do_distributed_rerun();
123 
124  /// @brief setup everything needed for fold() --- calls helper functions below
125  void setup_fold( core::pose::Pose &extended_pose, ProtocolOP& prot_ptr );
126 
127  /// @brief run abrelax-type protocols
128  void fold( core::pose::Pose& extended_pose, ProtocolOP prot_ptr );
129 
130  /// @brief return pose with simple fold-tree that has small <0.1 RMSD to input pose
131  bool close_loops( core::pose::Pose &pose, core::scoring::ScoreFunctionOP scorefxn, std::string const& tag );
132 
133  /// @brief relax structure ( fast / classic as controlled by cmd-options )
135 
136  /// @brief relax multiple structures that are stored in abinitio_protocol.structure_store
137  bool multi_fast_relax(
138  Protocol& abinitio_protocol,
141  int& curr_nstruct,
142  jobdist::BasicJobOP& curr_job
143  );
144 
145  /// @brief little helper: minimize structure to have lower chainbreak score
146  /// ( seems particularly necessary after reading from silent-file )
147  //obsolet void fix_chainbreaks( core::pose::Pose &pose );
148 
149  /// @brief add a PoseEvaluator derived instance for decoy-processing
151 
152  /// @brief check if the given pose passes the set of abinitio filters.
153  bool check_filters( core::pose::Pose & pose );
154 
155 private:
156  /// @brief create score-functions for centroid and fullatom level
157  core::scoring::ScoreFunctionOP generate_scorefxn( bool fullatom = false );
158 
159 
160  /// ---- Helper functions for setup_fold
161 
162  /// @brief steal native torsions from native_pose_ and apply to the extended_pose.
163  void copy_native_structure( core::pose::Pose &extended_pose ) const;
164 
165  /// @brief copy torsions from the desired_pose, copy them into the extended_pose.
166  void copy_structure( core::pose::Pose & extended_pose, core::pose::Pose & desired_pose ) const;
167 
168  /// @brief steal native torsions from native_pose_ and apply to the "extended_pose"
169  void generate_extended_pose( core::pose::Pose &extended_pose, std::string const& sequence ) const;
170 
171  /// @brief read fragment data
172  void setup_fragments(); // core::fragment::FragSetOP& fragset_large, core::fragment::FragSetOP& fragset_small );
173 
174  /// @brief read jump definitions and set jump_def_
175  void setup_jumps( core::pose::Pose const& extended_pose );
176 
177 
178  /// @brief read in membrane topology
179  void setup_membrane_topology( core::pose::Pose & pose, std::string spanfile ) const;
180 
181  /// @brief initialize template_
182  void setup_templates();
183 
184  /// @brief insert fragments from aligned regions
185  void insert_template_frags( core::pose::Pose&, core::kinematics::MoveMapOP movemap, std::string tag/*for logs*/ ) const;
186 
188 
189 private:
190  /// ------------- Data -------------------------------
191  /// -------- When you add new data to this class, ----
192  /// -------- you must update the copy constructor ----
193 
194  // a score file ( written to in process_decoy )
196 
197  // native_pose: steal fragments, compute rmsd, start-structure, sequence
199 
200  // start-pose non-extended pose for start of runs
202 
203  // loops ( yes, we can do loop-modelling now )
205 
206  // if specified the structures are projected to PCA-eigenvector
208 
209  // are we doing fa-relax ?
210  bool bRelax_;
211 
212  // the sequence of the target protein
214 
215  // the constraint set --- if available
217 
218  //core::scoring::constraints::ConstraintForestOP constraint_forest_;
219  //membrane jumping? do we need to fiddle around with the fold tree...
220 
222 
223  // jump definitions --- if available
225 
226  // ss_def ( bascially used for loop_fraction )
228 
229  // info about homologues structures --- if available
231 
232  //probably 9mer fragments
234 
235  //probably 3mer fragments top25=25
237 
238  //probably 3mer fragments
240 
241  // pure template fragments... or merged with fragset_large_ only used if vary_frag_size == true
243 
244 // a bunch of PoseEvaluators for process_decoy() --- if available
246 
247  // checkpoints for close_loop
249 
250 };
251 
252 } //abinitio
253 } //protocols
254 
255 #endif