31 #include <basic/Tracer.hh>
35 #include <utility/vector1.hh>
40 namespace interaction_graph {
42 bool const debug = {
false };
43 static basic::Tracer
T(
"core.pack.interaction_graph.otf_ig", basic::t_error );
55 rotamers_( num_states ),
56 sc_bounding_spheres_( num_states, std::make_pair(
Vector( 0.0 ),
Real( 0.0 ) ) ),
57 bb_bounding_sphere_( std::make_pair(
Vector( 0.0 ),
Real( 0.0 ) )),
59 num_restype_groups_( 0 ),
61 one_body_energies_( num_states, 0.0 ),
62 distinguish_backbone_and_sidechain_( false )
85 for (
Size ii = 1; ii <= rotamer_set_->num_rotamers(); ++ii ) {
86 rotamers_[ ii ] = rotamer_set_->rotamer( ii );
99 for (
Size ii = 1; ii <= nsubunits; ++ii ) {
111 Size curr_restype_group = 1;
112 Size count_for_restype_group = 1;
113 Size const num_restype_groups = rotamers->get_n_residue_groups();
118 ++count_for_restype_group;
119 while ( count_for_restype_group > rotamers->get_n_rotamers_for_residue_group( curr_restype_group )) {
121 ++curr_restype_group;
122 count_for_restype_group = 1;
123 if ( curr_restype_group > num_restype_groups )
break;
133 utility_exit_with_message(
"ERROR:: Must set distinguish_backbone_and_sidechain before adding edges" );
216 int edge_making_energy_request,
221 using namespace scoring;
222 using namespace scoring::methods;
224 Size const asu_index = 1;
234 Size this_restype_group =
rotamer_set_->get_residue_group_index_for_rotamer( state_this );
235 Size other_restype_group = neighbor.
rotamer_set_->get_residue_group_index_for_rotamer( state_other );
239 for (
Size ii = 1; ii <= 2; ++ii ) {
241 Size ii_restype_group = which_way_is_up ? this_restype_group : other_restype_group;
242 Size jj_restype_group = which_way_is_up ? other_restype_group : this_restype_group;
244 for (
Size jj = 1; jj <= nsubunits; ++jj ) {
257 Size this_subunit = ii == 1 ? asu_index : jj;
258 Size other_subunit = ii == 1 ? jj : asu_index;
274 this_rotamer, other_rotamer,
275 this_sc_bounding_sphere.first, other_sc_bounding_sphere.first,
276 this_sc_bounding_sphere.second, other_sc_bounding_sphere.second,
371 std::cout <<
"this cbeta: " << this_rotamer.
xyz(
"CB" ).x() <<
" " << this_rotamer.
xyz(
"CB" ).y() <<
" " << this_rotamer.
xyz(
"CB" ).z();
372 std::cout <<
"; other cbeta: " << other_rotamer.xyz(
"CB" ).x() <<
" " << other_rotamer.xyz(
"CB" ).y() <<
" " << other_rotamer.xyz(
"CB" ).z() << std::endl;;
381 Size lr_iijj_score_multiply( iijj_score_multiply );
382 if ( lr_iijj_score_multiply == 0 ) {
384 this_rotamer.
seqpos(), other_rotamer.seqpos() );
386 if ( lr_iijj_score_multiply != 0 ) {
390 iter != iter_end; ++iter ) {
391 (*iter)->residue_pair_energy(
392 this_rotamer, other_rotamer,
431 if ( subunit == 1 ) {
435 int state_aa =
rotamer_set_->get_residue_type_index_for_rotamer( state );
443 assert( &rotamer.
type() == & asymm_rotamer.
type() );
447 rotamer.
chi() = asymm_rotamer.
chi();
451 for (
Size ii = 1, iiend = rotamer.
natoms(); ii <= iiend; ++ii ) {
452 rotamer.
set_xyz( ii, transform * asymm_rotamer.
xyz( ii ) );
469 return transformed_bs;
478 return transformed_bs;
490 FixedBBEdge( owner, first_node_ind, second_node_ind ),
491 restypegroup_adjacency_(
494 get_otf_owner()->symm_info()->subunits(),
498 long_range_interactions_exist_( false ),
499 short_range_interactions_exist_( false )
501 bool distinguish_sc_bb[ 2 ];
502 for (
int ii = 0; ii < 2; ++ii) {
508 if ( distinguish_sc_bb[ 0 ] && distinguish_sc_bb[ 1 ] ) {
510 }
else if ( ! distinguish_sc_bb[ 0 ] && distinguish_sc_bb[ 1 ] ) {
513 }
else if ( distinguish_sc_bb[ 0 ] && ! distinguish_sc_bb[ 1 ] ) {
526 int node_not_necessarily_proline,
539 sc_probb_E + 0.5 * bb_probb_E -
540 (sc_nonprobb_E + 0.5 * bb_nonprobb_E);
552 return total_memory_usage;
558 int other_node_subunit
561 if ( asu_node_index == 2 && other_node_subunit == 1 )
return;
565 int const asu_index = 1;
568 if ( score_multiply == 0 )
return;
573 int other_node_index = ( asu_node_index == 1 ) ? 2 : 1;
586 if ( d2 < (sfxn_reach + ii_jj_radii_sum )*(sfxn_reach + ii_jj_radii_sum ) ) {
598 int other_node_subunit,
599 int whichnode_restypegroup,
600 int othernode_restypegroup
603 return restypegroup_adjacency_( othernode_restypegroup, whichnode_restypegroup, other_node_subunit, which_node );
611 num_restype_groups_( 0 )
638 Size max_nrestypes = 0;
641 if ( ii_nrestypes > max_nrestypes ) max_nrestypes = ii_nrestypes;
660 if (
pose_ ) (*score_function_)(*pose_);
672 SymmetricConformation & symm_conf ( dynamic_cast<SymmetricConformation &> ( pose_->conformation()) );
679 assert( nsubunits > 0 );
684 Size orientation_residue = 0;
685 for (
Size ii = 1; ii <= asu_size; ++ii ) {
687 orientation_residue = ii;
691 if ( orientation_residue == 0 ) {
694 utility_exit_with_message(
"Failed to find a residue in the pose with at least three atoms" );
698 pose.
xyz( AtomID( 1, orientation_residue )),
699 pose.
xyz( AtomID( 2, orientation_residue )),
700 pose.
xyz( AtomID( 3, orientation_residue )) );
701 HTReal invframe1 = frame1.inverse();
702 for (
Size ii = 2; ii <= nsubunits; ++ii ) {
703 Size iiresidue = orientation_residue + (ii-1)*asu_size;
705 pose.
xyz( AtomID( 1, iiresidue )),
706 pose.
xyz( AtomID( 2, iiresidue )),
707 pose.
xyz( AtomID( 3, iiresidue )) );
760 int other_node_subunit
800 int node_not_neccessarily_proline,
812 node_not_neccessarily_proline, state,
813 bb_nonprobb_E, bb_probb_E, sc_nonprobb_E, sc_probb_E );