33 #include <utility/vector1.hh>
34 #include <numeric/xyzVector.hh>
38 #include <basic/Tracer.hh>
40 #include <numeric/random/random.hh>
42 #include <ObjexxFCL/string.functions.hh>
43 #include <ObjexxFCL/format.hh>
54 static numeric::random::RandomGenerator
RG(29111);
56 static basic::Tracer
TR(
"protocols.swa.monte_carlo.rna_swa_monte_carlo_mover" ) ;
60 namespace monte_carlo {
69 rna_add_or_delete_mover_( rna_add_or_delete_mover ),
70 rna_torsion_mover_( rna_torsion_mover ),
71 rna_o2star_mover_( rna_o2star_mover ),
72 scorefxn_( scorefxn ),
74 output_period_( 5000 ),
75 sample_range_small_( 5.0 ),
76 sample_range_large_( 50.0 ),
78 do_add_delete_( true ),
95 using namespace protocols::moves;
104 Real const random_number =
RG.uniform();
110 if ( (random_number < 0.01 &&
do_add_delete_) || moving_res_list.size() == 0 ) {
114 if ( move_type.size() == 0 && random_number < 0.8 ){
116 Real const random_number2 =
RG.uniform();
117 if ( random_number2 < 0.5 ){
128 monte_carlo->boltzmann( pose, move_type );
133 std::cout <<
"On " << count <<
" of " <<
num_cycles_ <<
" trials." << std::endl;
139 monte_carlo->show_counters();
140 monte_carlo->recover_low( pose );
162 using namespace core::io::silent;
163 using namespace core::conformation;
164 using namespace ObjexxFCL;
168 std::map< Size, Size > sub_to_full = sub_to_full_info.sub_to_full();
172 for (
Size i = 1; i <= pose.
total_residue(); i++ ) is_working_res.push_back(
false );
173 for (
Size n = 1; n <= working_res_list.size(); n++ ) is_working_res[ working_res_list[n] ] =
true;
175 std::string const tag =
"S_"+lead_zero_string_of(count,6);
184 for (
Size n = 1; n <= working_res_list.size(); n++ ){
185 Size const i = working_res_list[ n ];
186 Size const i_full = sub_to_full[ i ];
191 Residue const & rsd_native = native_pose.residue( i_full );
193 if ( rsd.
aa() != rsd_native.
aa() ) std::cout <<
"mismatch: pose " << i <<
' ' << rsd.
aa() <<
" native " << i_full << rsd_native.
aa() << std::endl;
194 runtime_assert( rsd.
aa() == rsd_native.
aa() );
200 if ( !rsd_native.
has( atom_name ) )
continue;
202 dev += ( rsd_native.
xyz( j_full ) - rsd.
xyz( j ) ).length_squared();
208 Size const i_next = i+1;
209 Size const i_next_full = sub_to_full[ i+1 ];
210 runtime_assert( i_next_full == i_full + 1 );
213 Residue const & rsd_next_native = native_pose.residue( i_next_full );
214 runtime_assert( rsd_next.
aa() == rsd_next_native.
aa() );
220 runtime_assert( rsd_next.
has( atom_name ) );
221 runtime_assert( rsd_next_native.
has( atom_name ) );
224 dev += ( rsd_next_native.
xyz( j_full ) - rsd_next.
xyz( j ) ).length_squared();
231 if ( natoms > 0 ) rmsd = std::sqrt( dev / static_cast<Real>( natoms ) );
237 if ( working_res_list.size() == 0 ) {
240 built_res += string_of( working_res_list[1] );
241 for (
Size n = 2; n <= working_res_list.size(); n++ ) built_res +=
"-"+string_of( sub_to_full[ working_res_list[n] ] );
252 return "RNA_SWA_MonteCarloMover";