37 #include <basic/options/option.hh>
38 #include <basic/Tracer.hh>
42 #include <basic/options/keys/flxbb.OptionKeys.gen.hh>
46 #include <utility/vector1.hh>
47 #include <utility/string_util.hh>
51 #include <utility/tag/Tag.hh>
58 #include <utility/vector0.hh>
60 static basic::Tracer
TR(
"protocols.flxbb.FlxbbDesign");
63 using namespace protocols::flxbb;
64 using namespace basic::options;
65 using namespace basic::options::OptionKeys;
73 FlxbbDesignCreator::keyname()
const
75 return FlxbbDesignCreator::mover_name();
79 FlxbbDesignCreator::create_mover()
const {
84 FlxbbDesignCreator::mover_name()
90 FlxbbDesignPack::FlxbbDesignPack() :
91 protocols::simple_moves::PackRotamersMover(
"FlxbbDesignPack")
98 protocols::simple_moves::PackRotamersMover( scorefxn, task ),
120 pose = *
filter_->get_bestpose();
126 return "FlxbbDesignPack";
131 Mover(
"FlxbbDesign" ),
136 use_origseq_for_not_dsgned_layer_( true ),
139 filter_during_design_( NULL ),
142 constraints_sheet_( -1.0 ),
143 constraints_NtoC_( -1.0 ),
144 movemap_from_blueprint_( false ),
146 use_fast_relax_( true ),
147 clear_all_residues_( false ),
148 relax_constraint_to_design_( false ),
149 limit_aroma_chi2_( true )
162 bool const use_origseq_for_not_dsgned_layer,
165 Mover(
"FlxbbDesign" ),
166 scorefxn_design_ ( sfxnd ),
167 scorefxn_relax_ ( sfxnr ),
168 nflxbb_cycles_( ncycle ),
169 layer_mode_( layer_mode ),
170 use_origseq_for_not_dsgned_layer_( use_origseq_for_not_dsgned_layer ),
171 no_relax_( no_relax ),
173 filter_during_design_( NULL ),
176 constraints_sheet_( -1.0 ),
177 constraints_NtoC_( -1.0 ),
178 movemap_from_blueprint_( false ),
180 use_fast_relax_( true ),
181 clear_all_residues_( false ),
182 relax_constraint_to_design_( false ),
183 limit_aroma_chi2_( true )
194 scorefxn_design_( rval.scorefxn_design_ ),
195 scorefxn_relax_( rval.scorefxn_relax_ ),
196 nflxbb_cycles_( rval.nflxbb_cycles_ ),
197 layer_mode_( rval.layer_mode_ ),
198 use_origseq_for_not_dsgned_layer_( rval.use_origseq_for_not_dsgned_layer_ ),
199 no_relax_( rval.no_relax_ ),
200 no_design_( rval.no_design_ ),
201 design_taskset_( rval.design_taskset_ ),
202 filter_during_design_( rval.filter_during_design_ ),
203 blueprint_ ( rval.blueprint_ ),
204 resfile_( rval.resfile_ ),
205 constraints_sheet_( rval.constraints_sheet_ ),
206 constraints_NtoC_( rval.constraints_NtoC_ ),
207 movemap_from_blueprint_( rval.movemap_from_blueprint_ ),
208 movemap_( rval.movemap_ ),
209 task_operations_( rval.task_operations_ ),
210 use_fast_relax_( rval.use_fast_relax_ ),
211 clear_all_residues_( rval.clear_all_residues_ ),
212 relax_constraint_to_design_( rval.relax_constraint_to_design_ ),
213 limit_aroma_chi2_( rval.limit_aroma_chi2_ )
234 if( option[ OptionKeys::flxbb::ncycle ].user() )
nflxbb_cycles_ = option[ OptionKeys::flxbb::ncycle ]();
235 if( option[ OptionKeys::flxbb::blueprint ].user() )
blueprint_ =
new BluePrint( option[ OptionKeys::flxbb::blueprint ]().name() );
236 if( option[ OptionKeys::flxbb::layer::layer ].user() )
layer_mode_ = option[ OptionKeys::flxbb::layer::layer ]();
241 Size filter_trial( 0 );
243 if( option[ OptionKeys::flxbb::filter_trial ].user() ) filter_trial = option[ OptionKeys::flxbb::filter_trial ]();
244 if( option[ OptionKeys::flxbb::filter_type ].user() ) filter_type = option[ OptionKeys::flxbb::filter_type ]();
245 if( filter_trial > 0 && filter_type !=
"" ){
252 if( filter_type !=
"" ){
253 if( filter_type ==
"packstat" ){
256 TR.Error << filter_type <<
" does not exists as filter name " << std::endl;
257 runtime_assert(
false );
265 option.add_relevant( OptionKeys::flxbb::view );
266 option.add_relevant( OptionKeys::flxbb::ncycle );
269 option.add_relevant( OptionKeys::flxbb::blueprint );
270 option.add_relevant( OptionKeys::flxbb::filter_trial );
271 option.add_relevant( OptionKeys::flxbb::filter_type );
272 option.add_relevant( OptionKeys::flxbb::layer::layer );
406 tf->push_back(
new LimitAromaChi2Operation );
407 rlx_mover->set_task_factory( tf );
415 if( layers.size() == 1 &&
layer_mode_ ==
"normal" ){
431 }
else if( layers.size() == 1 &&
layer_mode_ ==
"all" ){
434 }
else if( layers.size() >= 1 ){
436 bool boundary(
false );
440 if( layer ==
"core" ){
442 }
else if( layer ==
"surface" ){
444 }
else if( layer ==
"boundary" ){
447 TR <<
"Error!, wrong specification of layer_mode " << layer << std::endl;
448 TR <<
"Every layers are designed. " << std::endl;
462 for( DesignTaskSet::const_iterator it=dts.begin(); it!=dts.end(); ++it ) {
469 for( DesignTaskSet::const_iterator it=dts.begin(); it!=dts.end(); ++it ) {
476 for( DesignTaskSet::const_iterator it=dts.begin(); it!=dts.end(); ++it ) {
477 (*it)->add_task_operation(
new LimitAromaChi2Operation );
508 TR <<
"Movemap will be overrided by the definition of movemap in blueprint " << std::endl;
522 runtime_assert( cst_weight > 0.0 );
548 MakePolyXMover bap(
"ALA",
false,
true ,
false );
558 for(
Size i=1 ; i<=design_task->ncycle() ; i++ ){
560 TR <<
"current_cycle/total_cycle: " << i <<
"/" << design_task->ncycle() <<
" in DesignTask: " << num_task << std::endl;
564 PackerTaskOP task( TaskFactory::create_packer_task( pose ));
565 design_task->setup( pose, task );
566 design_task->dump_packertask(
TR );
569 runtime_assert( design_task->scorefxn() != 0 );
570 FlxbbDesignPack pack( design_task->scorefxn(), design_task->packertask(), design_task->filter_structs() );
573 TR <<
"Designed sequence: " << pose.
sequence() << std::endl;
574 TR <<
"Score after design by fixbb " << std::endl;
578 TR <<
"Design step was skipped. ";
582 if( design_task->mover() && !
no_relax_ ){
583 design_task->mover()->apply( pose );
584 TR <<
"Score after mover, " << design_task->mover()->type() << std::endl;
617 String const sfxn_design ( tag->getOption<
String>(
"sfxn_design",
"score12" ));
618 String const sfxn_relax ( tag->getOption<
String>(
"sfxn_relax",
"score12" ) );
623 if( blueprint !=
"" ){
637 Size filter_trial = tag->getOption<
Size>(
"filter_trial", 10 );
638 String filter_type = tag->getOption<
String>(
"filter_type",
"packstat" );
639 if( filter_trial > 0 && filter_type !=
"" ){
644 no_relax_ = tag->getOption<
bool>(
"no_relax", 0 );
645 bool movemap_defined(
false );
648 for( tag_it = branch_tags.begin(); tag_it!=branch_tags.end(); ++tag_it ){
649 if( (*tag_it)->getName() ==
"MoveMap" ){
650 movemap_defined =
true;
654 if( movemap_defined ){
659 no_design_ = tag->getOption<
bool>(
"no_design", 0 );
678 if( movemap_from_blueprint_ ){
679 TR <<
"Movemap is defined based on blueprint " << std::endl;
680 runtime_assert( blueprint !=
"" );