46 #include <numeric/conversions.hh>
47 #include <numeric/xyz.functions.hh>
48 #include <numeric/angle.functions.hh>
49 #include <ObjexxFCL/format.hh>
50 #include <ObjexxFCL/string.functions.hh>
51 #include <utility/tools/make_vector1.hh>
52 #include <utility/exit.hh>
72 RNA_LoopCloseSampler::RNA_LoopCloseSampler (
Size const moving_suite,
Size const chainbreak_suite ) :
73 moving_suite_ ( moving_suite ),
74 chainbreak_suite_ ( chainbreak_suite ),
79 torsion_range_ ( 20.0 ),
80 torsion_increment_ ( 5.0 ),
81 epsilon_range_ ( 40.0 ),
82 just_output_score_ ( false ),
83 sample_only_ ( false ),
84 sample_native_torsion_ ( false ) {
98 using namespace scoring;
99 using namespace io::silent;
100 using namespace chemical;
102 using namespace scoring::rna;
103 using namespace protocols::swa;
104 using namespace protocols::swa::rna;
105 using namespace numeric::conversions;
120 for (
int i = 1; i <= 6; i++ ) six_zeros.push_back ( 0.0 );
122 for (
int i = 1; i <= 6; i++ ) J.push_back ( six_zeros );
124 Real epsilon1_center = ( pucker_state1 ==
NORTH ) ? -150.17 : -98.45;
127 if (pucker_state1 ==
SOUTH && epsilon1_min > -178) epsilon1_min = -178.45;
129 Real alpha1_min = 20.0;
132 Real alpha2_min = 20.0;
135 Real zeta1_min = 20.0;
147 for (
Real epsilon1 = epsilon1_min; epsilon1 <= epsilon1_max; epsilon1 += epsilon1_increment ) {
148 for (
Real alpha1 = alpha1_min; alpha1 <= alpha1_max; alpha1 += alpha1_increment ) {
149 for (
Real alpha2 = alpha2_min; alpha2 <= alpha2_max; alpha2 += alpha2_increment ) {
150 for (
Real zeta1 = zeta1_min; zeta1 <= zeta1_max; zeta1 += zeta1_increment ) {
157 rna_analytic_loop_closer.
apply ( pose );
160 for (
Size n = 1; n <= rna_analytic_loop_closer.
nsol(); n++ ) {
197 rna_analytic_loop_closer.
apply ( pose );
200 for (
Size n = 1; n <= rna_analytic_loop_closer.
nsol(); n++ ) {
229 using namespace pose;
230 using namespace scoring;
231 using namespace io::silent;
232 using namespace chemical;
234 using namespace scoring::rna;
235 using namespace protocols::swa;
236 using namespace protocols::swa::rna;
237 using namespace numeric::conversions;
262 using namespace core::scoring;
272 using namespace pose;
273 using namespace kinematics;
274 using namespace scoring;
275 using namespace protocols::swa;
281 Pose pose_expand = pose;
283 for (
Size n = 1; n <= moving_suites.size(); n++ ) {
285 Jump j = pose_expand.jump ( jump_at_moving_suite );
286 j.set_translation (
Vector ( 1.0e4 * n, 0.0, 0.0 ) );
287 pose_expand.set_jump ( jump_at_moving_suite, j );
290 ( *rep_scorefxn ) ( pose_expand );
291 EnergyMap const & energy_map = pose_expand.energies().total_energies();
292 return energy_map[
fa_rep ] * rep_scorefxn->get_weight (
fa_rep );
299 Real const & fa_rep_score_baseline,
302 using namespace scoring;
303 ( *rep_scorefxn ) ( pose );
305 Real const fa_rep_score = energy_map[
fa_rep ] * rep_scorefxn->get_weight (
fa_rep );
308 if ( ( fa_rep_score - fa_rep_score_baseline ) > rep_cutoff_ )
return false;
310 static Real const tolerance ( 1.0e-3 );
312 if ( ( fa_rep_score - fa_rep_score_baseline ) < -1.0 * tolerance ) {
313 std::cout << fa_rep_score <<
" " << fa_rep_score_baseline << std::endl;
329 Size const moving_suite,
330 Size const chainbreak_suite ) {
332 using namespace core::scoring::rna;
333 using namespace protocols::swa::rna;
335 static Size const epsilonmin_n = 155, epsilonmax_n = 310;
336 static Size const epsilonmin_s = 175, epsilonmax_s = 310;
337 static Size const gammapmin = 20, gammapmax = 95;
338 static Size const gammatmin = 140, gammatmax = 215;
339 static Size const gammammin = 260, gammammax = 335;
340 static Size const betamin = 50, betamax = 290;
341 static Size const alphamin = 25, alphamax = 335;
342 static Size const zetamin = 25, zetamax = 335;
345 Real beta1 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( moving_suite + 1,
id::BB,
BETA ) ) );
346 if (beta1 < 0) beta1 += 360;
347 if ( beta1 < betamin || beta1 > betamax )
return false;
349 Real beta2 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( chainbreak_suite + 1,
id::BB,
BETA ) ) );
350 if (beta2 < 0) beta2 += 360;
351 if ( beta2 < betamin || beta2 > betamax )
return false;
354 Real gamma1 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( moving_suite + 1,
id::BB,
GAMMA ) ) );
355 if (gamma1 < 0) gamma1 += 360;
356 if ( ( gamma1 < gammapmin || gamma1 > gammapmax ) &&
357 ( gamma1 < gammatmin || gamma1 > gammatmax ) &&
358 ( gamma1 < gammammin || gamma1 > gammammax ) ) {
362 Real gamma2 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( chainbreak_suite + 1,
id::BB,
GAMMA ) ) );
363 if (gamma2 < 0) gamma2 += 360;
364 if ( ( gamma2 < gammapmin || gamma2 > gammapmax ) &&
365 ( gamma2 < gammatmin || gamma2 > gammatmax ) &&
366 ( gamma2 < gammammin || gamma2 > gammammax ) ) {
373 if (epsilon1 < 0) epsilon1 += 360;
374 if (pucker_state1 ==
NORTH) {
375 if ( epsilon1 < epsilonmin_n || epsilon1 > epsilonmax_n )
return false;
377 if ( epsilon1 < epsilonmin_s || epsilon1 > epsilonmax_s )
return false;
381 Real epsilon2 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( chainbreak_suite,
id::BB,
EPSILON ) ) );
382 if (epsilon2 < 0) epsilon2 += 360;
383 if (pucker_state2 ==
NORTH) {
384 if ( epsilon2 < epsilonmin_n || epsilon2 > epsilonmax_n )
return false;
386 if ( epsilon2 < epsilonmin_s || epsilon2 > epsilonmax_s )
return false;
390 Real zeta1 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( moving_suite,
id::BB,
ZETA ) ) );
391 if (zeta1 < 0) zeta1 += 360;
392 if ( zeta1 < zetamin || zeta1 > zetamax )
return false;
394 Real zeta2 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( chainbreak_suite,
id::BB,
ZETA ) ) );
395 if (zeta2 < 0) zeta2 += 360;
396 if ( zeta2 < zetamin || zeta1 > zetamax )
return false;
399 Real alpha1 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( moving_suite + 1,
id::BB,
ALPHA ) ) );
400 if (alpha1 < 0) alpha1 += 360;
401 if ( alpha1 < alphamin || alpha1 > alphamax )
return false;
403 Real alpha2 = numeric::principal_angle_degrees ( pose.
torsion ( TorsionID ( chainbreak_suite + 1,
id::BB,
ALPHA ) ) );
404 if (alpha2 < 0) alpha2 += 360;
405 if ( alpha2 < alphamin || alpha2 > alphamax )
return false;