44 #include <basic/options/option.hh>
67 #include <numeric/model_quality/rms.hh>
70 #include <basic/Tracer.hh>
73 #include <numeric/random/random.hh>
74 #include <utility/io/izstream.hh>
76 #include <ObjexxFCL/string.functions.hh>
85 #include <basic/options/keys/loops.OptionKeys.gen.hh>
89 #include <utility/vector1.hh>
90 #include <ObjexxFCL/format.hh>
97 using namespace ObjexxFCL;
98 using namespace ObjexxFCL::fmt;
100 namespace protocols {
104 using namespace core;
106 basic::Tracer
tt(
"protocols.loops.loops_main" );
107 static numeric::random::RandomGenerator
RG(31413);
111 std::vector< core::fragment::FragSetOP > & frag_libs
113 using namespace basic::options;
114 using namespace utility::file;
115 using namespace basic::options;
116 using namespace basic::options::OptionKeys;
117 using namespace core::fragment;
120 FileVectorOption frag_files( option[ OptionKeys::loops::frag_files ] );
122 if( frag_sizes.size() != frag_files.size() ){
123 utility_exit_with_message(
"You must specify as many fragment sizes as fragment file names " );
126 for (
Size i = 1; i <= frag_sizes.size(); ++i ) {
127 Size const frag_size =
Size(frag_sizes[i]);
131 tt.Error <<
"Frag libraries debug " << frag_files[i] <<
" " << frag_size << std::endl;
137 frag_libs.push_back(frag_lib_op);
140 Size prev_size(10000);
145 for ( std::vector< FragSetOP >::const_iterator
146 it = frag_libs.begin(),
147 it_end = frag_libs.end();
150 Size const frag_size( (*it)->max_frag_length() );
151 Size const n_frags( (*it)->size() );
153 if ( frag_size > prev_size ) {
156 msg +=
" frag_size = " + string_of( frag_size );
157 msg +=
" prev_size = " + string_of( prev_size );
158 msg +=
"\nFragment size must be given in order !!\n";
159 utility_exit_with_message( msg );
162 if ( (n_frags == 0) && prev_lib_op && (prev_lib_op->size() != 0) ) {
163 tt.Info <<
"Set up " << frag_size <<
"-mer library from " << prev_size <<
"-mer library" << std::endl;
167 prev_size = frag_size;
174 if( option[ OptionKeys::loops::stealfrags ].user() ){
178 for ( ; file_it != file_it_end; ++file_it ) {
184 for ( std::vector< FragSetOP >::const_reverse_iterator
185 it = frag_libs.rbegin(),
186 it_end = frag_libs.rend();
187 it != it_end; it++ ) {
188 tt.Info <<
"Stealing fragments from " << infile <<
" "
189 << option[ OptionKeys::loops::stealfrags_times ]() <<
" times" << std::endl;
191 for(
int c=0;
c< option[ OptionKeys::loops::stealfrags_times ]();
c++ ){
199 for ( std::vector< FragSetOP >::const_reverse_iterator
200 it = frag_libs.rbegin(),
201 it_end = frag_libs.rend();
202 it != it_end; it++ ) {
204 Size const frag_size( (*it)->max_frag_length() );
205 Size const n_frags( (*it)->size() );
206 tt.Info <<
"Fragment libraries: " << frag_size <<
" " << n_frags
218 std::vector< core::fragment::FragSetOP > temp_libs;
220 frag_libs.resize( temp_libs.size() );
221 for (
Size i = 1; i <= temp_libs.size(); ++i ) {
222 frag_libs[i] = temp_libs[i-1];
237 bool terminal_cutpoint
240 using namespace kinematics;
255 Loops tmp_loops = loops;
259 Size prev_interchain_jump = 0;
261 it_next; it != it_end; ++it ) {
265 bool is_lower_term = pose.
residue( it->start() ).is_lower_terminus();
266 bool is_upper_term = pose.
residue( it->stop() ).is_upper_terminus();
268 Size const jump_start =
269 ( is_lower_term ) ? it->start() : it->start() - 1;
270 Size const jump_stop =
271 ( is_upper_term ) ? it->stop() : it->stop() + 1;
272 Size const jump_cut = it->cut();
273 Size const jump_next_start =
274 ( it_next == it_end ) ? nres : it_next->start()-1;
277 if( it->start() == 1 ){
278 if ( ! terminal_cutpoint ) {
279 f.
add_edge( jump_start, jump_stop, Edge::PEPTIDE );
283 f.
add_edge( jump_start, jump_stop, jump_num );
284 f.
add_edge( jump_start, jump_cut, Edge::PEPTIDE );
285 f.
add_edge( jump_cut+1, jump_stop, Edge::PEPTIDE );
287 f.
add_edge( jump_stop, jump_next_start, Edge::PEPTIDE );
289 }
else if( it->stop() == nres ) {
290 if ( ! terminal_cutpoint ) {
291 f.
add_edge( jump_start, jump_stop, Edge::PEPTIDE );
295 f.
add_edge( jump_start, jump_stop, jump_num );
296 f.
add_edge( jump_start, jump_cut, Edge::PEPTIDE );
297 f.
add_edge( jump_cut+1, jump_stop, Edge::PEPTIDE );
300 }
else if ( is_lower_term ) {
302 if ( prev_interchain_jump > 0 ) {
304 f.
add_edge( prev_interchain_jump, jump_stop, jump_num );
307 f.
add_edge( jump_start-1, jump_stop, jump_num );
309 f.
add_edge( jump_start, jump_stop, Edge::PEPTIDE );
310 f.
add_edge( jump_stop, jump_next_start, Edge::PEPTIDE );
311 prev_interchain_jump = 0;
313 }
else if ( is_upper_term ) {
316 if ( it_next != it_end && it_next->start() == it->stop()+1) {
317 prev_interchain_jump = jump_start;
320 f.
add_edge( jump_start, jump_stop+1, jump_num );
321 f.
add_edge( jump_stop+1, it_next->start()-1, Edge::PEPTIDE );
323 f.
add_edge( jump_start, jump_stop, Edge::PEPTIDE );
329 f.
add_edge( jump_start, jump_stop, jump_num );
330 f.
add_edge( jump_start, jump_cut, Edge::PEPTIDE );
331 f.
add_edge( jump_cut+1, jump_stop, Edge::PEPTIDE );
333 f.
add_edge( jump_stop, jump_next_start, Edge::PEPTIDE );
336 if ( tmp_loops.size() > 0 ) {
337 Size const first_start =
338 ( tmp_loops.begin()->start() == 1 ) ? tmp_loops.begin()->start() : tmp_loops.begin()->start() - 1;
340 f.
add_edge( 1, first_start, Edge::PEPTIDE );
344 if( tmp_loops.begin()->start() == 1 &&
345 tmp_loops.begin()->stop() != nres )
346 root = tmp_loops.begin()->stop()+1;
354 while( nres < totres ) {
382 using namespace kinematics;
405 int newroot = f_in.root();
407 if( loop.
start() == 1 ) {
408 f.add_edge( 1, loop.
stop() + 1, Edge::PEPTIDE );
409 f.add_edge( loop.
stop() + 1, nres, Edge::PEPTIDE );
410 f.add_edge( loop.
stop() + 1, newroot, 1 );
411 }
else if ( loop.
stop() >= nres) {
412 f.add_edge( 1, nres, Edge::PEPTIDE );
413 f.add_edge( 1, newroot, 1 );
414 }
else if ( pose.
residue( loop.
start() ).is_lower_terminus() ) {
415 if (loop.
start()-1 != 1)
416 f.add_edge( 1, loop.
start() - 1, Edge::PEPTIDE );
417 f.add_edge( loop.
start(), nres, Edge::PEPTIDE );
418 f.add_edge( nres, newroot, 1 );
419 f.add_edge( 1, nres, 2 );
420 }
else if ( pose.
residue( loop.
stop() ).is_upper_terminus() ) {
421 f.add_edge( 1, loop.
stop(), Edge::PEPTIDE );
422 if (loop.
stop() + 1 != nres)
423 f.add_edge( loop.
stop() + 1, nres, Edge::PEPTIDE );
424 f.add_edge( 1, newroot, 1 );
425 f.add_edge( 1, nres, 2 );
429 if( jumppoint1 < 1 ) jumppoint1 = 1;
430 if( jumppoint2 > nres) jumppoint2 = nres;
433 f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
434 f.add_edge( jumppoint1, loop.
cut(), Edge::PEPTIDE );
435 f.add_edge( loop.
cut() + 1, jumppoint2, Edge::PEPTIDE );
436 if (jumppoint2 != nres)
437 f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
438 f.add_edge( 1, newroot, 1 );
439 f.add_edge( jumppoint1, jumppoint2, 2 );
442 if( f.reorder( newroot ) == false ){
443 tt.Error <<
"ERROR During reordering of fold tree - am ignoring this LOOP ! " << std::endl;
444 tt.Error <<
"Cutpoint chosen " << loop.
cut() << std::endl;
449 int newroot = (loop.
start() == 1) ? nres : 1;
450 if( loop.
start() == 1 || loop.
stop() == nres ) {
451 f.add_edge( 1, nres, Edge::PEPTIDE );
452 }
else if ( pose.
residue( loop.
start() ).is_lower_terminus() ) {
455 if ( loop.
start() > 1 ) {
456 f.add_edge( 1, loop.
start() - 1, Edge::PEPTIDE );
457 f.add_edge( loop.
start(), nres, Edge::PEPTIDE );
458 f.add_edge( 1, nres, 1 );
460 f.add_edge( 1, nres, Edge::PEPTIDE );
463 }
else if ( pose.
residue( loop.
stop() ).is_upper_terminus() ) {
466 if ( loop.
stop() < nres ) {
467 f.add_edge( 1, loop.
stop(), Edge::PEPTIDE );
468 f.add_edge( loop.
stop() + 1, nres, Edge::PEPTIDE );
469 f.add_edge( 1, nres, 1 );
471 f.add_edge( 1, nres, Edge::PEPTIDE );
477 if( jumppoint1 < 1 ) jumppoint1 = 1;
478 if( jumppoint2 > nres) jumppoint2 = nres;
480 f.add_edge( 1, jumppoint1, Edge::PEPTIDE );
481 f.add_edge( jumppoint1, loop.
cut(), Edge::PEPTIDE );
482 f.add_edge( loop.
cut() + 1, jumppoint2, Edge::PEPTIDE );
483 f.add_edge( jumppoint2, nres, Edge::PEPTIDE );
484 f.add_edge( jumppoint1, jumppoint2, 1 );
487 if( f.reorder( newroot ) == false ){
488 tt.Error <<
"ERROR During reordering of fold tree - am ignoring this LOOP ! " << std::endl;
489 tt.Error <<
"Cutpoint chosen " << loop.
cut() << std::endl;
495 Size jump_anchor = f.root();
496 while( nres < totres ) {
500 if ( nres != (
Size)f.root() )
501 f.add_edge( jump_anchor, nres, f.num_jump()+1 );
504 tt.Warning <<
"Pose fold tree " << f << std::endl;
519 Size const new_cutpoint,
521 Size const loop_begin,
525 using namespace chemical;
527 if ( f.is_cutpoint( new_cutpoint ) )
return;
531 for (
Size i=loop_begin-1; i<= loop_end; ++i ) {
532 if ( f.is_cutpoint( i ) ) {
533 if ( cut ) utility_exit_with_message(
"multiple cutpoints in single loop!" );
541 tt.Warning <<
"set_loop_cutpoint_in_pose_fold_tree: no cutpoint in loop, so adding new jump to foldtree between " <<
542 loop_begin-1 <<
" and " << loop_end +1 <<
" with cut at " << new_cutpoint << std::endl;
543 f.new_jump( loop_begin-1, loop_end+1, new_cutpoint );
545 f.slide_cutpoint( cut, new_cutpoint );
563 using namespace core::chemical;
564 bool pose_changed(
false );
612 if ( pose_changed ==
true ) pose.
constraint_set( init_pose.constraint_set()->remapped_clone( init_pose, pose ) );
623 using namespace core::chemical;
624 bool pose_changed(
false );
627 bool added_cutpoint_variant =
false;
632 added_cutpoint_variant =
true;
636 added_cutpoint_variant =
true;
639 if ( added_cutpoint_variant ) {
640 tt.Info <<
"Added cutpoint variants: RES: " << cutpoint << std::endl;
642 pose_changed = pose_changed || added_cutpoint_variant;
656 using namespace core::chemical;
658 bool changed(
false );
667 if ( changed ) pose.
constraint_set( init_pose.constraint_set()->remapped_clone( init_pose, pose ) );
686 bool const fix_template_sc,
691 using namespace core::id;
717 using namespace core::id;
718 using namespace basic::options;
719 using namespace basic::options::OptionKeys;
721 bool const allow_omega_move = basic::options::option[ OptionKeys::loops::allow_omega_move ].user();
722 bool const allow_takeoff_torsion_move = basic::options::option[ OptionKeys::loops::allow_takeoff_torsion_move ].user();
730 it != it_end; ++it ) {
732 for(
Size i=it->start(); i<=it->stop(); ++i ) {
738 if ( allow_takeoff_torsion_move ) {
740 if ( allow_omega_move ) mm.
set(
TorsionID( it->start()-1,
BB, 3 ),
true );
746 for (
Size i = 1; i <= allow_sc_move.size(); ++i ) {
747 mm.
set_chi(i, allow_sc_move[i] );
751 if ( basic::options::option[ OptionKeys::loops::allow_lig_move ]() ){
773 using namespace core::id;
774 using namespace basic::options;
775 using namespace basic::options::OptionKeys;
777 bool const allow_omega_move = basic::options::option[ OptionKeys::loops::allow_omega_move ].user();
778 bool const allow_takeoff_torsion_move = basic::options::option[ OptionKeys::loops::allow_takeoff_torsion_move ].user();
790 if ( allow_takeoff_torsion_move ) {
798 if (basic::options::option[ OptionKeys::loops::allow_lig_move ].user() ){
821 for(
Size i=(it->start()-flank_size); i<=(it->start()-1); i++){
825 for(
Size i=(it->stop()+1); i<=(it->stop()+flank_size); i++){
847 int const ccd_cycles = { 100 };
848 Real const ccd_tol = { 0.01 };
849 bool const rama_check = {
true };
850 Real const max_rama_score_increase = { 2.0 };
851 Real const max_total_delta_helix = { 10.0 };
852 Real const max_total_delta_strand = { 50.0 };
853 Real const max_total_delta_loop = { 75.0 };
855 Real forward_deviation, backward_deviation;
856 Real torsion_delta, rama_delta;
859 it != it_end; ++it ) {
860 Size const loop_begin = it->start();
861 Size const loop_end = it->stop();
862 Size const cutpoint = it->cut();
865 ccd_tol, rama_check, max_rama_score_increase, max_total_delta_helix,
866 max_total_delta_strand, max_total_delta_loop, forward_deviation,
867 backward_deviation, torsion_delta, rama_delta );
883 for (
Size i=1; i <= local_residue_positions.size(); ++i ) {
884 if ( ! local_residue_positions[i] )
continue;
887 it != current_node->const_edge_list_end(); ++it ) {
888 Size pos = (*it)->get_other_ind(i);
890 residue_positions[ pos ] =
false;
893 residue_positions[ pos ] =
true;
906 bool const include_neighbors,
912 it != it_end; ++it ) {
913 for(
Size i=it->start(); i<=it->stop(); ++i ) {
925 if ( neighbor_dist < 10.0 ) {
936 bool const include_neighbors,
960 for(
Size i=1; i<=map.size(); ++i ) {
961 if ( map[i] ==
false )
continue;
965 for (
Size j=it->start(); j<=it->stop(); ++j ) {
972 Real dist = scaffold_res_vec.distance( loop_res_vec );
973 if ( dist <= dist_cutoff ) {
1000 using namespace conformation;
1002 runtime_assert( mapping.
size1() == source_seq.size() && mapping.
size2() == target_seq.size());
1007 if ( source_seq != pose_seq ) {
1010 if ( pose_seq.find( source_seq ) == std::string::npos ) {
1011 tt <<
"src_seq: " << source_seq << std::endl <<
"pose_seq: " << pose_seq << std::endl;
1012 utility_exit_with_message(
"alignfile source sequence not contained in pose sequence" );
1014 Size const offset( pose_seq.find( source_seq ) );
1017 for (
Size i=1; i<= offset; ++i ) {
1024 source_nterm_seq += rsd.name1();
1026 bool const align_this_residue( !rsd.is_protein() );
1028 if ( align_this_residue ) {
1029 target_nterm_seq += rsd.name1();
1030 Size const target_pos( target_nterm_seq.size() );
1032 mapping[i] = target_pos;
1036 source_seq = source_nterm_seq + source_seq;
1037 target_seq = target_nterm_seq + target_seq;
1039 runtime_assert( pose_seq.find( source_seq ) == 0 );
1041 while( source_seq.size() < pose_seq.size() ) {
1042 runtime_assert( mapping.
size1() == source_seq.size() && mapping.
size2() == target_seq.size());
1044 Size const pos( source_seq.size() + 1 );
1047 char const n1( rsd.name1() );
1051 bool const align_this_residue( !rsd.is_protein() );
1052 if ( align_this_residue ) {
1055 mapping[pos] = target_seq.size();
1059 runtime_assert( pose_seq == source_seq );
1076 using namespace conformation;
1077 using namespace chemical;
1082 tt <<
"apply_sequence_mapping: start fold tree: " << pose.
fold_tree() << std::endl;
1091 for (
Size i=1; i<= nres; ++i ) {
1093 if ( seg_anchor[ segment ] == 0 ) {
1094 seg_anchor[ segment ] = i;
1098 seg_end.push_back( i );
1103 FArray2D_int jumps( 2, num_jump );
1104 FArray1D_int cuts ( num_jump );
1105 for (
Size i=1; i<= num_jump; ++i ) {
1106 jumps(1,i) = seg_anchor[1];
1107 jumps(2,i) = seg_anchor[i+1];
1108 cuts(i) = seg_end[i];
1113 runtime_assert( valid_tree );
1115 tt <<
"oldtree: " << pose.
fold_tree() << std::endl <<
"newtree: " << f << std::endl;
1122 tt <<
"start mapping: " << std::endl;
1130 for (
Size i=1; i<= mapping.
size1(); ++i ) {
1131 if ( !mapping[i] ) {
1143 for (
Size i=1; i<= mapping.
size1(); ++i ) {
1144 char const new_seq( target_seq[ mapping[i]-1 ] );
1160 runtime_assert( mapping[i] );
1161 if ( mapping[i+1] != mapping[i]+1 && !f.is_cutpoint(i) ) {
1162 f.new_jump( i, i+1, i );
1169 tt <<
"FOldtree: " << f << std::endl;
1170 runtime_assert( f.check_fold_tree() );
1176 while ( mapping[ 1 ] != 1 ) {
1177 int const aligned_pos( mapping[1] - 1 );
1178 char const new_seq( target_seq[ aligned_pos-1 ] );
1180 ResidueOP new_rsd( ResidueFactory::create_residue( *new_rsd_type ) );
1186 while ( mapping[ mapping.
size1() ] != mapping.
size2() ) {
1187 int const seqpos( mapping.
size1() + 1 );
1188 int const aligned_pos( mapping[seqpos-1] + 1 );
1189 char const new_seq( target_seq[ aligned_pos-1 ] );
1191 ResidueOP new_rsd( ResidueFactory::create_residue( *new_rsd_type ) );
1202 runtime_assert( mapping[cutpoint] == cutpoint );
1204 if ( pose.
chain( cutpoint ) != pose.
chain( cutpoint+1 ) &&
1206 utility_exit_with_message(
"dont know whether to add residues before or after the cutpoint between chains!" );
1208 int const aligned_pos( cutpoint+1 );
1209 char const new_seq( target_seq[ aligned_pos - 1 ] );
1211 ResidueOP new_rsd( ResidueFactory::create_residue( *new_rsd_type ) );
1222 utility_exit_with_message(
"dont know how to add non-protein residues!" );
1224 tt.Trace <<
"added residue " << cutpoint+1 <<
' ' << pose.
fold_tree();
1230 if ( pose.
chain(cutpoint) == pose.
chain(cutpoint+1) ) {
1235 tt.Warning <<
"Same-chain junction between protein and non-protein!" << std::endl;
1242 runtime_assert( pose.
sequence() == target_seq );
1255 Size const min_loop_size
1262 for (
Size r=1; r<= 2; ++r ) {
1263 runtime_assert( s1.size() == mapping.
size1() && s2.size() == mapping.
size2() );
1266 for (
Size i=2; i<= mapping.
size1(); ++i ) {
1267 if ( mapping[i-1] && !mapping[i] ) {
1271 for ( ; j<= mapping.
size1() && !mapping[j]; ++j ) {};
1273 if ( j > mapping.
size1() ) {
1275 runtime_assert( j == mapping.
size1()+1 );
1276 Size loop_begin( i );
1277 Size loop_size( mapping.
size1() - i + 1 );
1278 while ( mapping[ loop_begin-2 ] && loop_size < min_loop_size ) {
1279 runtime_assert( !mapping[ loop_begin ] );
1280 runtime_assert( mapping[ loop_begin-1 ] );
1282 mapping[ loop_begin ] = 0;
1284 tt.Trace <<
"trimming back c-terminal loop! from " << i <<
" to " << loop_begin << std::endl;
1289 Size loop_begin( i ), loop_end( j-1 );
1291 runtime_assert( !mapping[ loop_begin ] && !mapping[ loop_end ] );
1292 runtime_assert( mapping[ loop_begin-1 ] && mapping[ loop_end + 1 ] );
1293 Size const size1( loop_end - loop_begin + 1 );
1294 Size const size2( mapping[ loop_end+1 ] - mapping[ loop_begin-1 ] - 1 );
1295 Size const min_size( std::min( size1, size2 ) );
1297 tt.Trace <<
"loopseq: " << s1.substr(loop_begin-1,size1) << std::endl;
1298 if ( min_size >= min_loop_size )
break;
1300 bool const safe_to_trim_backward( loop_begin > 2 && mapping[ loop_begin-2 ] );
1301 bool const safe_to_trim_forward ( loop_end <= mapping.
size1()-2 && mapping[ loop_end+2 ] );
1302 if ( safe_to_trim_forward && ( numeric::random::uniform() < 0.5 || !safe_to_trim_backward ) ) {
1303 tt.Trace <<
"trimming forward " << loop_begin <<
' ' << loop_end <<
' ' << std::endl;
1305 mapping[ loop_end ] = 0;
1306 }
else if ( safe_to_trim_backward ) {
1307 tt.Trace <<
"trimming backward " << loop_begin <<
' ' << loop_end <<
' ' << std::endl;
1309 mapping[ loop_begin ] = 0;
1311 tt.Warning <<
"Unable to extend loop to meet criteria! " << loop_begin <<
' ' << loop_end <<
' '<<
1312 mapping[ loop_begin-1 ] <<
' ' << mapping[ loop_end+1 ] << std::endl;
1316 tt.Trace <<
"finalloopseq: " << s1.substr(loop_begin-1,loop_end-loop_begin+1) <<
' ' << loop_begin <<
' ' <<
1318 if ( r==1 )
tt.Trace <<
" source_insert" << std::endl;
1319 else tt.Trace <<
" target_insert" << std::endl;
1343 if( secstructs.size() == 0 ){
1348 tt <<
"set_secstruct for pose: ";
1349 for (
Size i = 1, iend=secstructs.size(); i <= iend; ++i ) {
1355 tt <<
"set pose secstruct from psipred_ss2 file succesfully " << std::endl;
1374 utility::io::izstream data( filename );
1376 tt <<
"can not open DSSP file " << filename << std::endl;
1386 while( getline( data, line ) ) {
1387 std::istringstream line_stream( line );
1389 line_stream >> dummy;
1390 if ( dummy ==
'#')
break;
1394 while( getline( data, line ) ) {
1395 std::istringstream line_stream( line );
1399 line_stream.ignore( 13 );
1400 line_stream.get( aa );
1401 line_stream.ignore( 2 );
1402 line_stream.get( sec );
1404 if ( aa ==
'!' )
continue;
1411 <<
" vs " << aa <<
" at seqpos " << count << std::endl;
1421 secstructs.push_back(
'E' );
1422 }
else if ( sec ==
'H' || sec ==
'I' || sec ==
'G' ) {
1423 secstructs.push_back(
'H' );
1425 secstructs.push_back(
'L' );
1429 runtime_assert( secstructs.size() == pose.
total_residue() );
1430 tt.Trace <<
"set_secstruct for pose: ";
1431 for (
Size i = 1, iend=secstructs.size(); i <= iend; ++i ) {
1435 tt.Trace << std::endl;
1437 tt.Trace <<
"set pose secstruct from DSSP file succesfully " << std::endl;
1450 for(
Size i = (
Size)std::max((
int)1,(
int)loop.
start()); i <= loop.
stop(); ++i ) {
1464 tt.Error <<
"USING A DEPRECATED FUNCTION!( loops::set_extended_torsions(...) ) " << std::endl;
1466 Real const init_phi ( -150.0 );
1467 Real const init_psi ( 150.0 );
1468 Real const init_omega( 180.0 );
1470 static int counter = 0;
1472 tt.Debug <<
"Extending loop " << loop.
start() <<
" " << loop.
stop() << std::endl;
1478 for(
Size i = start_extended; i <= end_extended; ++i ) {
1479 if( i != start_extended ) pose.
set_phi( i, init_phi );
1480 if( i != end_extended ) pose.
set_psi( i, init_psi );
1481 if( ( i != start_extended ) && ( i != end_extended ) ) pose.
set_omega( i, init_omega );
1498 if ( cutpoint== 0 ) cutpoint = (loop.
start() + loop.
stop()) / 2;
1514 std::vector< core::Size > residue_exclusion;
1518 ir <= loops[i].stop();
1520 residue_exclusion.push_back( ir );
1525 std::list< core::Size > residue_selection;
1529 bool exclude =
false;
1530 for(
core::Size p = 0; p < residue_exclusion.size(); p++ ){
1531 if( ir == residue_exclusion[p] ){
1536 if( !exclude ) residue_selection.push_back( ir );
1539 corelength = residue_selection.size();
1540 if ( corelength == 0 )
return 0.0;
1557 Loops const & loops,
1576 Loops const & loops,
1591 atom_map.
set(id1, id2);
1610 Loops const & loops,
1623 if ( nnonvrt_1 != nnonvrt_2 )
1624 utility_exit_with_message(
"Error in loop_rmsd: pose1.total_residue() != pose2.total_residue() ( "
1625 + string_of( nnonvrt_1 ) +
"!=" + string_of( nnonvrt_2 )+
")" );
1631 it != it_end; ++it ) {
1632 for (
Size i = it->start(); i<=it->stop(); ++i ) {
1634 tt.Warning <<
"[Warning]: Pose1: Loop residue " << i <<
"exceeds pose1 size " << pose1.
total_residue() << std::endl;
1638 tt.Warning <<
"[Warning]: Pose1: Loop residue " << i <<
"exceeds pose2 size " << pose2.
total_residue() << std::endl;
1647 for (
Size j = start; j <=
end; ++j ) {
1650 tt.Warning <<
"[Warning]: Pose1: Atom " << j <<
" missing from residue " << i << std::endl;
1654 tt.Warning <<
"[Warning]: Pose2: Atom " << j <<
" missing from residue " << i << std::endl;
1662 return atom_count==0 ? 0.0 : std::sqrt(rms/atom_count);
1685 it != it_end; ++it ) {
1686 int natoms = 4 * it->size() ;
1689 FArray2D< core::Real > p1a(3, natoms);
1690 FArray2D< core::Real > p2a(3, natoms);
1693 for (
Size i = it->start(); i<=it->stop(); ++i ) {
1694 for (
Size j = 1; j <= 4; ++j ) {
1698 for (
int k = 0; k < 3; ++k ) {
1699 p1a(k+1,atom_count) = vec1[k];
1700 p2a(k+1,atom_count) = vec2[k];
1704 rms += numeric::model_quality::rms_wrapper( natoms, p1a, p2a );