37 #include <utility/vector1.hh>
196 return ( i==1 || i==2 || i==3 || i==4 || i==9 );
236 using namespace etable::count_pair;
241 CountPairFactory::create_count_pair_function( rsd1, rsd2,
CP_CROSSOVER_4 );
243 for (
Size i=1, i_end = rsd1.
natoms(); i<= i_end; ++i ) {
249 bool const atom1_is_base =
is_base(rsd1, i);
250 bool const atom1_is_sugar =
is_sugar(rsd1, i);
252 assert( atom1_is_base || atom1_is_sugar || atom1_is_phosphate );
256 if ( i_charge == 0.0 )
continue;
257 for (
Size j=1, j_end = rsd2.
natoms(); j<= j_end; ++j ) {
259 if ( j_charge == 0.0 )
continue;
262 if ( cpfxn->count( i, j, weight, path_dist ) ) {
263 Real score = weight *
266 total_score += score;
268 bool const atom2_is_base =
is_base(rsd2, j);
269 bool const atom2_is_sugar =
is_sugar(rsd2, j);
271 assert( atom2_is_base || atom2_is_sugar || atom2_is_phosphate );
273 if ( atom1_is_base && atom2_is_base ) {
275 }
else if ( (atom1_is_base && atom2_is_sugar) || (atom1_is_sugar && atom2_is_base) ) {
277 }
else if ( (atom1_is_base && atom2_is_phosphate) || (atom1_is_phosphate && atom2_is_base) ) {
279 }
else if ( (atom1_is_sugar && atom2_is_phosphate) || (atom1_is_phosphate && atom2_is_sugar) ) {
281 }
else if ( (atom1_is_sugar && atom2_is_sugar) ) {
283 }
else if ( (atom1_is_phosphate && atom2_is_phosphate) ) {
286 std::cout <<
"PROBLEM! " << rsd1.
atom_name( i ) <<
" " << rsd2.
atom_name( j ) << std::endl;
303 ObjexxFCL::FArray2D< core::PackerEnergy > & energy_table
339 using namespace etable::count_pair;
342 Size const pos1( atom_id.
rsd() );
346 if ( ! rsd1.is_RNA() )
return;
348 Real const i_charge( rsd1.atomic_charge( i ) );
349 int const pos1_map( domain_map( pos1 ) );
350 bool const pos1_fixed( pos1_map != 0 );
353 if ( i_charge == 0.0 )
return;
361 EnergyGraph const & energy_graph( energies.energy_graph() );
369 iru = energy_graph.get_node( pos1 )->const_edge_list_begin(),
371 iru != irue; ++iru ) {
374 Size const pos2( (*iru)->get_other_ind( pos1 ) );
376 if ( pos1_fixed && pos1_map == domain_map( pos2 ) )
continue;
380 assert( pos2 != pos1 );
382 if ( rsd2.is_RNA() ) {
403 using namespace etable::count_pair;
414 bool const atom1_is_base =
is_base(rsd1, i);
415 bool const atom1_is_sugar =
is_sugar(rsd1, i);
417 assert( atom1_is_base || atom1_is_sugar || atom1_is_phosphate );
419 for (
Size j=1, j_end = rsd2.
natoms(); j<= j_end; ++j ) {
421 if ( j_charge == 0.0 )
continue;
424 if ( cpfxn->count( i, j, weight, path_dist ) ) {
426 Vector const f2( i_xyz - j_xyz );
427 Real const dis2( f2.length_squared() );
428 Real const dE_dr_over_r = weight *
430 if ( dE_dr_over_r != 0.0 ) {
431 Vector const f1( i_xyz.cross( j_xyz ) );
435 bool const atom2_is_base =
is_base(rsd2, j);
436 bool const atom2_is_sugar =
is_sugar(rsd2, j);
438 assert( atom2_is_base || atom2_is_sugar || atom2_is_phosphate );
440 if ( atom1_is_base && atom2_is_base ) {
443 }
else if ( (atom1_is_base && atom2_is_sugar) || (atom1_is_sugar && atom2_is_base) ) {
446 }
else if ( (atom1_is_base && atom2_is_phosphate) || (atom1_is_phosphate && atom2_is_base) ) {
449 }
else if ( (atom1_is_sugar && atom2_is_phosphate) || (atom1_is_phosphate && atom2_is_sugar) ) {
452 }
else if ( (atom1_is_sugar && atom2_is_sugar) ) {
455 }
else if ( (atom1_is_phosphate && atom2_is_phosphate) ) {