38 #include <basic/Tracer.hh>
44 #include <basic/options/keys/remodel.OptionKeys.gen.hh>
45 #include <basic/options/option.hh>
52 #include <numeric/random/random.hh>
57 #include <utility/vector1.hh>
74 static basic::Tracer
TR(
"protocols.forge.methods.util" );
75 static numeric::random::RandomGenerator
RG( 2211990 );
95 assert( left <= right );
98 assert( right <= uf.
n_nodes() );
100 for (
Size i = left; i <= right; ++i ) {
122 for (
Size i = left; i <= right; ++i ) {
123 if ( ft.is_cutpoint( i ) && i < pose.
n_residue() &&
152 for (
Size i = left; i <= right; ++i ) {
153 if ( ft.is_cutpoint( i ) && i < pose.
n_residue() &&
175 for (
Size i = left; i <= right; ++i ) {
229 if ( !mm.get_bb( i ) ) {
230 fixed_bb.push_back( i );
234 if ( fixed_bb.size() == 0 ) {
237 root = fixed_bb[
RG.random_range( 1, fixed_bb.size() ) ];
244 std::set< Size > lower_termini;
245 std::set< Size > upper_termini;
253 Loop const & loop = *i;
255 if ( lower_termini.find( loop.
start() ) == lower_termini.end() && upper_termini.find( loop.
stop() ) == upper_termini.end() ) {
256 ft.new_jump( loop.
start() - 1, loop.
stop() + 1, loop.
cut() );
293 using namespace core::pack::task;
294 using namespace core;
295 istringstream resfile(resfile_string);
297 bool have_read_start_token =
false;
316 Size ntokens( tokens.size() );
317 if ( ntokens == 0 )
continue;
320 if ( have_read_start_token ) {
321 Size which_token = 1;
331 if ( isalpha( *PDBnum_token.rbegin() ) ) {
333 if ( std::isalpha( *PDBnum_token.rbegin() ) ) {
335 PDBnum = atoi( PDBnum_token.substr( 0, PDBnum_token.length() - 1 ).c_str() );
336 icode = *PDBnum_token.rbegin();
338 PDBnum = atoi( PDBnum_token.c_str() );
342 chain =
get_token( which_token, tokens )[ 0 ];
343 if (chain ==
'_') chain =
' ';
348 resid = pose.
pdb_info()->pdb2pose().find( chain, PDBnum, icode );
355 std::stringstream err_msg;
356 err_msg <<
"On line " << lineno <<
", the pose does not have residue (" << chain <<
", " << PDBnum <<
").";
359 non_default_lines[ resid ] =
true;
361 while ( which_token <= ntokens ) {
363 if ( command_map.find(
get_token( which_token, tokens ) ) == command_map.end() ) {
364 std::stringstream err_msg;
365 err_msg <<
"On line " << lineno <<
" command '" <<
get_token( which_token, tokens) <<
"' is not recognized.";
374 command->initialize_from_tokens( tokens, which_token, resid );
375 command->residue_action( the_task, resid );
378 while( which_token <= ntokens && command_map.find(
get_token(which_token, tokens ) ) == command_map.end() )
386 if (
get_token( 1, tokens) ==
"START" ) {
387 have_read_start_token =
true;
389 for (
Size ii = 1; ii <= ntokens; ++ii ) {
391 default_tokens.push_back(
get_token( ii, tokens ) );
392 origin_lines_of_default_tokens.push_back( lineno );
399 if ( ! have_read_start_token ) {
400 T(
"core.pack.task.ResfileReader") <<
"RESFILE WARNING: reached the end of resfile without finding a 'start' token." << std::endl;
401 T(
"core.pack.task.ResfileReader") <<
"RESFILE WARNING: No residue-specific behavior specified in resfile" << std::endl;
404 return non_default_lines;
449 if (!basic::options::option[basic::options::OptionKeys::remodel::design::allow_rare_aro_chi].user()){
450 TF->push_back(
new LimitAromaChi2Operation() );
461 using namespace core::id;
462 using namespace core::conformation;
463 using namespace core::scoring::constraints;
470 std::set<core::Size> loopRange;
482 if (loopRange.find(i) != loopRange.end()){
488 for (
core::Size ii = 1; ii <= i_rsd.nheavyatoms(); ++ii) {
497 using namespace core;
514 using namespace core;
515 using namespace core::pose;
516 using namespace core::scoring::constraints;
517 using namespace chemical;
521 for(
Size i = 1; i <=
N; ++i) {
594 using namespace core::scoring::constraints;