28 #include <basic/Tracer.hh>
30 #include <ObjexxFCL/FArray1D.hh>
31 #include <ObjexxFCL/format.hh>
32 #include <ObjexxFCL/string.functions.hh>
38 using ObjexxFCL::fmt::F;
40 static basic::Tracer
TR(
"protocols.swa.rna.stepwise_rna_rotamer_generator" );
49 StepWiseRNA_RotamerGenerator::StepWiseRNA_RotamerGenerator(
50 Size const moving_suite,
51 bool const sample_lower_sugar_and_base,
52 bool const sample_upper_sugar_and_base,
55 moving_suite_( moving_suite ),
56 sample_lower_sugar_and_base_(sample_lower_sugar_and_base),
57 sample_upper_sugar_and_base_(sample_upper_sugar_and_base),
58 pucker1_specified_( pucker1 ),
59 pucker2_specified_( pucker2 ),
60 sample_extra_rotamers_( true ),
64 sample_chi_torsion_(true),
65 include_syn_chi_(true),
66 extra_epsilon_(false),
68 extra_anti_chi_(false),
69 extra_syn_chi_(false),
70 exclude_alpha_beta_gamma_sampling_(false),
71 allow_syn_pyrimidine_(false),
72 lower_base_state_(
NONE ),
73 upper_base_state_(
NONE )
87 Output_title_text(
"Enter StepWiseRNA_RotamerGenerator::initialize_rotamer_generator");
101 Output_title_text(
"Exit StepWiseRNA_RotamerGenerator::initialize_rotamer_generator");
128 using namespace core::id;
132 Real const DELTA_CUTOFF( rna_fitted_torsion_info.delta_cutoff() );
142 std::cout <<
" DELTA_CUTOFF angle=" << DELTA_CUTOFF <<
" delta angle=" << delta_value << std::endl;
144 if((delta_value>1.0 && delta_value<179.00)==
false){
145 utility_exit_with_message(
"delta angle out of range!" );
148 if (delta_value <= DELTA_CUTOFF) {
156 utility_exit_with_message(
"torsion_ids does not contain the desire delta torsion id" );
164 using namespace core::id;
213 using namespace core::scoring::rna;
241 utility_exit_with_message(
"forcing working_res= "+ ObjexxFCL::string_of(
moving_suite_ ) +
" to be syn chi but residue is pyrimidine and allow_syn_pyrimidine_==false!");
248 utility_exit_with_message(
"forcing working_res= "+ ObjexxFCL::string_of(
moving_suite_+1) +
" to be syn chi but residue is pyrimidine and allow_syn_pyrimidine_==false!");
272 utility_exit_with_message(
"Error: torsion_id is already in the torsion_id_list!" );
285 using namespace core::id;
329 std::cout << std::endl;
336 std::cout << std::endl;
340 utility_exit_with_message(
"pucker1_specified==ALL but sample_lower_sugar_and_base_==false");
344 utility_exit_with_message(
"pucker2_specified==ALL but sample_upper_sugar_and_base_==false");
347 Real epsilon1( 0.0 ), zeta1( 0.0 ), alpha2( 0.0 ), beta2( 0.0 ), gamma2( 0.0 );
359 while(lower_base_sugar_rotamer->get_next_rotamer()){
361 upper_base_sugar_rotamer->reset();
363 while(upper_base_sugar_rotamer->get_next_rotamer()){
366 std::cout <<
" delta1= " << F(8, 3, lower_base_sugar_rotamer->delta()) <<
" chi_1= " << F(8, 3, lower_base_sugar_rotamer->chi());
367 std::cout <<
" nu2_1= " << F(8, 3, lower_base_sugar_rotamer->nu2()) <<
" nu1_1= " << F(8, 3, lower_base_sugar_rotamer->nu1());
368 std::cout <<
" delta2= " << F(8, 3, upper_base_sugar_rotamer->delta()) <<
" chi_2= " << F(8, 3, upper_base_sugar_rotamer->chi());
369 std::cout <<
" nu2_2= " << F(8, 3, upper_base_sugar_rotamer->nu2()) <<
" nu1_2= " << F(8, 3, upper_base_sugar_rotamer->nu1());
370 std::cout << std::endl;
373 for (
int e1 = 1; e1 <= 1; e1++ ) {
374 for (
int z1 = 1; z1 <= 2; z1++ ) {
378 for (
int a2 = 1; a2 <= 3; a2++ ) {
379 for (
int b2 = 1; b2 <= 1; b2++ ) {
380 for (
int g2 = 1; g2 <= 3; g2++ ) {
383 if(a2!=1 || b2!=1 || g2!=1)
continue;
390 epsilon1= (lower_base_sugar_rotamer->current_pucker_state() ==
NORTH) ? -130.17 : -118.45;
392 epsilon1= (lower_base_sugar_rotamer->current_pucker_state() ==
NORTH) ? -150.17 : -98.45;
395 if(z1==1) zeta1= 0.0;
396 if(z1==2) zeta1= 180.0;
398 if(a2==1) alpha2= 240.0;
399 if(a2==2) alpha2= 0.0;
400 if(a2==3) alpha2= 120.0;
404 if(g2==1) gamma2= 240.0;
405 if(g2==2) gamma2= 0.0;
406 if(g2==3) gamma2= 120.0;
411 rotamer_center.push_back( lower_base_sugar_rotamer->delta());
412 rotamer_center.push_back( lower_base_sugar_rotamer->nu2() );
413 rotamer_center.push_back( lower_base_sugar_rotamer->nu1() );
417 rotamer_center.push_back( lower_base_sugar_rotamer->chi());
420 rotamer_center.push_back( epsilon1 );
421 rotamer_center.push_back( zeta1 );
422 rotamer_center.push_back( alpha2 );
423 rotamer_center.push_back( beta2 );
424 rotamer_center.push_back( gamma2 );
427 rotamer_center.push_back( upper_base_sugar_rotamer->delta() );
428 rotamer_center.push_back( upper_base_sugar_rotamer->nu2() );
429 rotamer_center.push_back( upper_base_sugar_rotamer->nu1());
433 rotamer_center.push_back( upper_base_sugar_rotamer->chi() );
445 std::cout <<
"rotamer_centers_[1].size()= " <<
rotamer_centers_[1].size() <<
" torsion_ids_.size()= " <<
torsion_ids_.size() << std::endl;
447 utility_exit_with_message(
"rotamer_centers_[1].size()!=torsion_ids_.size()" );
457 using namespace core::id;
469 Real perturb_epsilon1( 0.0 ), perturb_zeta1( 0.0 ), perturb_alpha2( 0.0 ), perturb_beta2( 0.0 ), perturb_gamma2( 0.0 );
471 for (
int e1_std = 1; e1_std <= static_cast<int>(
eps_bins_); e1_std++ ) {
474 perturb_epsilon1 =
bin_size_*(e1_std-1) - 60.0;
476 perturb_epsilon1 =
bin_size_*(e1_std-1) - 20.0;
480 for (
int z1_std = 1; z1_std <=
bins2_; z1_std++ ) {
484 for (
int a2_std = 1; a2_std <=
bins3_; a2_std++ ) {
488 for (
int b2_std = 1; b2_std <=
beta_bins_; b2_std++ ) {
498 for (
int g2_std = 1; g2_std <=
bins3_; g2_std++ ) {
503 if(a2_std!=1 || b2_std!=1 || g2_std!=1)
continue;
509 rotamer_perturbation.push_back( perturb_epsilon1 );
510 rotamer_perturbation.push_back( perturb_zeta1 );
511 rotamer_perturbation.push_back( perturb_alpha2 );
512 rotamer_perturbation.push_back( perturb_beta2 );
513 rotamer_perturbation.push_back( perturb_gamma2 );
524 utility_exit_with_message(
"extra_rotamer_perturbations_[1].size()!=perturb_torsion_ids_.size()" );