Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FibrilModelingClaimer.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 // This file is part of the Rosetta software suite and is made available under license.
5 // The Rosetta software is developed by the contributing members of the Rosetta Commons consortium.
6 // (C) 199x-2009 Rosetta Commons participating institutions and developers.
7 // For more information, see http://www.rosettacommons.org/.
8 
9 /// @file FibrilModelingClaimer
10 /// @brief Fibril Modeling
11 /// @author Lin Jiang
12 
13 // Unit Headers
19 // AUTO-REMOVED #include <core/conformation/symmetry/SymmetricConformation.hh>
20 
21 // Package Headers
24 #include <basic/options/option.hh>
25 #include <basic/options/keys/fold_and_dock.OptionKeys.gen.hh>
26 #include <basic/Tracer.hh>
27 
28 // Utility header
31 
32 #include <numeric/random/random.hh>
33 
34 // Project Headers
35 #include <core/pose/Pose.hh>
36 #include <protocols/loops/Loop.hh>
38 
40 // AUTO-REMOVED
41 // AUTO-REMOVED #include <core/io/pdb/pose_io.hh>
42 
46 #include <utility/vector0.hh>
47 #include <utility/vector1.hh>
48 
49 //Auto Headers
51 
52 static basic::Tracer tr("protocols.topo_broker.fibril_modeling",basic::t_info);
53 static numeric::random::RandomGenerator RG(332483344);
54 
55 namespace protocols {
56 namespace topology_broker {
57 
58 using namespace core;
59 
60 
61 FibrilModelingClaimer::FibrilModelingClaimer() { bAlign_ = false; sequence_shift_ = 0;}
62 
64  input_pose_(input_pose)
65 {
66  rigid_core_ = rigid;
68  sequence_shift_ = shift;
70  bAlign_ = true;
71 }
72 
74  input_pose_(input_pose)
75 {
76  rigid_core_ = rigid;
77  input_rigid_core_ = input_rigid ;
78  sequence_shift_ = 0;
79  bAlign_ = true;
80 }
81 
82 bool FibrilModelingClaimer::read_tag( std::string tag, std::istream& is ) {
83 
84  if ( tag == "pdb" || tag == "PDB" || tag == "pdb:" || tag == "PDB_FILE" ) {
85  std::string file;
86  is >> file;
89  file );
90  bAlign_ = true;
91  runtime_assert( input_pose_.is_fullatom() );
92  } else if ( tag == "sequence_shift" ) {
93  is >> sequence_shift_ ;
94  } else if ( tag == "REGION" ) {
97  loops::SerializedLoopList loops = reader.read_pose_numbered_loops_file( is, type(), false /*no strict checking */ );
98  rigid_core_ = loops::Loops( loops );
101  } else if ( tag == "INPUT_REGION" ) {
103  loops::PoseNumberedLoopFileReader loop_file_reader;
104  loop_file_reader.hijack_loop_reading_code_set_loop_line_begin_token( "RIGID" );
105  loops::SerializedLoopList loops = loop_file_reader.read_pose_numbered_loops_file( is, type(), false /*no strict checking */ );
106  input_rigid_core_ = loops::Loops( loops );
107  } else return Parent::read_tag( tag, is );
108  return true;
109 }
110 
111 void
113 {
114  using namespace core::conformation::symmetry;
115 
116  // Setup symmetry if we have not already done it
117  if ( !core::pose::symmetry::is_symmetric( pose ) ) {
119  if( bAlign_ ) {
120  setup_mover->align( pose, input_pose_ , rigid_core_, input_rigid_core_ );
121  }
122  setup_mover->apply( pose );
123  }
124  assert( core::pose::symmetry::is_symmetric( pose ) );
125  // Save the symmetry info
126  // input_pose_ = pose;
128 
129 }
130 
131 void
133  moves::RandomMover& random_mover,
134  core::pose::Pose const& /*pose*/,
135  abinitio::StageID /*stageID, abinitio sampler stage */,
136  core::scoring::ScoreFunction const& scorefxn,
137  core::Real /*progress progress within stage */
138 )
139 {
140  using namespace basic::options;
141  using namespace basic::options::OptionKeys::fold_and_dock;
142 
143  core::Real move_anchor_weight(1.0), rb_weight, slide_weight;
144 
145  if( option( move_anchor_points ).user() ) {
147  random_mover.add_mover( move_anchor_mover, move_anchor_weight );
148  }
149 
150  rb_weight = option( rigid_body_frequency );
151  moves::MoverOP rb_trial_mover = new symmetric_docking::SymFoldandDockRbTrialMover( &scorefxn );
152  random_mover.add_mover( rb_trial_mover, rb_weight );
153 
154  slide_weight = option( slide_contact_frequency );
156  random_mover.add_mover( slide_mover, slide_weight );
157 
158 }
159 
161  core::pose::Pose& pose,
162  DofClaims const& init_dofs,
163  DofClaims& /*failed_to_init*/ ) {
164 
165  using namespace core::conformation::symmetry;
166 
167  // Setup symmetry if we have not already done it
168  make_fibril( pose );
169 
170  // Randomize the rigid body
171  protocols::simple_moves::symmetry::SymDockingInitialPerturbation initial( false /*slide into contact*/ );
172  initial.apply( pose );
173  // Setup the movemap
174  //SymmetricConformation & symm_conf (
175  // dynamic_cast<SymmetricConformation & > ( pose.conformation()) );
176 
178  movemap->set_bb( true );
179  movemap->set_jump( false );
181 
182  for ( DofClaims::const_iterator it = init_dofs.begin(), eit = init_dofs.end();
183  it != eit; ++it ) {
184  if ( (*it)->owner()==this ) {
185  (*it)->toggle( *movemap, true );
186  }
187  }
188 }
189 
191  // Set all cuts to real cuts. We don't want to close any of them...
193  for ( Size i = 1; i <= cuts.size(); ++i ) {
194  new_claims.push_back( new CutClaim( this, cuts[i], DofClaim::INIT /* for now... eventually CAN_INIT ? */ ) );
195  }
196 }
197 
198 
199 bool FibrilModelingClaimer::allow_claim( DofClaim const& foreign_claim ) {
200 
201  using namespace core::conformation::symmetry;
202 
203  if ( foreign_claim.owner() == this ) return true; // always allow your own claims!
204 
205  //std::cout<<"claim_pos "<<foreign_claim.pos( 1 )<<" "<<is_symmetric( input_pose_ )<<std::endl;
207 
208  // check foreign claim
209  if ( foreign_claim.type() == DofClaim::BB ) {
210  if ( ! symminfo_->bb_is_independent( foreign_claim.pos( 1 ) ) ) return false;
211  } // DofClaim::BB
212 
213  //if ( foreign_claim.type() == DofClaim::JUMP ) {
214  // return false;
215  //}
216 
217  //if ( foreign_claim.type() == DofClaim::CUT) {
218  // if( ! input_symminfo_.bb_is_independent( foreign_claim.pos( 1 ) ) ) return false;
219  //}
220  }
221 
222  return true;
223 } // FibrilModelingClaimer::allow_claim()
224 
225 
226 } //topology_broker
227 } //protocols