32 #include <numeric/constants.hh>
36 #include <utility/vector1.hh>
37 #include <numeric/xyz.functions.hh>
39 #include <ObjexxFCL/string.functions.hh>
54 if ( c ==
'a')
return 1;
55 if ( c ==
'c')
return 2;
56 if ( c ==
'g')
return 3;
57 if ( c ==
'u')
return 4;
66 if (num ==
SUGAR)
return 'S';
67 if (num ==
O2STAR)
return '2';
77 if (num ==
SUGAR)
return "SUGAR";
78 if (num ==
O2STAR)
return "O2STAR";
81 std::cout <<
"Invalid edge num= " << num << std::endl;
82 utility_exit_with_message(
"Invalid edge num!");
90 if (num == 1)
return 'A';
91 if (num == 2)
return 'P';
99 if (num == 0)
return "BLAH";
100 if (num == 1)
return "ANTI";
101 if (num == 2)
return "PARA";
103 std::cout <<
"Invalid orientation num= " << num << std::endl;
104 utility_exit_with_message(
"Invalid orientation num!");
110 if (num == 0)
return "BLAH ";
111 if (num == 1)
return "CIS ";
112 if (num == 2)
return "TRANS";
114 std::cout <<
"Invalid orientation num= " << num << std::endl;
115 utility_exit_with_message(
"Invalid orientation num!");
128 if (rsd.
name1() ==
'a' || rsd.
name1() ==
'g' )
return true;
137 return atom_indices[ 3 ];
152 return atom_indices[ 4 ];
165 if ( rsd.
name3() ==
" MG" )
return "MG ";
168 std::cerr <<
"Residue ??? " << rsd.
name3() << std::endl;
169 utility_exit_with_message(
"Do not know jump atom for this residue" );
177 using namespace core::chemical;
190 using namespace core::chemical;
205 using namespace core::chemical;
252 using namespace chemical;
258 atom_ids1.push_back(
" N1 "); atom_ids2.push_back(
" H3 ");
259 atom_ids1.push_back(
"1H6 "); atom_ids2.push_back(
" O4 ");
262 atom_ids1.push_back(
" H1 "); atom_ids2.push_back(
" N3 ");
263 atom_ids1.push_back(
"2H2 "); atom_ids2.push_back(
" O2 ");
264 atom_ids1.push_back(
" O6 "); atom_ids2.push_back(
"2H4 ");
267 atom_ids1.push_back(
" O6 "); atom_ids2.push_back(
" H3 ");
268 atom_ids1.push_back(
" H1 "); atom_ids2.push_back(
" O2 ");
271 atom_ids2.push_back(
" N1 "); atom_ids1.push_back(
" H3 ");
272 atom_ids2.push_back(
"1H6 "); atom_ids1.push_back(
" O4 ");
275 atom_ids2.push_back(
" H1 "); atom_ids1.push_back(
" N3 ");
276 atom_ids2.push_back(
"2H2 "); atom_ids1.push_back(
" O2 ");
277 atom_ids2.push_back(
" O6 "); atom_ids1.push_back(
"2H4 ");
280 atom_ids2.push_back(
" O6 "); atom_ids1.push_back(
" H3 ");
281 atom_ids2.push_back(
" H1 "); atom_ids1.push_back(
" O2 ");
292 if ( i < 1 )
return true;
308 static Real const CHAINBREAK_CUTOFF2 ( 2.5 * 2.5 );
311 if ( i < 1 )
return true;
319 Size atom_P = next_rsd.atom_index(
" P " );
321 ( current_rsd.atom( atom_O3star ).xyz() - next_rsd.atom( atom_P ).xyz() ).length_squared();
323 if ( dist2 > CHAINBREAK_CUTOFF2 ) {
337 static bool init(
false );
340 non_main_chain_sugar_atoms.clear();
341 non_main_chain_sugar_atoms.push_back(
" C2*" );
342 non_main_chain_sugar_atoms.push_back(
" C1*" );
343 non_main_chain_sugar_atoms.push_back(
" O4*" );
360 using namespace core::id;
365 kinematics::Stub const input_stub( rsd.xyz(
" C3*" ), rsd.xyz(
" C3*" ), rsd.xyz(
" C4*" ), rsd.xyz(
" C5*" ) );
370 for (
Size n = 1; n <= non_main_chain_sugar_atoms.size(); n++ ) {
371 Size const j = rsd.atom_index( non_main_chain_sugar_atoms[ n ] );
373 Vector v = rsd.xyz( non_main_chain_sugar_atoms[ n ] );
374 start_vectors.push_back( v );
377 Vector v2 = input_stub.local2global( non_main_chain_sugar_coords[ n ] );
381 for (
Size n = 1; n <= atoms_for_which_we_need_new_dofs.size(); n++ ) {
383 Size const j = rsd.atom_index( atoms_for_which_we_need_new_dofs[ n ] );
384 for (
Size m = 1; m <= which_dofs[n].size(); m++ ) {
387 new_dof_sets.push_back( dof_set );
394 for (
Size n = 1; n <= non_main_chain_sugar_atoms.size(); n++ ) {
395 Size const j = rsd.atom_index( non_main_chain_sugar_atoms[ n ] );
399 for (
Size n = 1; n <= atoms_for_which_we_need_new_dofs.size(); n++ ) {
400 Size const j = rsd.atom_index( atoms_for_which_we_need_new_dofs[ n ] );
402 for (
Size m = 1; m <= which_dofs[n].size(); m++ ) {
418 for (
Size j = 1; j < scratch_rsd->first_sidechain_atom(); j++ ){
419 scratch_rsd->set_xyz( j , start_rsd.
xyz( j ) );
423 kinematics::Stub const input_stub( scratch_rsd->xyz(
" C3*" ), scratch_rsd->xyz(
" C3*" ), scratch_rsd->xyz(
" C4*" ), scratch_rsd->xyz(
" C5*" ) );
425 for (
Size n = 1; n <= non_main_chain_sugar_atoms.size(); n++ ) {
427 Size const j = scratch_rsd->atom_index( non_main_chain_sugar_atoms[ n ] );
428 Vector v2 = input_stub.local2global( non_main_chain_sugar_coords[ n ] );
429 scratch_rsd->set_xyz( j, v2 );
432 Size const o2star_index( scratch_rsd->atom_index(
" O2*" ) );
433 scratch_rsd->set_xyz( o2star_index, scratch_rsd->build_atom_ideal( o2star_index, pose.
conformation() ) );
449 using namespace core::id;
450 using namespace core::conformation;
451 using namespace core::kinematics;
459 for (
Size n = 1; n <= atoms_for_which_we_need_new_dofs.size(); n++ ) {
460 Size const j = scratch_rsd->atom_index( atoms_for_which_we_need_new_dofs[ n ] );
467 if ( !input_stub_atom1)
continue;
468 if ( (input_stub_atom1->id()).rsd() != (current_atom->id()).rsd() )
continue;
469 if ( (input_stub_atom1->id()).atomno() > scratch_rsd->first_sidechain_atom() )
continue;
471 Real const d = ( scratch_rsd->xyz( (input_stub_atom1->id()).atomno() ) -
472 scratch_rsd->xyz( (current_atom->id()).atomno() ) ).length();
475 if ( input_stub_atom1->is_jump() )
continue;
478 if ( !input_stub_atom2)
continue;
479 if ( (input_stub_atom2->id()).rsd() != (current_atom->id()).rsd() )
continue;
480 if ( (input_stub_atom2->id()).atomno() > scratch_rsd->first_sidechain_atom() )
continue;
482 Real const theta = numeric::angle_radians(
483 scratch_rsd->xyz( (current_atom->id()).atomno() ) ,
484 scratch_rsd->xyz( (input_stub_atom1->id()).atomno() ),
485 scratch_rsd->xyz( (input_stub_atom2->id()).atomno() ) );
495 if ( !input_stub_atom3)
continue;
496 if ( (input_stub_atom3->id()).rsd() != (current_atom->id()).rsd() )
continue;
497 if ( (input_stub_atom3->id()).atomno() > scratch_rsd->first_sidechain_atom() )
continue;
499 Real const phi = numeric::dihedral_radians(
500 scratch_rsd->xyz( (current_atom->id()).atomno() ),
501 scratch_rsd->xyz( (input_stub_atom1->id()).atomno() ),
502 scratch_rsd->xyz( (input_stub_atom2->id()).atomno() ),
503 scratch_rsd->xyz( (input_stub_atom3->id()).atomno() ) );
518 using namespace core::id;
519 using namespace core::scoring::rna;
520 using namespace core::kinematics;
521 using namespace conformation;
538 atoms_for_which_we_need_new_dofs.push_back(
" C2*" );
539 atoms_for_which_we_need_new_dofs.push_back(
" C3*" );
540 atoms_for_which_we_need_new_dofs.push_back(
" O4*" );
541 atoms_for_which_we_need_new_dofs.push_back(
" C4*" );
542 atoms_for_which_we_need_new_dofs.push_back(
" C5*" );
543 atoms_for_which_we_need_new_dofs.push_back(
" O3*" );
545 }
else if ( (c2star_atom->parent()->id()).atomno() == (o2star_atom->id()).atomno() ) {
547 atoms_for_which_we_need_new_dofs.push_back(
" C1*" );
548 atoms_for_which_we_need_new_dofs.push_back(
" C3*" );
549 atoms_for_which_we_need_new_dofs.push_back(
" O4*" );
550 atoms_for_which_we_need_new_dofs.push_back(
" C4*" );
551 atoms_for_which_we_need_new_dofs.push_back(
" C5*" );
552 atoms_for_which_we_need_new_dofs.push_back(
" O3*" );
556 atoms_for_which_we_need_new_dofs.push_back(
" C1*" );
557 atoms_for_which_we_need_new_dofs.push_back(
" C2*" );
558 atoms_for_which_we_need_new_dofs.push_back(
" O4*" );
577 using namespace core::id;
578 using namespace core::scoring::rna;
586 start_torsions.push_back( reference_pose.
torsion( rna_torsion_id ) );
596 fix_sugar_coords( atoms_for_which_we_need_new_dofs, non_main_chain_sugar_coords, pose, reference_pose, i );
603 pose.
set_torsion( rna_torsion_id, start_torsions[ j ] );
629 non_main_chain_sugar_coords.push_back(
Vector( 0.329122, -0.190929, -1.476983 ) );
630 non_main_chain_sugar_coords.push_back(
Vector( -0.783512, -1.142556, -1.905737 ) );
631 non_main_chain_sugar_coords.push_back(
Vector( -1.928054, -0.731911, -1.195034 ) );
643 Real const cutoff_lower,
644 Real const cutoff_upper,
645 Real const fade_zone,
649 assert( fade_zone > 0 );
654 if (z < cutoff_lower || z > cutoff_upper ){
656 }
else if ( z < cutoff_lower + fade_zone ) {
658 Real const b = -1.0 * ( z - (cutoff_lower + fade_zone) )/ fade_zone;
660 Real const b3 = b2*
b;
661 fade_value = ( 2 * b3 - 3 * b2 + 1 );
662 fade_deriv = -1.0 * (6 * b2 - 6 *
b ) / fade_zone;
663 }
else if ( z > cutoff_upper - fade_zone ) {
665 Real const b = ( z - (cutoff_upper - fade_zone) )/ fade_zone;
667 Real const b3 = b2*
b;
668 fade_value = ( 2 * b3 - 3 * b2 + 1 );
669 fade_deriv = (6 * b2 - 6 *
b ) / fade_zone;
684 if( rsd.
is_RNA()==
false) utility_exit_with_message(
"rsd.is_RNA()==false");
694 utility_exit_with_message(
"rsd.RNA_info().o2star_index()!=rsd.first_sidechain_atom()");
697 if(verbose) std::cout <<
"Base atoms" << std::endl;
704 if(verbose) std::cout <<
" Virtual type: Ignore! " << std::endl;
708 if(verbose) std::cout << std::endl;
710 centroid += rsd.
xyz(i);
715 Vector dummy_centroid( 0.0 );
716 return dummy_centroid;
719 centroid /=
static_cast< Real >( numatoms );
733 using namespace chemical;
735 if( rsd.
is_RNA()==
false) utility_exit_with_message(
"rsd.is_RNA()==false");
743 if ( res_type ==
na_rad ) WC_atom =
" N1 ";
744 if ( res_type ==
na_rcy ) WC_atom =
" N3 ";
745 if ( res_type ==
na_rgu ) WC_atom =
" N1 ";
746 if ( res_type ==
na_ura ) WC_atom =
" N3 ";
748 Vector const WC_coord (rsd.
xyz( WC_atom ) );
749 x = WC_coord - centroid;
755 if ( res_type ==
na_rad ) H_atom =
"N7";
756 if ( res_type ==
na_rcy ) H_atom =
"C5";
757 if ( res_type ==
na_rgu ) H_atom =
"N7";
758 if ( res_type ==
na_ura ) H_atom =
"C5";
760 Vector const H_coord (rsd.
xyz( H_atom ) );
761 y = H_coord - centroid;
784 if(Is_base_phosphate_atom_pair){
786 utility_exit_with_message(
"Is_base_phosphate_atom_pair but rsd.path_distance( " + ObjexxFCL::string_of(atomno_1) +
" , " + ObjexxFCL::string_of(atomno_2) +
" ) < 4");