36 #include <basic/Tracer.hh>
41 #include <ObjexxFCL/string.functions.hh>
42 #include <ObjexxFCL/format.hh>
44 #include <ObjexxFCL/FArray1D.hh>
45 #include <ObjexxFCL/FArray2D.hh>
48 #include <utility/exit.hh>
65 static basic::Tracer
TR(
"protocols.swa.rna.stepwise_rna_jobparameter_setup" ) ;
78 Size const & user_specified_cutpoint_closed ):
79 moving_res_( moving_res_list[1] ),
80 moving_res_list_( moving_res_list ),
81 cutpoint_open_( cutpoint_open ),
82 is_cutpoint_( full_sequence.
size(), false ),
84 filter_user_alignment_res_(true),
85 allow_chain_boundary_jump_partner_right_at_fixed_BP_(false),
86 allow_fixed_res_at_moving_res_(false),
87 simple_append_map_(false),
88 skip_complicated_stuff_(false)
96 if (
cutpoint_open_[ n ] == user_specified_cutpoint_closed ) utility_exit_with_message(
"Position cannot be both cutpoint_open and user_specified_cutpoint_closed" );
101 if ( user_specified_cutpoint_closed > 0 ) {
103 cutpoint_closed_list.push_back(user_specified_cutpoint_closed);
113 std::cout <<
"moving_res= " <<
moving_res_ << std::endl;
116 input_res_vectors.push_back( input_res );
117 input_res_vectors.push_back( input_res2 );
138 using namespace core::pose;
139 using namespace core::kinematics;
140 using namespace core::chemical;
174 if(working_best_alignment.size()>0){
192 if(working_best_alignment.size()!=0){
193 utility_exit_with_message(
" empty_working_best_alignment.size()!=0" );
198 if(alignment_res_string_list.size()==0){
199 std::cout <<
"WARNING: alignment_res_string_list.size()==0. EARLY RETURN AN EMPTY LIST" << std::endl;
200 return working_best_alignment;
205 utility_exit_with_message(
"need to called set_fixed_res before calling set_alignment_res" );
212 for(
Size n=1; n<=alignment_res_string_list.size(); n++){
219 for(
Size ii=1; ii<=alignments_res_string.size(); ii++){
220 alignment_res.push_back(
string_to_int( alignments_res_string[ii] ) );
227 for(
Size ii=1; ii<=alignment_res.size(); ii++){
228 Size seq_num=alignment_res[ii];
234 ObjexxFCL::FArray1D< bool >
const & partition_definition =
job_parameters_->partition_definition();
235 bool contain_non_root_partition_seq_num=
false;
236 for(
Size ii=1; ii<working_alignment.size(); ii++){
237 if( partition_definition( working_alignment[ii] ) != partition_definition( root_res ) ) contain_non_root_partition_seq_num=
true;
240 if(contain_non_root_partition_seq_num==
true)
continue;
248 if( working_alignment.size()>working_best_alignment.size() ) working_best_alignment=working_alignment;
260 return working_best_alignment;
269 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::figure_out_best_working_alignment. no user specified alignment, have to figure this out internally");
273 ObjexxFCL::FArray1D< bool >
const & partition_definition =
job_parameters_->partition_definition();
274 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
277 bool const root_partition = partition_definition( fold_tree.
root() );
282 for (
Size n=1; n <= working_fixed_res.size(); n++){
283 Size seq_num=working_fixed_res[n];
284 if ( partition_definition( seq_num ) == root_partition ) {
285 working_alignment.push_back(seq_num);
292 if(working_alignment.size()==0 ){
298 std::cout <<
" special case of building loop outward...no fixed element. " << std::endl;
302 for(
Size full_seq_num=1; full_seq_num<=is_working_res.size(); full_seq_num++){
303 if(is_working_res[full_seq_num]==
false)
continue;
305 Size const seq_num=full_to_sub[full_seq_num];
306 working_alignment.push_back(seq_num);
317 utility_exit_with_message(
"job_parameters_->working_best_alignment().size()==0" );
327 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::figure_out_working_sequence_and_mapping");
332 Size const nres( full_sequence.size() );
339 for (
Size i = 1; i <= input_res_vectors.size(); i++ ){
340 for (
Size n = 1; n <= input_res_vectors[i].size(); n++ ){
341 is_working_res[ input_res_vectors[i][ n ] ] = i;
351 std::map< core::Size, core::Size > full_to_sub;
355 for (
Size i = 1; i <= full_sequence.size(); i++ ) {
356 if ( is_working_res[ i ] ) {
358 full_to_sub[ i ] = count;
374 job_parameters_->set_working_moving_res_list( working_moving_res_list );
395 using namespace ObjexxFCL;
400 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
403 if(is_working_res[seq_num]==
false){
405 utility_exit_with_message(
"In Is_residue_prependable function. Input seq_num: " + string_of(seq_num) +
" is not a element of moving_res_list_");
409 Size cur_seq_num=seq_num;
413 if(cur_seq_num < 1)
break;
415 if(seq_num == total_residues )
break;
417 if(is_working_res[cur_seq_num]==
false)
break;
419 if( cur_seq_num!=seq_num &&
is_cutpoint_( cur_seq_num - 1 ) )
break;
432 if(fold_tree.num_cutpoint()==0){
437 if(full_to_sub[cur_seq_num]==1)
return true;
448 if(cur_seq_num > total_residues)
break;
450 if(seq_num == 1 )
break;
452 if(is_working_res[cur_seq_num]==
false)
break;
454 if(
is_cutpoint_(cur_seq_num) && cur_seq_num!=seq_num)
break;
467 if(fold_tree.num_cutpoint()==0){
468 if( working_fixed_res.size()!=0) utility_exit_with_message(
"fold_tree.num_cutpoint()==0 but fixed_res_.size()!=0 !!" );
470 if(full_to_sub[cur_seq_num]!=1)
return false;
479 std::cout <<
"Error: Figure_out_Is_residue_prepend, residue seq_num: " << seq_num << std::endl;
480 std::cout <<
"Cannot attach residue by either prepending and appending!" << std::endl;
490 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::figure_out_Is_residue_prepend_map");
494 std::map< core::Size, bool > Is_prepend_map;
498 std::cout <<
"WARNING using simple_append_map!" << std::endl;
501 for(
Size n=1; n<=rmsd_res_list.size(); n++){
502 Size const seq_num=rmsd_res_list[n];
503 Is_prepend_map[seq_num]=
false;
509 for(
Size n=1; n<=rmsd_res_list.size(); n++){
510 Size const seq_num=rmsd_res_list[n];
524 using namespace ObjexxFCL;
541 utility_exit_with_message(
"seq_num " + string_of(seq_num) +
" is a CUTPOINT_LOWER but seq_num " + string_of(seq_num+1) +
" is not a cutpoint CUTPOINT_UPPER??" );
544 previously_closed_cutpoint.push_back( input_to_full_res_map[seq_num] );
552 return previously_closed_cutpoint;
560 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::setup_additional_cutpoint_closed");
573 for(
Size seq_num=1; seq_num<=nres; seq_num++){
575 non_fixed_res.push_back(seq_num);
585 if(new_cutpoint_closed_list.size()>0){
586 std::cout <<
"user_specified_cutpoint_closed= " << new_cutpoint_closed_list[1] << std::endl;
589 for(
Size n=1; n<=non_fixed_res.size(); n++){
591 if(is_working_res[ non_fixed_res[n] ]==
false)
continue;
594 bool free_boundary=
false;
596 Size five_prime_boundary=0;
597 for(
int seq_num=non_fixed_res[n]; seq_num >= 0; seq_num--){
604 five_prime_boundary=seq_num;
609 Size three_prime_boundary=0;
610 for(
Size seq_num=non_fixed_res[n]; seq_num <= nres+1; seq_num++){
618 three_prime_boundary=seq_num;
623 if(free_boundary==
true)
continue;
625 bool boundary_is_a_pair=
false;
628 if(five_prime_boundary==jump_point_pair.first && three_prime_boundary==jump_point_pair.second){
629 boundary_is_a_pair=
true;
633 if(boundary_is_a_pair==
false)
continue;
636 bool found_cutpoint_or_moving_res_or_nonworking_res=
false;
637 for(
Size seq_num=five_prime_boundary; seq_num <= three_prime_boundary-1; seq_num++){
639 found_cutpoint_or_moving_res_or_nonworking_res=
true;
648 if(found_cutpoint_or_moving_res_or_nonworking_res==
true)
continue;
659 for(
Size seq_num=five_prime_boundary; seq_num <= three_prime_boundary-1; seq_num++){
661 if(
Contain_seq_num(seq_num, previously_closed_cutpoint) && is_working_res[seq_num]){
671 Size three_prime_fixed_res=0;
672 for(
Size seq_num=non_fixed_res[n]; seq_num <= nres+1; seq_num++){
674 if(seq_num > three_prime_boundary){
675 utility_exit_with_message(
"three_prime_fixed_res > three_prime_boundary of fixed base pair ?? " );
679 three_prime_fixed_res=seq_num;
684 cutpoint=three_prime_fixed_res-2;
687 if(is_working_res[cutpoint]==
false) utility_exit_with_message(
"cutpoint is not a working_res!" );
689 new_cutpoint_closed_list.push_back(cutpoint);
695 std::cout <<
"added_cutpoint_closed_= ";
699 std::cout << std::endl;
714 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::figure_out_chain_boundaries");
721 Size start_chain( 0 );
724 for (
Size pos = 1; pos <= nres; pos++ ) {
726 if ( !is_working_res[ pos ] )
continue;
729 if ( n == 1 ) start_chain = pos;
731 if (n > 1 && ( pos > end_chain + 1 ||
is_cutpoint_( end_chain ) ) ) {
733 std::cout <<
"start_chain= " << start_chain <<
" end_chain= " << end_chain << std::endl;
735 chain_boundaries.push_back( std::make_pair( start_chain, end_chain ) );
744 if( (start_chain > 0)==
false ) utility_exit_with_message(
"start_chain > 0" );
746 chain_boundaries.push_back( std::make_pair( start_chain, end_chain ) );
747 std::cout <<
"start_chain= " << start_chain <<
" end_chain= " << end_chain << std::endl;
767 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
771 Size const num_chains( chain_boundaries.size() );
773 std::cout <<
"num_chains= " << num_chains << std::endl;
774 for (
Size n = 1 ; n < num_chains; n++ ) {
776 Size const jump_partner1 = chain_boundaries[n].second;
777 Size const jump_partner2 = chain_boundaries[n+1].first;
781 bool pass_consecutive_res_jump_partner_test=
true;
783 if ( is_working_res[ jump_partner1 ] ==
false || is_working_res[ jump_partner2 ] ==
false ){
784 pass_consecutive_res_jump_partner_test=
false;
787 pass_consecutive_res_jump_partner_test=
false;
790 if(jump_partner1+1==jump_partner2 &&
796 if ( is_working_res[ jump_partner1 ] ==
false || is_working_res[ jump_partner2 ] ==
false ) utility_exit_with_message(
"jump_partner should be working res!" );
798 if (
moving_res_ == jump_partner2 ||
moving_res_ == jump_partner1) utility_exit_with_message(
"jump_partner should not be moving_res_!" );
800 std::cout << std::setw(80) <<
"jump_partner1+1=jump_partner2 case: jump_partner1= " << jump_partner1 <<
" jump_partner2= " << jump_partner2 << std::endl;
801 jump_partners_.push_back( std::make_pair( full_to_sub[ jump_partner1 ], full_to_sub[ jump_partner2 ] ) );
804 std::pair< core::Size, core::Size > fixed_base_pair;
806 bool found_jump_point_pair=
false;
811 found_jump_point_pair=
true;
818 if(found_jump_point_pair==
false){
824 std::cout <<
"warning allow_chain_boundary_jump_partner_right_at_fixed_BP_=true" << std::endl;
825 std::cout <<
"jump_partner1(local)= " << fixed_base_pair.first <<
" jump_partner2(local)= " << fixed_base_pair.second <<
" is right at a fixed_BP " << std::endl;
826 found_jump_point_pair=
true;
836 if(found_jump_point_pair==
false) utility_exit_with_message(
"Cannot find found_jump_point_pair!" );
838 std::cout << std::setw(80) <<
"exterior_fixed_base_pair_case : jump_partner1= " << fixed_base_pair.first <<
" jump_partner2= " << fixed_base_pair.second << std::endl;
839 jump_partners_.push_back( std::make_pair( full_to_sub[ fixed_base_pair.first ], full_to_sub[ fixed_base_pair.second ] ) );
853 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
854 Size const num_chains = chain_boundaries.size();
856 for (
Size n = 1; n < num_chains; n++ ) {
857 cuts_.push_back( full_to_sub[ chain_boundaries[n].second ] );
868 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
870 if(
cuts_.size() !=
jump_partners_.size() ) utility_exit_with_message(
"cuts_.size() != jump_partners_.size()" );
874 Size const nres( working_sequence.size() );
878 ObjexxFCL::FArray2D< int > jump_point( 2, num_cuts, 0 );
879 ObjexxFCL::FArray1D< int > cuts( num_cuts, 0 );
881 for (
Size i = 1; i <= num_cuts; i++ ) {
885 cuts( i ) =
cuts_[ i ];
897 for (
Size i = 1; i <= num_cutpoint; i++ ) {
901 char upstream_res=working_sequence[k-1];
902 char downstream_res= working_sequence[m-1];
911 if(upstream_res==
'u' || upstream_res==
'c'){
912 upstream_jump_atom=
" C2 ";
913 }
else if(upstream_res==
'a' || upstream_res==
'g'){
914 upstream_jump_atom=
" C4 ";
916 utility_exit_with_message(
"Invalid upstream_res!!" );
919 if(downstream_res==
'u' || downstream_res==
'c'){
920 downstream_jump_atom=
" C2 ";
921 }
else if(downstream_res==
'a' || downstream_res==
'g'){
922 downstream_jump_atom=
" C4 ";
924 utility_exit_with_message(
"Invalid downstream_res!!" );
927 std::cout <<
"upstream_res= " << k << upstream_res <<
" upstream_jump_atom= " << upstream_jump_atom;
928 std::cout <<
" downstream_res= " << k << downstream_res <<
" downstream_jump_atom= " << downstream_jump_atom << std::endl;
930 fold_tree.
set_jump_atoms( i, downstream_jump_atom, upstream_jump_atom);
956 if(input_res_vectors.size()!=2) utility_exit_with_message(
"Is_internal case but input_res_vectors.size()!=2" );
957 std::map< core::Size, core::Size > & sub_to_full(
job_parameters_->sub_to_full() );
959 if(
Contain_seq_num(sub_to_full[working_seq_num], input_res_vectors[1]) )
return 1;
961 if(
Contain_seq_num(sub_to_full[working_seq_num], input_res_vectors[2]) )
return 2;
963 std::cout <<
"working_seq_num= " << working_seq_num <<
" full_seq_num= " << sub_to_full[working_seq_num] << std::endl;
964 std::cout <<
"ADASDasd" << std::endl;
965 utility_exit_with_message(
"seq_num is not part of both input_res_vectors[1] or input_res_vectors[2]" );
980 ObjexxFCL::FArray1D_bool partition_definition( nres,
false );
989 Size const working_moving_res=working_moving_res_list[1];
990 Size const first_working_moving_res=working_moving_res_list[working_moving_res_list.size()];
995 if ( working_moving_res == 1 || fold_tree.
is_cutpoint( working_moving_res - 1 ) ) {
996 fake_working_moving_suite = first_working_moving_res ;
997 }
else if ( fold_tree.
is_cutpoint( working_moving_res ) || working_moving_res == nres){
998 fake_working_moving_suite = first_working_moving_res - 1;
1006 if(!can_prepend && !can_append){
1008 utility_exit_with_message(
"Cannot prepend or append residue in working_moving_res_list" );
1013 Size possible_working_res_1=0;
1014 Size possible_working_res_2=0;
1015 Size found_possible_working_res=0;
1017 if(working_moving_res_list.size()==1){
1019 if( working_moving_res+1<=nres ){
1021 possible_working_res_1=working_moving_res;
1022 possible_working_res_2=working_moving_res+1;
1023 found_possible_working_res++;
1027 if(working_moving_res-1>=1 ){
1029 possible_working_res_1=working_moving_res-1;
1030 possible_working_res_2=working_moving_res;
1031 found_possible_working_res++;
1038 possible_working_res_1=working_moving_res;
1039 possible_working_res_2=working_moving_res_list[working_moving_res_list.size()]+1;
1040 found_possible_working_res++;
1043 possible_working_res_1=working_moving_res_list[working_moving_res_list.size()]-1;
1044 possible_working_res_2=working_moving_res;
1045 found_possible_working_res++;
1049 if(found_possible_working_res!=1){
1050 std::cout <<
"found_possible_working_res= " << found_possible_working_res << std::endl;
1051 utility_exit_with_message(
"found_possible_working_res!=1" );
1057 utility_exit_with_message(
"input_struct_definition( possible_working_res_1) == input_struct_definition( possible_working_res_2)" );
1060 fake_working_moving_suite = possible_working_res_1;
1063 std::cout <<
"POSSIBLE_WORKING_RES1 " << possible_working_res_1 <<
" POSSIBLE_WORKING_RES2 " << possible_working_res_2 << std::endl;
1064 while ( fold_tree.
is_cutpoint( fake_working_moving_suite ) && fake_working_moving_suite < possible_working_res_2 ) fake_working_moving_suite++;
1076 std::cout <<
"FAKE_WORKING_MOVING_SUITE " << fake_working_moving_suite << std::endl;
1080 fold_tree_with_cut_at_moving_suite.
partition_by_jump( jump_at_moving_suite, partition_definition );
1085 return internal_working_res_params;
1094 if ( n == 1 )
return true;
1095 if ( n == f.
nres() )
return true;
1110 for (
Size i = 1; i <= working_fixed_res.size(); i++ ){
1111 Size const n = working_fixed_res[i];
1114 bool reorder_went_OK = rerooted_fold_tree.
reorder( n );
1115 if ( reorder_went_OK ) {
1131 ObjexxFCL::FArray1D< bool >
const & partition_definition =
job_parameters_->partition_definition();
1135 std::map< core::Size, core::Size > & sub_to_full(
job_parameters_->sub_to_full() );
1137 Size num_partition_0( 0 ), num_partition_1( 0 );
1138 Size possible_new_root_residue_in_partition_0( 0 ), possible_new_root_residue_in_partition_1( 0 ), root_res( 0 );
1140 for (
Size n = 1; n <= nres; n++ ) {
1141 if( partition_definition( n ) ) {
1142 num_partition_1 += 1;
1143 if (
possible_root( fold_tree, n ) ) possible_new_root_residue_in_partition_1 = n;
1145 num_partition_0 += 1;
1146 if (
possible_root( fold_tree, n ) ) possible_new_root_residue_in_partition_0 = n;
1154 for(
Size i=1; i<=working_fixed_res.size(); i++){
1155 Size const seq_num = working_fixed_res[i];
1156 if(partition_definition( seq_num ) &&
possible_root( fold_tree, seq_num ) ){
1157 possible_new_root_residue_in_partition_1= seq_num;
1162 for(
Size i=1; i<=working_fixed_res.size(); i++){
1163 Size const seq_num = working_fixed_res[i];
1164 if(!partition_definition( seq_num ) &&
possible_root( fold_tree, seq_num ) ){
1165 possible_new_root_residue_in_partition_0= seq_num;
1173 for(
Size i=1; i<=working_terminal_res.size(); i++){
1174 Size const seq_num = working_terminal_res[i];
1175 if(partition_definition( seq_num ) &&
possible_root( fold_tree, seq_num ) ){
1176 possible_new_root_residue_in_partition_1= seq_num;
1181 for(
Size i=1; i<=working_terminal_res.size(); i++){
1182 Size const seq_num = working_terminal_res[i];
1183 if(!partition_definition( seq_num ) &&
possible_root( fold_tree, seq_num ) ){
1184 possible_new_root_residue_in_partition_0= seq_num;
1190 if( (num_partition_0 > 0)==false ) utility_exit_with_message(
"num_partition_0 > 0" );
1191 if( (num_partition_1 > 0)==false ) utility_exit_with_message(
"num_partition_1 > 0" );
1196 if( num_partition_1 == num_partition_0 ){
1197 if(partition_definition( moving_res )==0){
1198 if ( partition_definition( 1 ) && partition_definition( nres ) ) {
1201 root_res = possible_new_root_residue_in_partition_1;
1204 if ( !partition_definition( 1 ) && !partition_definition( nres )) {
1207 root_res = possible_new_root_residue_in_partition_0;
1210 }
else if ( num_partition_1 > num_partition_0 ){
1212 if ( partition_definition( 1 ) && partition_definition( nres ) ) {
1215 root_res = possible_new_root_residue_in_partition_1;
1218 if ( !partition_definition( 1 ) && !partition_definition( nres )) {
1221 root_res = possible_new_root_residue_in_partition_0;
1225 std::cout <<
"Num. res in partition 0: " << num_partition_0 <<
". Num. res in partition 1: " << num_partition_1 << std::endl;
1226 std::cout <<
"Moving_res full seq_num = " << sub_to_full[moving_res] <<
", partition " << partition_definition( moving_res ) << std::endl;
1227 std::cout <<
"fake_working_moving_suite = " << sub_to_full[fake_working_moving_suite ] <<
", partition " << partition_definition( fake_working_moving_suite ) << std::endl;
1228 std::cout <<
"New root res full seq_num = " << sub_to_full[root_res] <<
", partition " << partition_definition( root_res ) << std::endl;
1231 if( (root_res > 0)==
false ) utility_exit_with_message(
"(root_res > 0)==false" );
1235 bool reorder_went_OK = rerooted_fold_tree.
reorder( root_res );
1237 if( !reorder_went_OK) utility_exit_with_message(
"!reorder_went_OK" );
1242 bool const root_partition = partition_definition( rerooted_fold_tree.
root() );
1244 for (
Size seq_num=1; seq_num<=nres; seq_num++){
1245 if ( partition_definition( seq_num ) != root_partition ) working_moving_partition_pos.push_back( seq_num );
1248 job_parameters_->set_working_moving_partition_pos( working_moving_partition_pos );
1264 Size gap_size = 999;
1271 ObjexxFCL::FArray1D< bool >
const & partition_definition =
job_parameters_->partition_definition();
1274 std::map< core::Size, core::Size > & full_to_sub(
job_parameters_->full_to_sub() );
1275 Size found_moving_gap( 0 );
1276 Size const num_chains = chain_boundaries.size();
1277 for (
Size n = 1; n < num_chains; n++ ) {
1278 Size chain_end = chain_boundaries[ n ].second;
1279 Size next_chain_start = chain_boundaries[ n+1 ].first;
1280 if ( partition_definition( full_to_sub[ chain_end ] ) !=
1281 partition_definition( full_to_sub[ next_chain_start ] ) ){
1283 bool found_cutpoint_open(
false );
1286 found_cutpoint_open =
true;
1290 if ( found_cutpoint_open )
continue;
1292 bool found_added_cutpoint_closed_(
false );
1295 found_added_cutpoint_closed_ =
true;
1299 if ( found_added_cutpoint_closed_ )
continue;
1302 job_parameters_->set_five_prime_chain_break_res( full_to_sub[ chain_end ] );
1308 if ( found_moving_gap > 1 ){
1309 utility_exit_with_message(
"Had trouble figure out which gap corresponds to the user specified cutpoint_closed! Try to renumber input poses sequentially.");
1322 Output_title_text(
"Enter StepWiseRNA_JobParameters_Setup::figure_out_Prepend_Internal");
1323 std::map< core::Size, core::Size > & sub_to_full(
job_parameters_->sub_to_full() );
1325 ObjexxFCL::FArray1D< bool >
const & partition_definition =
job_parameters_->partition_definition();
1332 bool Is_prepend(
true ), Is_internal(
false );
1339 if ( working_moving_res == 1 || fold_tree.is_cutpoint( working_moving_res - 1 ) ) {
1341 Is_internal =
false;
1342 }
else if ( fold_tree.is_cutpoint( working_moving_res ) || working_moving_res == nres){
1344 Is_internal =
false;
1347 std::cout <<
"Is_internal case " << std::endl;
1357 Size found_actual_working_res=0;
1362 if( partition_definition( possible_working_res_1 ) != partition_definition( root_res ) ){
1363 found_actual_working_res++;
1364 actual_working_moving_res=possible_working_res_1;
1367 if(working_moving_res_list.size()==1){
1368 actual_working_moving_res_list.push_back(actual_working_moving_res);
1371 actual_working_moving_res_list=working_moving_res_list;
1374 for(
Size n=working_moving_res_list.size(); n>=1; n--){
1375 actual_working_moving_res_list.push_back(working_moving_res_list[n]-1);
1379 Output_seq_num_list(
"actual_working_moving_res_list= ", actual_working_moving_res_list, 40);
1380 utility_exit_with_message(
"actual_working_moving_res_list fails can_prepend assertion");
1387 if( partition_definition( possible_working_res_2 ) != partition_definition( root_res ) ){
1388 found_actual_working_res++;
1389 actual_working_moving_res=possible_working_res_2;
1392 if(working_moving_res_list.size()==1){
1393 actual_working_moving_res_list.push_back(actual_working_moving_res);
1396 actual_working_moving_res_list=working_moving_res_list;
1399 for(
Size n=working_moving_res_list.size(); n>=1; n--){
1400 actual_working_moving_res_list.push_back(working_moving_res_list[n]+1);
1404 Output_seq_num_list(
"actual_working_moving_res_list= ", actual_working_moving_res_list, 40);
1405 utility_exit_with_message(
"actual_working_moving_res_list fails can_append assertion");
1410 if(actual_working_moving_res_list[1]!=actual_working_moving_res){
1411 std::cout <<
"actual_working_moving_res= " << actual_working_moving_res << std::endl;
1412 Output_seq_num_list(
"actual_working_moving_res_list= ", actual_working_moving_res_list, 40);
1413 utility_exit_with_message(
"actual_working_moving_res_list[1]!=actual_working_moving_res" );
1416 if(found_actual_working_res!=1){
1417 std::cout <<
"found_actual_working_res= " << found_actual_working_res << std::endl;
1418 utility_exit_with_message(
"found_actual_working_res!=1" );
1422 Output_seq_num_list(
"actual_working_moving_res_list= ", actual_working_moving_res_list, 40);
1425 std::cout <<
"User input moving_res full seq_num= " << sub_to_full[working_moving_res] <<
", partition " << partition_definition( working_moving_res ) << std::endl;
1426 std::cout <<
"Actual moving_res full seq_num= " << sub_to_full[actual_working_moving_res_list[1]] <<
", partition " << partition_definition( actual_working_moving_res_list[1] ) << std::endl;
1427 std::cout <<
"New root res full seq_num= " << sub_to_full[root_res] <<
", partition " << partition_definition( root_res ) << std::endl;
1431 job_parameters_->set_working_moving_res_list( actual_working_moving_res_list );
1434 if(partition_definition( root_res )==partition_definition( actual_working_moving_res_list[1] ) ){
1435 utility_exit_with_message(
"partition_definition( root_res )==partition_definition( actual_working_moving_res_list[1]!!" );
1446 bool const should_be_prepend = ( partition_definition( fake_working_moving_suite ) != partition_definition( root_res ) );
1448 std::cout <<
"sub_to_full[fake_working_moving_suite]= " << sub_to_full[fake_working_moving_suite];
1449 std::cout <<
" partition_definition( fake_working_moving_suite )= " << partition_definition( fake_working_moving_suite );
1450 std::cout <<
" sub_to_full[root_res]= " << sub_to_full[root_res];
1451 std::cout <<
" partition_definition( root_res )= " << partition_definition( root_res ) << std::endl;
1453 utility_exit_with_message(
"Possible problem with prepend/append assignment!!" );
1503 using namespace ObjexxFCL;
1515 utility_exit_with_message(
"moving_res " + string_of(
moving_res_list_[n]) +
" should not be in fixed_res_list!");
1546 for(
Size n=1; n<=input_rmsd_res_list.size(); n++){
1547 Size seq_num=input_rmsd_res_list[n];
1548 if( !is_working_res[seq_num] )
continue;
1549 actual_rmsd_res_list.push_back(seq_num);
1565 if(jump_point_pairs_string.size()==0)
return;
1567 if(
fixed_res_.size()==0) utility_exit_with_message(
"need to called set_fixed_res before calling set_jump_point_pair_list" );
1569 bool assert_in_fixed_res=
true;
1571 for(
Size n=1; n<=jump_point_pairs_string.size(); n++){
1574 if( (n==1) && (jump_point_pairs_string[n]==
"NOT_ASSERT_IN_FIXED_RES") ){
1576 assert_in_fixed_res=
false;
1581 if(JP_pair_string.size()!=2) utility_exit_with_message(
"Each jump_point_pair need to have two elements! (e.g. 1-10)");
1583 std::pair< core::Size, core::Size > jump_point_pair=std::make_pair(
string_to_int(JP_pair_string[1]),
string_to_int(JP_pair_string[2]) );
1585 if(jump_point_pair.first >= jump_point_pair.second ){
1587 utility_exit_with_message(
"jump_point_pair.first >= jump_point_pair.second!");
1601 if(assert_in_fixed_res==
true){
1605 utility_exit_with_message(
"seq_num ("+ ObjexxFCL::string_of(
jump_point_pair_list_[n].first) +
") is in jump_point_pair_list_ but is not a fixed res!");
1609 utility_exit_with_message(
"seq_num ("+ ObjexxFCL::string_of(
jump_point_pair_list_[n].second) +
") is in jump_point_pair_list_ but is not a fixed res!");
1638 job_parameters_->set_global_sample_res_list( global_sample_res_list );
1648 job_parameters_->set_force_syn_chi_res_list( force_syn_chi_res_list );
1658 job_parameters_->set_force_north_ribose_list( force_north_ribose_list );
1668 job_parameters_->set_force_south_ribose_list( force_south_ribose_list );
1678 job_parameters_->set_protonated_H1_adenosine_list( protonated_H1_adenosine_list );