Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Splice.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 protocols/protein_interface_design/movers/Splice.hh
11 /// @author Sarel Fleishman (sarelf@u.washington.edu)
12 
13 #ifndef INCLUDED_protocols_protein_interface_design_movers_Splice_hh
14 #define INCLUDED_protocols_protein_interface_design_movers_Splice_hh
17 #include <core/types.hh>
18 #include <core/pose/Pose.fwd.hh>
19 #include <utility/tag/Tag.fwd.hh>
21 #include <protocols/moves/Mover.hh>
26 #include <utility/pointer/ReferenceCount.hh>
30 
31 namespace protocols {
32 namespace protein_interface_design {
33 namespace movers {
34 
35 //@brief lightweight class containing bb torsions and residue identities
37 {
38  public:
39  BBDofs() : resid_( 0 ), phi_( 0.0 ), psi_( 0.0 ), omega_( 0.0 ), resn_( "" ){}
40  BBDofs( core::Size const resid, core::Real const phi, core::Real const psi, core::Real const omega, std::string const resn ) : resid_( resid ), phi_( phi ), psi_( psi ), omega_( omega ), resn_( resn ){}
41  core::Size resid() const{ return resid_; }
42  core::Real phi() const{ return phi_; }
43  core::Real psi() const{ return psi_; }
44  core::Real omega() const{ return omega_; }
45  std::string resn() const {return resn_; }
46  void resid( core::Size const r ){ resid_ = r; }
47  void phi( core::Real const p ){ phi_ = p; }
48  void psi( core::Real const p ){ psi_ = p; }
49  void omega( core::Real const o ){ omega_ = o; }
50  void resn( std::string const r ){ resn_ = r; }
51  virtual ~BBDofs();
52  private:
53  core::Size resid_; /// this is currently not used in splice
56 };
57 
58 ///@brief container for BBDofs, providing a convenient operator [], size, other methods and iterators that allow splice to treat
59 /// ResidueBBDofs as a simple vector (even though it contains other elements as well)
61 {
62  public:
64  typedef bbdof_list::iterator iterator;
65  typedef bbdof_list::const_iterator const_iterator;
66 
68  virtual ~ResidueBBDofs();
69  void cut_site( core::Size const c ){ cut_site_ = c; }
70  core::Size cut_site() const { return cut_site_; }
71  void clear() { bbdofs_.clear(); }
72  void push_back( BBDofs const b ){ bbdofs_.push_back( b ); }
73  const_iterator begin() const{ return bbdofs_.begin(); }
74  const_iterator end() const{ return bbdofs_.end(); }
75  iterator begin(){ return bbdofs_.begin(); }
76  iterator end(){ return bbdofs_.end(); }
77  core::Size size() const{ return bbdofs_.size(); }
78  BBDofs & operator[]( int const i ) { return bbdofs_[ i ]; }
79  core::Size start_loop() const{ return start_loop_; }
80  void start_loop( core::Size const s ){ start_loop_ = s; }
81  core::Size stop_loop() const{ return stop_loop_; }
82  void stop_loop( core::Size const s ){ stop_loop_ = s; }
83  std::string source_pdb() const{ return source_pdb_; }
84  void source_pdb( std::string const s ){ source_pdb_ = s; }
85  private:
88  std::string source_pdb_; // the source pdb from which the loop is taken
89 };
90 
91 
92 /// @brief designs alanine residues in place of the residue identities at the interface. Retains interface glycines and prolines.
94 {
95 public:
98 public:
99  Splice();
100  void apply( Pose & pose );
101  virtual std::string get_name() const;
105  virtual ~Splice();
106  void from_res( core::Size const f ){ from_res_ = f; }
107  core::Size from_res() const { return from_res_; }
108  void to_res( core::Size const t ){ to_res_ = t; }
109  core::Size to_res() const { return to_res_; }
110  std::string source_pdb() const { return source_pdb_; }
111  void source_pdb( std::string const s ){ source_pdb_ = s; }
112  void ccd( bool const c ){ ccd_ = c;}
113  bool ccd() const { return ccd_; }
116  core::Real rms_cutoff() const{ return rms_cutoff_; }
117  void rms_cutoff( core::Real const r ){ rms_cutoff_ = r; }
118  void res_move( core::Size const r ){ res_move_ = r; }
119  core::Size res_move() const{ return res_move_; }
120  void randomize_cut( bool const r ){ randomize_cut_ = r; }
121  bool randomize_cut() const{ return randomize_cut_; }
122  void cut_secondarystruc( bool const r){ cut_secondarystruc_ =r; }
123  bool cut_secondarystruc() const{ return cut_secondarystruc_; }
128 
132  void database_entry( core::Size const d ){ database_entry_ = d; }
133  void read_torsion_database();
137  void template_file( std::string const s ){ template_file_ = s; }
138  void poly_ala( bool const p ){ poly_ala_ = p; }
139  bool poly_ala() const{ return poly_ala_; }
140  void equal_length( bool const e ){ equal_length_ = e; }
141  bool equal_length() const{ return equal_length_; }
142  void fold_tree( core::pose::Pose & pose, core::Size const start, core::Size const stop, core::Size const cut ) const;
143  bool design() const{ return design_; }
144  void design( bool const d ) { design_ = d; }
147  bool dbase_iterate() const { return dbase_iterate_; }
148  void dbase_iterate( bool const d ){ dbase_iterate_ = d; }
151  core::Size find_dbase_entry( core::pose::Pose const & pose ); // returns a dbase entry
152  core::Size locked_res() const;
153  void locked_res( core::Size const r );
154  void locked_res_id( char const c );
155  char locked_res_id() const;
157  void checkpointing_file( std::string const cf );
158 
159  void load_from_checkpoint(); // load relevant internal data during a checkpoint recovery
160  void save_to_checkpoint() const; // save relevant data for future checkpoint recovery
161 
163  void loop_dbase_file_name( std::string const f );
164  void loop_pdb_source( std::string const l );
170 
171 /// sequence profiles
172 /// Splice changes the backbone of the current pose and the following methods deal with dynamically constructing a
173 /// sequence profile for the current backbone choices.
174  void read_splice_segments( std::string const segment_type, std::string const segment_name, std::string const file_name );
176  void load_pdb_segments_from_pose_comments( core::pose::Pose const & p); // get the segment names for those segments that are constant in this splice function
177  void modify_pdb_segments_with_current_segment( std::string const pdb_name ); // set the current segment name
178  void add_sequence_constraints( core::pose::Pose & pose ); // add SequenceProfileConstraints based on the sequence profile
181 
182 private:
183  void save_values(); // call at beginning of apply. Used to keep the from_res/to_res values, which might be changed by apply during a run
184  void retrieve_values(); // call at end of apply
185 
188  bool ccd_;//dflt true; do ccd?
189  core::scoring::ScoreFunctionOP scorefxn_; //dflt score12 with reweighted sheet weight
190  core::Real rms_cutoff_; //dflt 99999; after splicing, checks the average displacement of Ca atoms in the source and target segments. Failure leads to mover failure and no output
191  core::Size res_move_; //dflt 4; how many residues to allow to move during ccd
192  bool randomize_cut_; //dflt false; true: place cut in a randomly chosen loop residue, if available. false: place cut at loop's end
193  bool cut_secondarystruc_; //dflt false; true: allows placing the cut within secondary structures
194  core::pack::task::TaskFactoryOP task_factory_; // dflt NULL; Another access point to setting which residues to splice. This works at present only with one segment, so you set designable residues and Splice will then determine the first and last residues among these and splice that section out.
195  core::pack::task::TaskFactoryOP design_task_factory_; // dflt NULL; a task_factory used to restrict design during splicing. A 'good' idea for this is to define the aligned segments through RestrictToAlignedSegments and send those to this task_factory. During splicing, this task_factory will be used to restrict the design operations in addition to what DesignAroundOperation determines as the designable residues. So, by applying the user-defined RestrictToAlignedSegments as well as dao, you get design on the spliced segment + its vicinity in other aligned segments, and repack in a slightly larger shell.
196  std::string torsion_database_fname_; //dflt ""; set to true in order to read directly from a torsion database
197  core::Size database_entry_; //dflt 0; in which case tests a random entry in each apply
198  std::string database_pdb_entry_; // dflt ""; e.g., "1yihl" specify this only if you want just one loop to be spliced
200  std::string template_file_; //dflt ""; which source file to use as the template to determine what from_res() and to_res() refer to. The input structure may change during a trajectory and so from_res() and to_res() might lose their sense. If this is "", the input file is taken to be template
201  bool poly_ala_; /// dflt true; thread ala residues in each position other than Gly/Pro or conserved in the source pdb. If false, keeps the input sequence (except Gly/Pro, which are replaced)
202  bool equal_length_; // dflt false; restrict threading to loops equal in length to the original
203  core::pose::PoseOP template_pose_, start_pose_; // template - relative to what is the torsion dbase computed (1x9q); start - the starting pose for replacing the torsions at the start
205  bool design_; //dflt false; design all non-pro/gly residues in template
206  utility::vector1< int > delta_lengths_; // dflt empty; change loop length by how much? 0 is always assumed
207  bool dbase_iterate_; //dflt false;
208  bool first_pass_; // dflt true;
209  utility::vector1< core::Size > dbase_subset_; // indices to the subset of the dbase library over which multiple calls iterate
210  utility::vector1< core::Size >::const_iterator current_dbase_entry_; // used if multiple calls to splice are made to iterate through the list
211  utility::pointer::owning_ptr< protocols::moves::DataMapObj< bool > > end_dbase_subset_; // dflt false; this is a weird construct to allow placing the variable on the DataMap
212  utility::pointer::owning_ptr< protocols::moves::DataMapObj < utility::vector1< core::Size > > > locked_res_; // dflt NULL; a residue that serves as the root for a fold tree jump to the other chain. This residue is expected to be within the loop span, and allows the loop to be refined while keeping the rigid body jump between the two chains; it's a only ostensibly a vector, as it has to be compatible with placestub, but it only looks at the first element of that vector
213  char locked_res_id_; // dflt ''; the one-letter code for the locked residue
214  std::string checkpointing_file_; // dflt ""; a file that contains checkpointing information to recover from job termination when iterating over a loop database
215  std::string loop_dbase_file_name_; //dflt ""; a file name into which the loop database is dumped
216  std::string loop_pdb_source_; //dflt ""; what is the source pdb from which the loop came? This is used in writing the loop to the loop dbase, and helps keep track of where loops come from during design.
217  utility::pointer::owning_ptr< protocols::moves::DataMapObj< std::string > > mover_tag_; /// dflt NULL; to communicate the current Splice mover's loop origin to the GenericMC
219 
220 ///sequence profiles
221  bool use_sequence_profiles_; // dflt false; set internally only, by whether or not the Segments are defined
222  std::string segment_type_; //dflt ""; what segment is this? Used to decide which profiles to use. examples, L1,L2,L3
223  std::map< std::string, SpliceSegmentOP > splice_segments_; // stores sequence profiles for all possible segments (this doesn't change during a run), e.g., L1, ...; L2, ....
224  std::map< std::string/*which segment (L1,L2...)*/, std::string/*pdb name*/ > pdb_segments_; // which pdb file did each segment in the current pose come from (used to build the current profile). This uses the pose comment structure to retain the information through successive applies
225  core::Real profile_weight_away_from_interface_; //dflt 1.0; you can define a different weight outside an 8A shell around the partner protein. This should typically be set higher than 1.0, implying that the sequence profile carries a larger weight away from the functional site
226 };
227 
228 
229 } // movers
230 } // protein_interface_design
231 } // protocols
232 
233 
234 #endif /*INCLUDED_protocols_protein_interface_design_movers_Splice_HH*/