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_wrapper" );
49 StepWiseRNA_RotamerGenerator_Wrapper::StepWiseRNA_RotamerGenerator_Wrapper(
52 bool const & sample_sugar_and_base1,
53 bool const & sample_sugar_and_base2 ):
55 moving_suite_list_( moving_suite_list ),
56 sample_sugar_and_base1_(sample_sugar_and_base1),
57 sample_sugar_and_base2_(sample_sugar_and_base2),
58 sample_extra_rotamers_( true ),
61 sample_chi_torsion_(true),
62 include_syn_chi_(true),
64 extra_epsilon_(false),
66 extra_anti_chi_(false),
67 extra_syn_chi_(false),
68 exclude_alpha_beta_gamma_sampling_(false),
69 allow_syn_pyrimidine_(false),
70 rotamer_generator_list_(moving_suite_list_.
size(), NULL)
77 if(!can_prepend && !can_append){
79 utility_exit_with_message(
"Cannot prepend or append residue in moving_suite_list_" );
83 if(can_prepend && can_append){
85 utility_exit_with_message(
"moving_suite_list_.size()>1 but BOTH can_prepend=true && can_append==true!" );
105 Output_title_text(
"Enter StepWiseRNA_RotamerGenerator::initialize_rotamer_generator_list");
112 std::cout << std::endl;
116 std::cout << std::endl;
124 utility_exit_with_message(
"seq_num= " + ObjexxFCL::string_of(
force_north_ribose_list_[n]) +
" is in both force_north_ribose_list_ and force_south_ribose_list_! " );
133 std::cout <<
"list_position= " << list_position <<
" working_moving_suite= " <<
moving_suite_list_[list_position] << std::endl;
137 Output_title_text(
"Exit StepWiseRNA_RotamerGenerator::initialize_rotamer_generator_list");
145 bool sample_lower_sugar_and_base, sample_upper_sugar_and_base;
152 if(list_position==1){
154 sample_upper_sugar_and_base=
false;
156 sample_lower_sugar_and_base=
true;
159 sample_lower_sugar_and_base=
true;
160 sample_upper_sugar_and_base=
false;
163 if(list_position==1){
164 sample_lower_sugar_and_base=
false;
168 sample_upper_sugar_and_base=
true;
170 sample_lower_sugar_and_base=
false;
171 sample_upper_sugar_and_base=
true;
184 bool const Is_bulge = (list_position==1) ?
false :
true;
185 std::cout <<
"list_position=" << list_position;
Output_boolean(
" Is_bulge= " , Is_bulge); std::cout << std::endl;
188 bool const fast = (list_position==1) ?
fast_ :
false;
193 sample_lower_sugar_and_base,
194 sample_upper_sugar_and_base,
195 lower_res_puckerstate,
196 upper_res_puckerstate);
199 rotamer_generator->set_sample_chi_torsion(
false );
204 rotamer_generator->set_fast( fast );
205 rotamer_generator->set_sample_extra_rotamers(sample_extra_rotamers);
211 rotamer_generator->set_bin_size(
bin_size_);
212 rotamer_generator->set_extra_epsilon( ( (Is_bulge) ?
false :
extra_epsilon_ ) );
213 rotamer_generator->set_extra_beta( ( (Is_bulge) ?
false :
extra_beta_ ) );
214 rotamer_generator->set_extra_anti_chi( ( (Is_bulge) ?
false :
extra_anti_chi_ ) );
215 rotamer_generator->set_extra_syn_chi( ( (Is_bulge) ?
false :
extra_syn_chi_ ) );
219 rotamer_generator->initialize_rotamer_generator(
pose_);
221 return rotamer_generator;
243 Size const working_moving_pucker= (which_sugar==
"lower") ? working_moving_suite : working_moving_suite+1;
246 if(sample_sugar_pucker){
258 bool Is_first_of_multiple_res_plus_internal_case=
false;
261 if(which_sugar==
"lower" &&
Is_prepend_) Is_first_of_multiple_res_plus_internal_case=
true;
262 if(which_sugar==
"upper" && !
Is_prepend_) Is_first_of_multiple_res_plus_internal_case=
true;
271 if(
moving_suite_list_.size()<2) utility_exit_with_message(
"moving_suite_list_.size()<2");
276 if(which_sugar!=
"upper" ) utility_exit_with_message(
"which_sugar!=\"upper\"" );
279 utility_exit_with_message(
"(moving_suite+1) != rotamer_generator_list_[list_position+1]->moving_suite()" );
287 if(which_sugar!=
"lower") utility_exit_with_message(
"which_sugar!=\"lower\"" );
290 utility_exit_with_message(
"(moving_suite-1) != rotamer_generator_list_[list_position+1]->moving_suite()" );
298 utility_exit_with_message(
"Contain_seq_num(working_moving_pucker, force_north_ribose_list_) && pucker_state!=NORTH, working_moving_pucker=" + ObjexxFCL::string_of(working_moving_pucker) );
302 utility_exit_with_message(
"Contain_seq_num(working_moving_pucker, force_south_ribose_list_) && pucker_state!=SOUTH, working_moving_pucker=" + ObjexxFCL::string_of(working_moving_pucker) );
327 using namespace core::id;
339 need_initialization_list[n]=
true;
346 if(need_initialization_list[n]==
true){
352 all_rotamer_list.clear();
357 for(
Size i=1; i<=suite_rotamer_list.size(); i++){
358 all_rotamer_list.push_back(suite_rotamer_list[i]);
364 return all_rotamer_list;