53 #include <utility/string_util.hh>
55 #include <basic/Tracer.hh>
69 #include <utility/tag/Tag.hh>
70 #include <utility/tag/Tag.fwd.hh>
75 #include <utility/vector1.hh>
77 #include <utility/excn/Exceptions.hh>
78 #include <boost/foreach.hpp>
80 #define foreach BOOST_FOREACH
83 using namespace protocols::seeded_abinitio;
84 static basic::Tracer
TR(
"protocols.seeded_abinitio.CloseFold" );
88 namespace seeded_abinitio {
90 using namespace protocols::moves;
94 CloseFoldCreator::keyname()
const
96 return CloseFoldCreator::mover_name();
100 CloseFoldCreator::create_mover()
const {
105 CloseFoldCreator::mover_name()
111 CloseFold::~CloseFold() {}
113 CloseFold::CloseFold() :
187 Size position = (*i)->start();
201 bool use_seeds = seeds.
size() > 0;
202 Size end = offset + secstruct.length() - 1;
214 for (
Size i = 1; i <= chain_ends.size(); ++i )
215 TR <<
"chain endings: " << chain_ends[i] <<std::endl;
218 for(
Size cut_it = 1; cut_it <= cutpoints.size(); ++ cut_it ){
219 TR.Debug <<
"cutpoints of current foldtree: "<< cutpoints[cut_it] <<std::endl;
221 for(
Size ends_it = 1; ends_it <= chain_ends.size(); ++ends_it ){
222 if( (cutpoints[cut_it] != chain_ends[ends_it]) && (cutpoints[cut_it] <=
end ) && ( cutpoints[cut_it] >= offset) ){
223 adjusted_cutpoints.push_back( cutpoints[cut_it] );
224 TR <<
"adjusted cutpoint "<< cutpoints[cut_it] << std::endl;
233 TR <<
"sec. strc: "<< secstruct <<std::endl;
238 for(
Size ss_i = 0; ss_i < secstruct.length() ; ++ss_i ){
239 ss = secstruct[ss_i];
245 individual_loop.push_back( ss_i + offset );
249 individual_loop.push_back( ss_i + offset );
251 TR.Debug <<
"use cutpoint " <<
use_cutpoints_ <<
" cut: " << cut <<
" iterator with offset: " << ss_i + offset <<std::endl;
254 TR <<
"cut: " << cut << std::endl;
263 TR <<
"adding chainbreak type"<< std::endl;
268 if( individual_loop.size() > 0 ){
270 TR.Debug <<
"selecting loop with cutpoint only" << std::endl;
271 found_loops.
add_loop( individual_loop[1], individual_loop[individual_loop.size()], cut , 0, false );
274 TR.Debug <<
"not using cutpoint " << std::endl;
275 found_loops.
add_loop( individual_loop[1], individual_loop[individual_loop.size()], cut , 0, false );
278 individual_loop.clear();
283 TR <<
"loop return: " << found_loops << std::endl;
291 bool res_cut =
false;
301 using namespace protocols::loops;
306 for (
Loops::iterator it=loops->v_begin(), it_end=loops->v_end(); it != it_end; ++it ) {
307 Loop buildloop( *it );
312 bool chainbreak_present =
true;
313 if ( chainbreak_present ) {
314 std::cout<<
"start fast ccd closure " << std::endl;
326 lr_mover->loops( loops );
327 lr_mover->remodel(
"perturb_kic" );
329 lr_mover->rebuild_filter( 999 );
330 lr_mover->n_rebuild_tries(
trials() );
331 lr_mover->copy_sidechains(
true );
333 lr_mover->apply( pose );
341 using namespace protocols::loops;
347 ccd_closure->remodel(
"quick_ccd");
348 ccd_closure->intermedrelax(
"no");
349 ccd_closure->refine(
"no");
350 ccd_closure->relax(
"no");
351 ccd_closure->loops( loops );
353 ccd_closure->n_rebuild_tries(
trials() );
354 ccd_closure->copy_sidechains(
true );
359 ccd_closure->frag_libs(fragments);
365 TR <<
"current loop-based foldtree: " << looptree << std::endl;
366 ccd_closure->apply(pose);
383 TR <<
"residues to compare: "<<residues <<std::endl;
386 TR <<
"residues " <<residues <<
" ss assignment: "<<
secstructure_.length();
389 TR.Debug <<
"residues vs " <<residues <<
" ss assignment: "<<
secstructure_.size() << std::endl;;
390 utility_exit_with_message(
"input residues under considerations do not agree with the number of secondary strcutres assignments");
400 TR.Debug <<
"secstr lenght: " <<
secstructure_.length() <<
" stop: " << stop_res <<
" start: " << start_res << std::endl;
401 utility_exit_with_message(
"secondary structure length does not equal the start and stop of the chain!!!" );
406 TR.Debug <<
"start searching: "<<start_res <<
" stop searching: " << stop_res <<std::endl;
408 TR <<
"loops " << *
loops_ <<std::endl;
416 TR <<
"no loop closure protocol specified " << std::endl;
433 TR<<
"CloseFold has been instantiated"<<std::endl;
439 if( tag->hasOption(
"fragments")){
440 string fragments_file = tag->getOption<
string>(
"fragments");
441 fragments_ = FragmentIO().read_data(fragments_file);
444 if( !tag->hasOption(
"fragments"))
445 throw utility::excn::EXCN_RosettaScriptsOption(
"need to supply fragments...currently still not accessing the general fragment pool" );
449 data.
add(
"loops",
"found_loops",
loops_ );
463 kic_ = tag->getOption<
bool > (
"use_kic" , 0 );
464 idealize_ = tag->getOption<
bool >(
"idealize" , 1 );
466 ccd_ = tag->getOption<
bool >(
"use_ccd", 1 );
471 if( tag->hasOption(
"secstrct") ){
473 TR<<
"getting secstructure from a string" <<std::endl;
476 TR<<
"extracting secondary structure from input pose" <<std::endl;
480 if( tag->hasOption(
"template_pdb" ) ){
484 TR<<
"read in a template pdb with " <<
template_pdb_->total_residue() <<
"residues"<<std::endl;
493 if( tag->hasOption(
"chain_num" ) ){
494 TR<<
"NOTE: chains have to be consecutive" << std::endl;
499 std::istringstream ss( key );
502 TR<<
"adding chain "<<key<<std::endl;
511 TR<<
"no chains specified, defaulting to use the last chain: "<< chain << std::endl;
517 foreach(
TagPtr const btag, branch_tags ){
519 if( btag->getName() ==
"Seeds" ) {
523 std::pair <std::string,std::string> seedpair;
524 seedpair.first = beginS;
525 TR.Debug <<
"parsing seeds: " << beginS <<
" " <<endS <<std::endl;
526 seedpair.second = endS;