47 #include <basic/Tracer.hh>
56 #include <ObjexxFCL/string.functions.hh>
57 #include <ObjexxFCL/FArray1D.hh>
59 #include <utility/exit.hh>
66 #include <utility/vector0.hh>
67 #include <utility/vector1.hh>
70 namespace ObjexxFCL { }
using namespace ObjexxFCL;
86 static basic::Tracer
TR(
"protocols.swa.stepwise_residue_sampler" ) ;
94 StepWiseProteinPacker::StepWiseProteinPacker(
97 moving_residues_( moving_residues ),
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 rescore_only_( false ),
106 sample_generator_( sample_generator )
117 return "StepWiseProteinPacker";
130 clock_t
const time_start( clock() );
142 std::cout <<
"Total time in StepWiseProteinPacker: " <<
static_cast<Real>( clock() - time_start ) / CLOCKS_PER_SEC << std::endl;
152 using namespace core::chemical;
153 using namespace core::scoring;
154 using namespace core::pose;
155 using namespace core::kinematics;
156 using namespace protocols::swa;
169 std::string const tag =
"S_"+ lead_zero_string_of( k-1, 5 );
181 (*scorefxn_)( pose );
189 if (
sfd_->size() == 0 ) {
190 TR <<
"Warning -- nothing passed filter -- outputting a placeholder pose." << std::endl;;
191 std::string const tag =
"S_"+ lead_zero_string_of( k-1, 5 );
202 std::cout <<
" Decoy " << tag <<
" : ";
204 std::cout << pack_or_trials;
205 std::cout <<
" Number " << k;
207 std::cout << std::endl;
214 using namespace protocols::moves;
215 using namespace core::pack;
216 using namespace core::pack::task;
217 using namespace core::pack::task::operation;
222 Size current_group = 0;
223 Size spectator_group = 0;
224 for (
Size i = 1; i <= nres; i++ ) {
225 bool found_it(
false );
234 TR <<
"GREENPACKER SAMPLER " << i << std::endl;
236 if ( current_group == 0 ) spectator_group++;
237 current_group = spectator_group;
238 TR <<
"GREENPACKER SPECTATOR " << i <<
" --> group " << spectator_group << std::endl;
240 group_ids.push_back( current_group );
243 user_defined_group_discriminator->set_group_ids( group_ids );
245 green_packer_->set_group_discriminator( user_defined_group_discriminator );
250 green_packer_->set_reference_round_task_factory( initial_task_factory );
264 using namespace core::id;
266 pack_task_ = pack::task::TaskFactory::create_packer_task( pose );
270 pack_task_->nonconst_residue_task(i).and_extrachi_cutoff( 0 );
271 pack_task_->nonconst_residue_task(i).or_include_current(
true );
274 pack_task_->nonconst_residue_task(i).or_ex1(
true );
275 pack_task_->nonconst_residue_task(i).or_ex2(
true );
280 pack_task_->nonconst_residue_task(i).or_ex4(
true );
300 using namespace core::scoring;
302 (*scorefxn_)( pose );
308 residues_allowed_to_be_packed[ i ] =
true;
311 iter = energy_graph.get_node( i )->const_edge_list_begin();
314 Size j( (*iter)->get_other_ind( i ) );
315 residues_allowed_to_be_packed[ j ] =
true;
349 if ( residues_allowed_to_be_packed[ i ] ) {
350 pack_task_->nonconst_residue_task(i).and_extrachi_cutoff( 0 );
351 pack_task_->nonconst_residue_task(i).or_include_current(
true );
353 pack_task_->nonconst_residue_task(i).or_ex1(
true );
354 pack_task_->nonconst_residue_task(i).or_ex2(
true );
356 pack_task_->nonconst_residue_task(i).or_ex4(
true );
361 pack_task_->nonconst_residue_task(i).prevent_repacking();