Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DisulfJumpClaimer.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 DisulfJumpClaimer
11 /// @brief Claimer for disulfide jump sampling
12 /// @detailed responsibilities:
13 /// @author Robert Vernon
14 
15 // Unit Headers
17 
18 // Package Headers
21 
22 // Project Headers
23 #include <core/pose/Pose.hh>
25 #include <core/fragment/FragSet.hh>
26 // AUTO-REMOVED #include <core/fragment/FragID.hh>
29 // AUTO-REMOVED #include <core/fragment/FragmentIO.hh>
31 // AUTO-REMOVED #include <protocols/jumping/JumpSetup.hh>
33 // AUTO-REMOVED #include <core/fragment/BBTorsionSRFD.hh>
34 // AUTO-REMOVED #include <core/fragment/JumpSRFD.hh>
35 
37 
38 
39 
40 // ObjexxFCL Headers
41 
42 // Utility headers
43 //#include <utility/io/izstream.hh>
44 //#include <utility/io/ozstream.hh>
45 //#include <utility/io/util.hh>
46 #include <basic/Tracer.hh>
47 
48 #include <utility/vector1.hh>
49 
50 
51 //#include <basic/options/option.hh>
52 
53 //// C++ headers
54 
55 // option key includes
56 
57 static basic::Tracer tr("protocols.topo_broker",basic::t_info);
58 //static numeric::random::RandomGenerator RG(18828234);
59 
60 namespace protocols {
61 namespace topology_broker {
62 
63 using namespace core;
64 
66  //jump_def_( NULL ),
67  // init_mover_( NULL ),
68  bKeepJumpsFromInputPose_( true )
69 {
70  set_bInitDofs( true ); //we want to initialize jumps
71 }
72 
73 // DisulfJumpClaimer::DisulfJumpClaimer( std::string const& tag, weights::AbinitioMoverWeightOP weight ) :
74 // FragmentClaimer( NULL, tag, weight ),
75 // // jump_def_ ( jump_def ),
76 // // init_mover_( NULL ),
77 // bKeepJumpsFromInputPose_( true )
78 // {
79 // set_bInitDofs( true ); //we want to initialize jumps
80 // }
81 
83  //if ( !jump_def_ ) return;
84  //runtime_assert( jump_def_ );
85 
87 
89  jump_frags->add( all_frames_ );
90 
92  mover = new simple_moves::ClassicFragmentMover( jump_frags, movemap_ );
93  mover->type( mover_tag() );
94  mover->set_check_ss( false ); // this doesn't make sense with jump fragments
95  mover->enable_end_bias_check( false ); //no sense for discontinuous fragments
96  set_mover( mover );
97 
98  //Size attempts( 10 );
99  //do {
100  // current_jumps_ = jump_def_->create_jump_sample();
101  //} while ( !current_jumps_.is_valid() && attempts-- );
102 
103  //if ( !current_jumps_.is_valid() ) {
104  // utility_exit_with_message( "not able to build valid fold-tree in DisulfJumpClaimer" );
105  //}
106  //tr.Debug << "current_jumps " << current_jumps_ << std::endl;
107 }
108 
109 
111  core::pose::Pose temp(pose);
112 
113  //Figure out what to do when the pose already has a fold tree later
114  new_decoy();
115 }
116 
117 void DisulfJumpClaimer::initialize_dofs( core::pose::Pose& pose, DofClaims const& init_dofs, DofClaims& failed_to_init ) {
118 
119  //init_mover_ = new simple_moves::ClassicFragmentMover( jump_frags, movemap_ );
120  //init_mover_->type( mover_tag() );
121  //init_mover_->set_check_ss( false ); // this doesn't make sense with jump fragments
122  //init_mover_->enable_end_bias_check( false ); //no sense for discontinuous fragments
123 
124 // kinematics::MoveMapOP movemap = new kinematics::MoveMap();
125 
126 // for ( DofClaims::const_iterator it = init_dofs.begin(), eit = init_dofs.end();
127 // it != eit; ++it ) {
128 // if ( (*it)->owner()==this ) {
129 // (*it)->toggle( *movemap, true );
130 // }
131 // }
132 
133 
134 
135 
136  //need to copy coords and jumps --- if chunks were idealized no problem .... but non-idealized stuff ?
137 // if ( init_mover_ ) {
138 // simple_moves::FragmentMoverOP frag_mover = get_frag_mover_ptr();
139 // set_mover( init_mover_ );
140 // FragmentClaimer::initialize_dofs( pose, init_dofs, failed_to_init );
141 // set_mover( frag_mover );
142 // init_mover_ = NULL;
143 // } else {
144  FragmentClaimer::initialize_dofs( pose, init_dofs, failed_to_init );
145 // }
146 }
147 
150  //core::kinematics::MoveMap const& mm,
151  core::fragment::FrameList& all_frames
152 ) const
153 {
155  all_frames.reserve( all_frames.size() + all_jump_pairings_.size() );
156 
158  lib.create_jump_fragments( false, frag_data );
159 
160  for ( Size i = 1; i <= all_jump_pairings_.size(); ++i) {
161  int const startpos( all_jump_pairings_[i].pos1 );
162  int const endpos( all_jump_pairings_[i].pos2 );
163 
165  new core::fragment::JumpingFrame( startpos, endpos, 2 );
166 
167  frame->set_pos( 1, startpos );
168  frame->set_pos( 2, endpos );
169 
170  frame->add_fragment( frag_data );
171 
172  runtime_assert( frame->nr_frags() );
173  all_frames.push_back( frame );
174  }
175 
176 }
177 
178 // void DisulfJumpClaimer::generate_jump_frames(
179 // core::fragment::FrameList& all_frames,
180 // core::kinematics::MoveMap const& mm
181 // ) const
182 // {
183 // all_frames.reserve( all_frames.size() + all_jump_pairings_.size() );
184 
185 // for ( Size i = 1; i <= all_jump_pairings_.size(); ++i) {
186 // int const startpos( all_jump_pairings_[i].pos1 );
187 // int const endpos( all_jump_pairings_[i].pos2 );
188 
189 // core::fragment::FragDataOP frag_data = new core::fragment::FragData;
190 
191 // frag_data->add_residue( new core::fragment::UpJumpSRFD );
192 // frag_data->add_residue( new core::fragment::DownJumpSRFD );
193 
194 // core::fragment::JumpingFrameOP frame =
195 // new core::fragment::JumpingFrame( startpos, endpos, frag_data->size () );
196 
197 // Size pos = 1;
198 // frame->set_pos( pos++, startpos );
199 // frame->set_pos( pos++, endpos );
200 
201 // frame->add_fragment( frag_data );
202 
203 // runtime_assert( frame->nr_frags() );
204 // all_frames.push_back( frame );
205 // }
206 // }
207 
208 
210 
211  // get flexible jumps ( beta-sheet stuff etc. )
212  /// in future get rid of JumpSample class all-together.
213 
214  movemap_->set_jump( true ); //we switch them off on a as-need basis
215  movemap_->set_bb( true );
216 
217 // core::fragment::FragSetOP jump_frags = new core::fragment::OrderedFragSet;
218 // core::fragment::FrameList jump_frames;
219 
220 // //generate_jump_frames( jump_frames, *movemap_ );
221 // jump_frags->add( jump_frames );
222 
223 
224  for ( Size i = 1; i <= all_jump_pairings_.size(); ++i) {
225 
226  Size const up( all_jump_pairings_[i].pos1 );
227  Size const down( all_jump_pairings_[i].pos2 );
228 
229  //new_claims.push_back( new JumpClaim( this, up, down, up_atom, down_atom, DofClaim::INIT ) );
230  new_claims.push_back( new JumpClaim( this, up, down, DofClaim::INIT ) );
231 
232  }
233 
234 }
235 
236 bool DisulfJumpClaimer::read_tag( std::string tag, std::istream& is ) {
237  if ( tag == "NO_USE_INPUT_POSE" ) {
238  bKeepJumpsFromInputPose_ = false;
239  } else if ( tag == "DISULF" ) {
240  Size pos1, pos2;
241  char ss1, ss2;
242 
243  is >> pos1 >> ss1 >> pos2 >> ss2;
244 
246 
247  dis_pair.pos1 = pos1;
248  dis_pair.pos2 = pos2;
249  dis_pair.seq_sep = abs((int)(pos1-pos2));
250  dis_pair.ss_type = 1;//PLACEHOLDER!
251 
252  all_jump_pairings_.push_back( dis_pair );
253 
254  } else if ( tag == "mover_weight" ) {
255  read_mover_weight( is );
256  } else return Parent::read_tag( tag, is );
257  return true;
258 }
259 
260 } //topology_broker
261 } //protocols