29 #include <basic/Tracer.hh>
37 #include <utility/string_util.hh>
38 #include <utility/tag/Tag.hh>
39 #include <utility/vector1.hh>
47 #include <utility/vector0.hh>
48 #include <ObjexxFCL/format.hh>
49 #include <basic/options/keys/OptionKeys.hh>
51 using namespace basic::options;
52 using namespace basic::options::OptionKeys;
56 static basic::Tracer
TR(
"protocols.toolbox.LayerOperations");
60 namespace task_operations {
64 LayerOperations::~LayerOperations() {}
74 LayerOperations::create_task_operation()
const
80 LayerOperations::LayerOperations():
82 pick_boundary_( false ),
83 pick_surface_( false ),
85 make_rasmol_format_file_( false )
93 pick_core_( pick_core ),
94 pick_boundary_( pick_boundary ),
95 pick_surface_( pick_surface ),
97 make_rasmol_format_file_( false )
105 pick_boundary_( false ),
106 pick_surface_( false ),
108 make_rasmol_format_file_( false )
114 if ( layer ==
"core" ) {
116 }
else if ( layer ==
"surface" ) {
118 }
else if ( layer ==
"boundary" ) {
121 TR <<
"Error!, wrong specification of layer_mode " << layer << std::endl;
122 runtime_assert(
false );
128 pick_core_( rval.pick_core_ ),
129 pick_boundary_( rval.pick_boundary_ ),
130 pick_surface_( rval.pick_surface_ ),
131 pore_radius_( rval.pore_radius_ ),
132 burial_( rval.burial_ ),
133 surface_( rval.surface_ ),
134 selected_core_residues_( rval.selected_core_residues_ ),
135 selected_boundary_residues_( rval.selected_boundary_residues_ ),
136 selected_surface_residues_( rval.selected_surface_residues_ ),
137 make_rasmol_format_file_( rval.make_rasmol_format_file_ ),
138 rsd_sasa_( rval.rsd_sasa_ ),
139 rsd_layer_( rval.rsd_layer_ )
151 runtime_assert( ss.length() == 1 );
152 runtime_assert( ss.at( 0 ) ==
'L' || ss.at( 0 ) ==
'E' || ss.at( 0 ) ==
'H' );
166 runtime_assert( ss.length() == 1 );
167 runtime_assert( ss.at( 0 ) ==
'L' || ss.at( 0 ) ==
'E' || ss.at( 0 ) ==
'H' );
176 surface_.insert( std::map< char, Real >::value_type(
'H', surface ) );
177 surface_.insert( std::map< char, Real >::value_type(
'L', surface ) );
178 surface_.insert( std::map< char, Real >::value_type(
'E', surface ) );
179 burial_.insert( std::map< char, Real >::value_type(
'H', burial ) );
180 burial_.insert( std::map< char, Real >::value_type(
'L', burial ) );
181 burial_.insert( std::map< char, Real >::value_type(
'E', burial ) );
233 for (
Size j = 1; j<=5; ++j ) {
235 atom_map.
set( atom,
true );
254 runtime_assert( pose.
total_residue() == secstruct.length() );
263 std::ofstream output;
265 output.open(
"srb.ras" ,std::ios::out );
284 for(
Size iaa=start_res; iaa<= end_res ; iaa++ ) {
286 char ss = secstruct.at( iaa-1 );
287 runtime_assert( ss ==
'L' || ss ==
'E' || ss==
'H' );
292 selected_residues.push_back( iaa );
295 output <<
"select " << iaa << std::endl;
296 output <<
"color blue " << std::endl;
302 selected_residues.push_back( iaa );
305 output <<
"select " << iaa << std::endl;
306 output <<
"color red " << std::endl;
312 selected_residues.push_back( iaa );
315 output <<
"select " << iaa << std::endl;
316 output <<
"color green " << std::endl;
322 return selected_residues;
328 bool is_part_of_this =
false;
330 if( i == pos ) is_part_of_this =
true;
331 return is_part_of_this;
337 using namespace core::pack::task::operation;
342 TR<<
"translating along jump #"<<
jump_<<std::endl;
360 if (!
is_part(selected_residues, res)) norepack_residues.push_back(res);
363 if(!
is_part(selected_residues, res)) repacking_residues.push_back(res);
367 if( repacking_residues.size() ){
369 oocr_repacking.residue_indices( repacking_residues );
370 oocr_repacking.apply( pose, task );
372 if( norepack_residues.size() ){
374 oocr_prevent_repacking.residue_indices( norepack_residues );
375 oocr_prevent_repacking.apply( pose, task );
391 String design_layers = tag->getOption<
String >(
"layer" );
394 design_ = tag->getOption<
bool > (
"design" , 1 );
396 repack_rest_ = tag->getOption<
bool >(
"repack_rest" , 1 );
398 chain_ = tag->getOption<
Size > (
"chain", 0 );
400 jump_ = tag->getOption<
Size > (
"jump", 0 );
408 if (
layer ==
"core" ) {
410 }
else if (
layer ==
"surface" ) {
412 }
else if (
layer ==
"boundary" ) {
413 dsgn_boundary =
true;
415 TR <<
"Error! wrong specification of layer_mode " <<
layer << std::endl;
416 TR <<
"All layers are designed. " << std::endl;
419 dsgn_boundary =
true;
423 srbl_->set_design_layer( dsgn_core, dsgn_boundary, dsgn_surface );
425 if( tag->hasOption(
"pore_radius" ) ) {
426 srbl_->pore_radius( tag->getOption<
Real >(
"pore_radius" ) );
429 if( tag->hasOption(
"core" ) ) {
430 srbl_->sasa_core( tag->getOption<
Real >(
"core" ) );
432 if( tag->hasOption(
"surface" ) ) {
433 srbl_->sasa_surface( tag->getOption<
Real >(
"surface" ) );
436 if( tag->hasOption(
"core_E" ) ) {
437 srbl_->sasa_core( tag->getOption<
Real >(
"core_E" ),
"E" );
439 if( tag->hasOption(
"core_L" ) ) {
440 srbl_->sasa_core( tag->getOption<
Real >(
"core_L" ),
"L" );
442 if( tag->hasOption(
"core_H" ) ) {
443 srbl_->sasa_core( tag->getOption<
Real >(
"core_H" ),
"H" );
446 if( tag->hasOption(
"surface_E" ) ) {
447 srbl_->sasa_surface( tag->getOption<
Real >(
"surface_E" ),
"E" );
449 if( tag->hasOption(
"surface_L" ) ) {
450 srbl_->sasa_surface( tag->getOption<
Real >(
"surface_L" ),
"L" );
452 if( tag->hasOption(
"surface_H" ) ) {
453 srbl_->sasa_surface( tag->getOption<
Real >(
"surface_H" ),
"H" );
456 if( tag->hasOption(
"make_rasmol_script" ) ) {
457 srbl_->make_rasmol_format_file( tag->getOption<
bool >(
"make_rasmol_script" ) );