Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RigidChunkClaimer.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 TopologyBroker
11 /// @brief top-class (Organizer) of the TopologyBroker mechanism
12 /// @detailed responsibilities:
13 /// @author Oliver Lange
14 
15 #ifndef INCLUDED_protocols_topology_broker_RigidChunkClaimer_hh
16 #define INCLUDED_protocols_topology_broker_RigidChunkClaimer_hh
17 
18 // Unit Headers
20 
21 // Package Headers
24 
25 // Project Headers
26 #include <core/pose/Pose.hh>
27 #include <protocols/loops/Loops.hh>
28 #include <utility/pointer/ReferenceCount.hh>
30 
31 #include <utility/vector1.hh>
32 
33 
34 namespace protocols {
35 namespace topology_broker {
36 
37 ///@brief defines a rigid part of structure... imagine a loop-relax application core structure is fixed via jumps and loops can move
38 ///@detail the rigid chunk takes a definition of rigid regions in form of an instance of Loops (just taken as bunch of start-end residue numbers --- here defining the rigid residues and not the loops).
39 /// the rigid chunk to keep its integrity will need jumps, the claimer will reuse jumps if somebody else claims them,
40 /// or submit in finalize_claims his own jumps, if not enough jumps are present.
41 /// in "bExclusive_ mode" the RigidChunk will reclaim any jump claim that is useful and wihin the rigid region. (i.e., foreign claim is dissallowed but own claim with same residues is issued --- in this way the claimer uses e.g., beta-sheet jumps, where they are suggested
42 /// the input pose is used to initialize the rigid region ( via copying of internal coordinates )
43 /// e.g., a hole in the structure shouldn't pose a problem, since we basically copy the atom-tree.
46 
47 public:
49  public:
52  };
53 
54 public:
55  //c'stor
57  RigidChunkClaimer( core::pose::Pose const& input_pose, loops::Loops rigid );
58 
59  //clone
60  virtual TopologyClaimerOP clone() const {
61  return new RigidChunkClaimer( *this );
62  }
63 
64  ///@brief type() is specifying the output name of the TopologyClaimer
65  virtual std::string type() const {
66  return _static_type_name();
67  }
68 
70  return "RigidChunkClaimer";
71  }
72 
73  virtual void new_decoy();
74  virtual void new_decoy( core::pose::Pose const& );
75 
76  ///@brief generate DofClaims for BB
77  virtual void generate_claims( DofClaims& ); //add to list ( never call clear() on list )
78 
79  ///@brief has to decline foreign BB claims for rigid regions, reclaim jumps where appropriate
80  virtual bool allow_claim( DofClaim const& /*foreign_claim*/ );
81 
82  ///@brief issue jump-claims for jumps yet missing to keep rigid regions fixed
83  virtual void finalize_claims( DofClaims& );
84 
85  // virtual void initialize_residues( core::pose::Pose&, DofClaims const& init_claims, DofClaims& failed_to_init );
86  ///@brief initialize BB residues and rigid-internal jumps from starting structure --- copying atom-tree dofs
87  virtual void initialize_dofs( core::pose::Pose&, DofClaims const& init_claims, DofClaims& failed_to_init );
88 
89  ///@brief rigid-chunk can probably provide some side-chain info from full-length model
90  virtual void switch_to_fullatom( core::pose::Pose&, utility::vector1< bool > bNeedToRepack ) const;
91 
92  ///@brief will fail if a BB torsion claim of the rigid region has been declined
93  virtual bool accept_declined_claim( DofClaim const& was_declined );
94 
95  ///@brief multiply your bias to this -- if its zero don't change that, i.e., multiply only
96  virtual void manipulate_cut_bias( utility::vector1< core::Real >& cut_bias );
97 
98  ///@brief disallow torsion moves in relax if bRigidInRelax
99  virtual void adjust_relax_movemap( core::kinematics::MoveMap& ) const;
100 
101  // will be required when we have the option to use coord. csts to fix the rigid chunk.
102  //virtual void add_constraints( core::pose::Pose& /*pose*/ );
103  //???? virtual void add_score_weights( core::scoring::ScoreFunction& );
104  virtual void receive_message( ClaimerMessage& cm );
105 
106  ///@brief Returns true if we are using loop definitions from ThreadingJob
108  return bUseThreadingJobLoops_;
109  }
110 
111  ///@brief Sets whether we should use loop definitions from ThreadingJob
112  void use_loops_from_threading_job(bool setting) {
113  bUseThreadingJobLoops_ = setting;
114  }
115 
116 protected:
117  ///@brief select sub-regions from rigid_core_, if skip-rate is specified
118  void select_parts();
119 
120  virtual bool read_tag( std::string tag, std::istream& is );
121 
122  virtual void set_defaults(); //eg before reading starts.
123 
124  virtual void init_after_reading();
125 
126 
127 private:
128  ///@brief starting pose
130 
131  ///@brief starting pose in centroid mode
133 
134  ///@brief regions that can be used for rigid core
136 
137  ///@brief if skip-rate is given (in loop-definitions) current_rigid_core_ will contain the current "choice" of regions... set in generate_claims()
139 
140  ///@brief jumps used this round --- since generate_claims()
142 
143  ///@brief flag used to specify if the rigid regions should really be treated exclusivity --- i.e., are they really rigid ?
144  ///@brief changing this flag to false, will allow everything to move, but together with coordinate constraints this might yield
145  /// a pose that is easier sampled ?
146  bool bExclusive_; //really rigid?
147 
148  ///@brief jump residues that are just next to rigid region are probably leading to impossibl fold-trees (not always -- but most of the time)
149  /// if false we don't allow such jumps
151 
152  ///@brief use the pose in new_decoy( pose )
154 
155  ///@brief use loop-definition from ThreadingJob
157 
158  ///@brief min_loop_size for Threading-loops
160 
161  ///@brief same effect as OptionKeys::loops::random_grow_loops_by ]() for looprelax
163 
164  ///@brief keep this chunk rigid in relax --- adjust movemap to keep BB-Torsions fixed...
166 
167 
168  ///@brief helper class -- computes if we have all jupms needed to rigidify the chosen chunk and generate more jumps if needed.
169  class JumpCalculator : public utility::pointer::ReferenceCount { //helper class do we like this jump, do we need more ?
170  public:
171  JumpCalculator( loops::Loops const& rigid_, bool bAllowAdjacentJumps );
172 
173  ///@brief only called for relevant jumps:
174  ///*true* if this jump helps us keeping things rigid,
175  ///*false* if this jump connects rigid regions
176  // that are already rigidified via a different jump.
177  bool good_jump( core::Size pos1, core::Size pos2 );
178 
179  ///@brief this jump doesn't help --- it doens't touch two of the rigid regions
180  bool irrelevant_jump( core::Size pos1, core::Size pos2 );
181 
182  ///@brief get the missing jumps
183  void generate_rigidity_jumps( RigidChunkClaimer*, DofClaims& extra_jumps );
184 
185  private:
186  ///@brief what should be rigid
188 
189  ///@brief which residues have already been connected via jumps
191 
192  ///@brief how many new jumps
194 
195  ///@brief use loop-definition from alignment in ThreadingJob
198 
199  };
200 
201  // Types
204 
205 }; //class RigidChunkClaimer
206 
207 }
208 }
209 
210 #endif
211