44 #include <basic/Tracer.hh>
53 #include <ObjexxFCL/string.functions.hh>
54 #include <ObjexxFCL/FArray1D.hh>
56 #include <utility/exit.hh>
63 #include <utility/vector0.hh>
64 #include <utility/vector1.hh>
67 namespace ObjexxFCL { }
using namespace ObjexxFCL;
83 static basic::Tracer
TR(
"protocols.swa.stepwise_residue_sampler" ) ;
91 StepWiseProteinResidueSampler::StepWiseProteinResidueSampler(
95 moving_residues_( moving_residues ),
96 which_torsions_( which_torsions ),
97 main_chain_torsion_set_lists_( main_chain_torsion_set_lists ),
99 green_packer_( new protocols::simple_moves::GreenPacker ),
100 use_green_packer_( false ),
101 use_packer_instead_of_rotamer_trials_( false ),
102 pack_at_neighbors_only_( true ),
103 do_prepack_( false ),
114 Size const which_jump,
116 moving_residues_( moving_residues ),
117 which_torsions_( which_torsions ),
118 main_chain_torsion_set_lists_( main_chain_torsion_set_lists ),
120 green_packer_( new protocols::simple_moves::GreenPacker ),
121 use_green_packer_( false ),
122 use_packer_instead_of_rotamer_trials_( false ),
123 pack_at_neighbors_only_( true ),
124 do_prepack_( false ),
127 which_jump_( which_jump ),
130 if ( which_torsions.size() == 0 ){
145 return "StepWiseProteinResidueSampler";
158 clock_t
const time_start( clock() );
168 std::cout <<
"Total time in StepWiseProteinResidueSampler: " <<
static_cast<Real>( clock() - time_start ) / CLOCKS_PER_SEC << std::endl;
178 using namespace core::chemical;
179 using namespace core::scoring;
180 using namespace core::pose;
181 using namespace core::kinematics;
187 assert( main_chain_torsion_set_list.size() ==
which_torsions_.size() );
195 std::string const tag =
"S_"+ lead_zero_string_of( k-1, 5 );
204 (*scorefxn_)( pose );
211 if (
sfd_->size() == 0 ){
224 using namespace protocols::moves;
225 using namespace core::pack;
226 using namespace core::pack::task;
227 using namespace core::pack::task::operation;
232 Size current_group = 0;
233 Size spectator_group = 0;
234 for (
Size i = 1; i <= nres; i++ ) {
235 bool found_it(
false );
244 TR <<
"GREENPACKER SAMPLER " << i << std::endl;
246 if ( current_group == 0 ) spectator_group++;
247 current_group = spectator_group;
248 TR <<
"GREENPACKER SPECTATOR " << i <<
" --> group " << spectator_group << std::endl;
250 group_ids.push_back( current_group );
253 user_defined_group_discriminator->set_group_ids( group_ids );
255 green_packer_->set_group_discriminator( user_defined_group_discriminator );
260 green_packer_->set_reference_round_task_factory( initial_task_factory );
274 using namespace core::id;
291 dofs_to_reset.push_back( dof_id );
292 dof_values.push_back( pose.
dof( dof_id ) );
296 dofs_to_reset.push_back( dof_id );
297 dof_values.push_back( pose.
dof( dof_id ) );
306 pack_task_ = pack::task::TaskFactory::create_packer_task( pose );
310 pack_task_->nonconst_residue_task(i).and_extrachi_cutoff( 0 );
311 pack_task_->nonconst_residue_task(i).or_ex1(
true );
312 pack_task_->nonconst_residue_task(i).or_ex2(
true );
315 pack_task_->nonconst_residue_task(i).or_include_current(
true );
319 Size const ntrials_prepack( 1 );
334 for (
Size n = 1; n <= dofs_to_reset.size(); n++ ) {
335 pose.
set_dof( dofs_to_reset[ n ], dof_values[ n ] );
351 using namespace core::scoring;
353 (*scorefxn_)( pose );
359 residues_allowed_to_be_packed[ i ] =
true;
362 iter = energy_graph.get_node( i )->const_edge_list_begin();
365 Size j( (*iter)->get_other_ind( i ) );
366 residues_allowed_to_be_packed[ j ] =
true;
412 pack_task_->nonconst_residue_task(i).and_extrachi_cutoff( 0 );
413 pack_task_->nonconst_residue_task(i).or_ex1(
true );
414 pack_task_->nonconst_residue_task(i).or_ex2(
true );
415 pack_task_->nonconst_residue_task(i).or_include_current(
true );
417 pack_task_->nonconst_residue_task(i).prevent_repacking();