22 #include <basic/Tracer.hh>
28 #include <utility/vector1.hh>
29 #include <ObjexxFCL/FArray1A.hh>
34 namespace interaction_graph {
36 using namespace ObjexxFCL;
38 basic::Tracer
TR(
"protocols.flexpack.interaction_graph" );
45 parent( owner, node_id, num_states ),
46 num_aa_types_( get_flexbbig_owner()->get_num_aa_types() ),
48 num_states_for_bb_( 1, num_states ),
49 state_offsets_for_bb_( 1, 0 ),
50 state_info_( num_states + 1 ),
51 one_body_energies_( num_states, 0.0 ),
53 curr_state_one_body_energy_( 0.0 ),
54 curr_state_total_energy_( 0.0 ),
55 alternate_state_( 0 ),
56 alternate_state_one_body_energy_( 0.0 ),
57 alternate_state_total_energy_( 0.0 ),
58 alternate_state_is_being_considered_( false )
79 std::cout << std::endl;
85 assert( nbbconfs > 0 );
108 for (
int ii = 2; ii <=
num_bb_; ++ii ) {
137 int rotamer_number_offset
140 Size const initial_size = rotlist.size();
142 if ( currbb == 0 ) currbb = 1;
155 Size const initial_size = state_list.size();
158 state_list.push_back( offset + ii );
167 for (
int jj = 1; jj <=
num_bb_; ++jj ) {
170 " has no close alternate state on backbone " << jj << std::endl;
174 std::cerr <<
"ALT STATE ON CLOSEST BB OUT OF RANGE: " << ii <<
" " << jj <<
" " <<
closest_state_on_alt_bb_( jj, ii ) << std::endl;
185 int state_index_for_aa = 1;
188 assert( aatypes[ ii ] > 0 );
189 if ( aatypes[ ii ] != last_aa ) {
190 int temp_last_aa = last_aa;
191 last_aa = aatypes[ ii ];
195 + state_index_for_aa;
197 state_index_for_aa = 1;
200 state_info_[ ii ].set_state_ind_for_this_aa_type( state_index_for_aa );
406 if ( new_state != 0 ) {
464 parent( owner, first_node_ind, second_node_ind ),
465 nodes_part_of_same_flexseg_( get_flexbbig_owner()->nodes_from_same_flexseg( first_node_ind, second_node_ind ) ),
468 alt_e_up_to_date_( true ),
469 nodes_considering_bb_move_( false )
583 total_energy_current_state_assignment_( 0.0 ),
584 total_energy_alternate_state_assignment_( 0.0 ),
585 node_considering_alt_state_( 0 ),
586 flexseg_considering_alt_bb_( 0 ),
587 num_flexible_segments_( 0 ),
589 flexseg_for_moltenres_( num_nodes, 0 ),
590 enforce_bb_contiguity_( true ),
591 last_considered_backbone_sub_valid_( true ),
592 last_considered_backbone_sub_unresolved_( false ),
593 last_considered_fixedbb_sub_unresolved_( false ),
594 num_nodes_changing_state_( 0 ),
595 num_commits_since_last_update_( 0 )
601 using namespace rotamer_set;
602 using namespace core::conformation;
603 using namespace core;
605 assert( dynamic_cast< FlexbbRotamerSets const * > ( & rot_sets ) );
629 if ( flexseg_id < num_flexible_segments_ && ii >
flexseg_bb_offset_[ flexseg_id + 1 ] ) {
639 Size max_nresgroups = 0;
644 if ( jj_nresgroups > max_nresgroups ) max_nresgroups = jj_nresgroups;
661 Size curr_resgroup = 1;
662 Size count_for_resgroup = 1;
665 for (
Size jj = 1; jj <= ii_num_states; ++jj ) {
669 count_for_resgroup = 1;
671 aatype_for_state[ jj ] = curr_resgroup;
672 ++count_for_resgroup;
673 while ( count_for_resgroup > flex_sets.
rotset_for_moltenres( ii, which_bb )->get_n_rotamers_for_residue_group( curr_resgroup )) {
676 count_for_resgroup = 1;
677 if ( curr_resgroup > ii_nresgroups )
break;
687 if ( ii_nbb == 1 )
continue;
690 for (
Size jj = 1; jj <= ii_nbb; ++jj ) {
693 for (
Size kk = 1; kk <= ii_nbb; ++kk ) {
695 if ( jj == kk )
continue;
699 if ( ll == 1 || jj_flexset->rotamer( ll )->name() != jj_flexset->rotamer( ll - 1 )->name() ) {
700 kk_rotamers_matching_ll.clear();
701 for (
Size mm = 1; mm <= kk_flexset->num_rotamers(); ++mm ) {
702 if ( jj_flexset->rotamer( ll )->name() == kk_flexset->rotamer( mm )->name() ) {
703 kk_rotamers_matching_ll.push_back( mm );
707 ResidueCOP llrotop = jj_flexset->rotamer( ll );
708 Residue const & llrot( *llrotop );
711 Size best_match_index( 0 );
712 Real best_rms( 12345 );
713 for (
Size mm = 1; mm <= kk_rotamers_matching_ll.size(); ++mm ) {
714 Size const mm_rotid = kk_rotamers_matching_ll[ mm ];
715 ResidueCOP mmrotop = kk_flexset->rotamer( mm_rotid );
716 Residue const & mmrot( *mmrotop );
717 assert( llrot.
name() == mmrot.
name() );
720 for (
Size nn = 1; nn <= llrot.
natoms(); ++nn ) {
721 mm_rms += llrot.
xyz( nn ).distance_squared( mmrot.
xyz( nn ));
723 if ( mm == 1 || best_rms > mm_rms ) {
724 best_match_index = mm_rotid;
728 best_match( kk, ll + jjoffset ) =
817 FArray2D_int
const & closest_states
862 for (
Size ii = 1; ii <= bblist.size(); ++ii ) {
957 for (std::list<EdgeBase*>::iterator