46 #include <basic/database/open.hh>
54 #include <utility/file/file_sys_util.hh>
58 #include <basic/Tracer.hh>
60 #include <numeric/random/random.hh>
76 #include <utility/vector1.hh>
77 #include <ObjexxFCL/format.hh>
79 using namespace ObjexxFCL::fmt;
95 namespace coarse_rna {
97 static numeric::random::RandomGenerator
RG(129920);
99 static basic::Tracer
TR(
"protocols.coarse_rna.coarse_rna_denovo_protocol" ) ;
101 CoarseRNA_DeNovoProtocol::CoarseRNA_DeNovoProtocol(
103 Size const monte_carlo_cycles,
107 monte_carlo_cycles_( monte_carlo_cycles ),
109 silent_file_( silent_file ),
110 freeze_domains_( false ),
112 domain_move_frequency_( 0.0 ),
113 m_Temperature_( 5.0 ),
115 staged_constraints_( false ),
117 rna_params_file_(
"" ),
118 rna_data_file_(
"" ),
119 all_rna_fragments_file_( basic::database::full_name(
"1jj2_coarse_coords.txt") ),
120 jump_library_file_( basic::database::full_name(
"chemical/rna/1jj2_coarse_jumps.dat" ) ),
121 lores_scorefxn_(
"coarse_rna.wts" ),
122 rna_structure_parameters_( new protocols::rna::RNA_StructureParameters ),
123 rna_data_reader_( new protocols::rna::RNA_DataReader ),
125 close_loops_( false ),
126 choose_best_solution_( false ),
127 force_ideal_chainbreak_( false ),
128 add_base_pair_constraints_( true ),
129 view_monte_carlo_( false )
131 Mover::type(
"CoarseRNA_DeNovoProtocol");
148 using namespace core::pose;
149 using namespace core::scoring;
150 using namespace core::io::pdb;
151 using namespace core::io::silent;
197 std::cout <<
"FOLD TREE " << pose.
fold_tree();
199 Pose start_pose = pose;
210 std::string const out_file_tag =
"S_"+lead_zero_string_of( n, 6 );
219 TR <<
"Beginning main loop... " << std::endl;
223 clock_t
const time_start( clock() );
248 TR <<
"All atom rmsd: " << rmsd << std::endl;
259 TR <<
"Finished fragment assembly of " << out_file_tag <<
" in " <<
static_cast<Real>( clock() - time_start ) / CLOCKS_PER_SEC <<
" seconds. " << std::endl;
271 return "CoarseRNA_DeNovoProtocol¯";
283 std::cout <<
"Will set temperature to: " << temperature << std::endl;
292 using namespace core::io::silent;
302 std::cout <<
"Already done: " << *iter << std::endl;
314 using namespace core::io::silent;
315 using namespace core::scoring;
318 TR <<
"Making silent struct for " << out_file_tag << std::endl;
327 Real rmsd_stems( 0.0 );
328 if ( stem_residues.size() > 0 ) {
330 TR <<
"All atom rmsd over stems: " << rmsd_stems <<
" for " << out_file_tag << std::endl;
336 silent_file_data.write_silent_struct( s, silent_file, score_only );
362 for ( std::map< Size, Size >::const_iterator it = pairs.begin();
363 it != pairs.end(); it ++ ) {
364 Size const i = it->first;
365 Size const j = it->second;
367 pose.
xyz( NamedAtomID(
" CEN", j ) ) ).length() );
383 for ( std::map< Size, Size >::const_iterator it = pairs.begin();
384 it != pairs.end(); it ++ ) {
385 Size const i = it->first;
386 Size const j = it->second;
387 Real const dist_new = ( pose.
xyz( NamedAtomID(
" CEN", i ) ) -
388 pose.
xyz( NamedAtomID(
" CEN", j ) ) ).length();
391 std::cout <<
"AFTER frag insert at " << frag_pos <<
" CHANGED PAIRING " << i <<
" " << j << std::endl;
396 if ( !OK ) std::cout << pose.
fold_tree() << std::endl;
436 Size const dummy_pos( 0 );
452 Real const suppress = ( r )/(rounds - 2.0);
454 Size separation_cutoff =
static_cast< Size > ( suppress * max_dist ) + 2;
455 if ( separation_cutoff > max_dist ) separation_cutoff = max_dist;
457 return separation_cutoff;
466 using namespace core::scoring::constraints;
476 TR <<
"ROUND " << r <<
" out of " << rounds << std::endl;
477 TR <<
"FOLD_TREE CURRENT SEPARATION CUTOFF " << separation_cutoff <<
" out of " << shortest_path_in_fold_tree.max_dist() << std::endl;
481 for (
Size n = 1; n <= csts.size(); n++ ) {
485 if ( cst->natoms() == 2 ) {
486 Size const i = cst->atom( 1 ).rsd();
487 Size const j = cst->atom( 2 ).rsd();
488 Size const dist( shortest_path_in_fold_tree.dist( i , j ) );
489 if ( dist > separation_cutoff )
continue;
492 cst_set_new->add_constraint( cst );
497 TR <<
"NUM CONSTRAINTS " << pose.
constraint_set()->get_all_constraints().size() <<
" out of " <<
498 csts.size() << std::endl;
506 Real const scale_factor = (
static_cast<Real>( rounds - r + 1) / rounds );
507 Real const rot_mag = 5.0 * scale_factor;
508 Real const trans_mag = 1.0 * scale_factor;
518 using namespace core::scoring;