32 #include <basic/options/option.hh>
33 #include <basic/Tracer.hh>
34 #include <boost/foreach.hpp>
35 #define foreach BOOST_FOREACH
38 #include <utility/exit.hh>
39 #include <utility/io/izstream.hh>
40 #include <utility/string_util.hh>
41 #include <utility/tag/Tag.hh>
44 #include <basic/resource_manager/ResourceManager.hh>
47 #include <basic/options/keys/packing.OptionKeys.gen.hh>
49 #include <utility/vector0.hh>
50 #include <utility/vector1.hh>
59 using basic::t_warning;
62 static basic::Tracer
TR(
"core.pack.task.operation.TaskOperations",t_info);
63 using namespace utility::tag;
126 include_residue( tag->getOption<
core::Size >(
"resnum", 0 ) );
172 using namespace chemical;
175 foreach(
char const c, keep ){
180 TR <<
"aa letter " << c <<
" does not not correspond to a canonical AA"<<std::endl;
215 allowed_aas_( invert_vector( disallowed_aas_ ) )
219 disallowed_aas_( disallowed_aas ),
220 allowed_aas_( invert_vector(disallowed_aas) )
224 residue_selection_( res_selection ),
225 disallowed_aas_( disallowed_aas ),
226 allowed_aas_( invert_vector(disallowed_aas) )
252 inverted_vec.push_back( ! disallowed_aas[ii] );
278 using namespace chemical;
280 for ( std::string::const_iterator it( aa_string.begin() ),
end( aa_string.end() );
285 std::ostringstream os;
286 os <<
"aa letter " << *it <<
" does not not correspond to a canonical AA";
287 utility_exit_with_message( os.str() );
300 for(
core::Size ii=1; ii<=residues.size(); ii++)
320 sample_level_( sample_level )
343 restask.or_include_current(
false );
454 ex1aro_exposed_(false),
455 ex2aro_exposed_(false),
483 ex1_ = tag->getOption<
bool>(
"ex1",
false);
484 ex2_ = tag->getOption<
bool>(
"ex2",
false);
485 ex3_ = tag->getOption<
bool>(
"ex3",
false);
486 ex4_ = tag->getOption<
bool>(
"ex4",
false);
487 ex1aro_ = tag->getOption<
bool>(
"ex1aro",
false);
488 ex2aro_ = tag->getOption<
bool>(
"ex2aro",
false);
512 res_task.or_ex2(
ex2_);
513 res_task.or_ex3(
ex3_);
514 res_task.or_ex4(
ex4_);
540 resfile_filename_( filename )
558 using namespace basic::resource_manager;
559 using namespace basic::options;
560 using namespace basic::options::OptionKeys;
564 if ( ResourceManager::get_instance()->has_option( packing::resfile ) || option[ packing::resfile ].user() ) {
565 parse_resfile(pose, task, ResourceManager::get_instance()->get_option( packing::resfile )[ 1 ] );
577 using namespace basic::resource_manager;
578 using namespace basic::options;
579 using namespace basic::options::OptionKeys;
580 if ( ResourceManager::get_instance()->has_option( packing::resfile ) || option[ packing::resfile ].user() ) {
581 resfile_filename_ = ResourceManager::get_instance()->get_option( packing::resfile )[ 1 ];
620 apply_default_commands_to_inserts_(false)
625 apply_default_commands_to_inserts_(false)
665 for(
Size i =1; i <= events.size(); ++i ){
675 utility::io::izstream file( this->
filename() );
676 if (!file ) utility_exit_with_message(
"Cannot open file " + this->
filename() );
677 utility::slurp( file, resfile_string );
678 std::istringstream resfile(resfile_string);
684 Size ii_resfile_seqpos( (*fullsmap)[ii] );
688 std::list< ResfileCommandCOP >
const & ii_command_list( this->
resfile_commands( ii_resfile_seqpos, contents, ptask) );
690 for ( std::list< ResfileCommandCOP >::const_iterator
691 iter = ii_command_list.begin(), iter_end = ii_command_list.end();
692 iter != iter_end; ++iter ) {
693 (*iter)->residue_action( ptask, ii );
703 if ( tag->hasOption(
"default_commands_for_inserts") )
709 std::list< ResfileCommandCOP >
const &
715 if( (resfile_seqpos == 0) || ( resfile_seqpos > ptask.
total_residue()) ){
734 rotamer_couplings_( src.rotamer_couplings_ )
777 rotamer_links_( src.rotamer_links_ )
812 : rotamer_operation_(0)
819 : rotamer_operation_( rotamer_operation )
823 :
parent(), rotamer_operation_( src.rotamer_operation_ )
854 : rotamer_set_operation_(0)
861 : rotamer_set_operation_( rotamer_set_operation )
865 :
parent(), rotamer_set_operation_( src.rotamer_set_operation_ )
898 rotamer_set_operation_(0)
907 rotamer_set_operation_( rotamer_set_operation )
912 resnum_( src.resnum_ ),
913 rotamer_set_operation_( src.rotamer_set_operation_ )
983 residues_to_prevent.insert(residues_to_prevent.end(),res.begin(),res.end());
1008 parent(), YSresids_( src.YSresids_ ), gly_switch_( src.gly_switch_ )
1081 TR <<
"Enabling extra rotamers for chi " <<
chi_ <<
" at all positions" << std::endl;
1094 if ( tag->hasOption(
"resid") ) {
1100 if ( ! tag->hasOption(
"chi") ) {
1101 utility_exit_with_message(
"ExtraRotamers Task Operation requires the chi option");
1105 utility_exit_with_message(
"ExtraRotamers Task Operation given a value for chi outside of legal range 1-4. Given value of " + utility::to_string(
chi_) );
1107 if ( tag->hasOption(
"level") ) {
1110 utility_exit_with_message(
"ExtraRotamers Task Operation gien a value for level outside of legal range 1-" + utility::to_string(
core::Size(
ExtraRotSampleCardinality ) ) +
". Given value of " + utility::to_string(
level_ ) );
1124 extrachi_cutoff_( extrachi_cutoff )
1146 TR <<
"Enabling extrachi cutoff at all positions" << std::endl;
1155 if ( tag->hasOption(
"resid") ) {
1161 if ( ! tag->hasOption(
"extrachi_cutoff") ) {
1162 utility_exit_with_message(
"ExtraChiCutoff Task Operation requires the extrachi_cutoff option");