14 #include <core/types.hh>
15 #include <core/chemical/util.hh>
16 #include <core/scoring/ScoringManager.hh>
17 #include <core/scoring/ScoreFunctionFactory.hh>
18 #include <core/scoring/ScoreFunction.hh>
19 #include <core/init/init.hh>
20 #include <core/pose/Pose.hh>
21 #include <core/pose/full_model_info/FullModelInfo.hh>
22 #include <core/pose/full_model_info/util.hh>
23 #include <core/pose/util.hh>
24 #include <core/io/rna/RNA_DataReader.cc>
25 #include <protocols/stepwise/setup/FullModelInfoSetupFromCommandLine.hh>
26 #include <protocols/stepwise/setup/StepWiseJobDistributor.hh>
27 #include <protocols/stepwise/setup/StepWiseCSA_JobDistributor.hh>
28 #include <protocols/stepwise/setup/StepWiseMonteCarloJobDistributor.hh>
29 #include <protocols/stepwise/monte_carlo/StepWiseMonteCarlo.hh>
30 #include <protocols/stepwise/monte_carlo/options/StepWiseMonteCarloOptions.hh>
31 #include <protocols/stepwise/monte_carlo/util.hh>
32 #include <protocols/stepwise/modeler/util.hh>
33 #include <protocols/stepwise/modeler/file_util.hh>
34 #include <protocols/stepwise/modeler/rna/util.hh>
35 #include <protocols/stepwise/monte_carlo/submotif/SubMotifLibrary.hh>
36 #include <protocols/viewer/viewers.hh>
39 #include <basic/options/keys/score.OptionKeys.gen.hh>
41 #include <basic/options/keys/chemical.OptionKeys.gen.hh>
42 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
43 #include <basic/options/keys/in.OptionKeys.gen.hh>
44 #include <basic/options/keys/full_model.OptionKeys.gen.hh>
45 #include <basic/options/keys/out.OptionKeys.gen.hh>
46 #include <basic/options/keys/rna.OptionKeys.gen.hh>
47 #include <basic/options/keys/stepwise.OptionKeys.gen.hh>
64 using namespace protocols;
66 using namespace basic::options::OptionKeys;
67 using namespace basic::options::OptionKeys::stepwise::monte_carlo;
77 using namespace core::scoring;
78 using namespace core::chemical;
79 using namespace core::pose::full_model_info;
80 using namespace protocols::stepwise;
81 using namespace protocols::stepwise::modeler;
82 using namespace protocols::stepwise::monte_carlo::submotif;
83 using namespace protocols::stepwise::setup;
84 using namespace protocols::stepwise::monte_carlo;
85 using namespace protocols::stepwise::monte_carlo::mover;
87 using namespace utility::file;
89 bool const just_RNA = just_modeling_RNA(
option[ in::file::fasta ]() );
90 ResidueTypeSetCAP rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set( FA_STANDARD );
94 else if (
option[ OptionKeys::stepwise::lores ]() && !
option[ OptionKeys::rna::farna::minimize_rna ]() ) {
95 scorefxn = ScoreFunctionFactory::create_score_function(
"stepwise/rna/rna_lores_for_stepwise.wts" );
96 }
else if ( just_RNA )
scorefxn = ScoreFunctionFactory::create_score_function(
"stepwise/rna/rna_res_level_energy.wts" );
97 else scorefxn = ScoreFunctionFactory::create_score_function(
"stepwise/stepwise_res_level_energy.wts" );
101 PoseOP pose_op = initialize_pose_and_other_poses_from_command_line( rsd_set );
103 initialize_native_and_align_pose(
native_pose, align_pose, rsd_set, pose_op );
105 core::io::rna::get_rna_data_info(
pose,
option[ basic::options::OptionKeys::rna::data_file ](),
scorefxn );
111 StepWiseMove
const test_move(
option[ OptionKeys::stepwise::move ](), const_full_model_info(
pose ).full_model_parameters() );
114 if (
pose.total_residue() > 0 && test_move.move_type() == NO_MOVE ) ( *
scorefxn )(
pose );
115 Vector center_vector = ( align_pose != 0 ) ? get_center_of_mass( *align_pose ) :
Vector( 0.0 );
116 protocols::viewer::add_conformation_viewer (
pose.conformation(),
"current", 500, 500,
false, ( align_pose != 0 ), center_vector );
119 stepwise_monte_carlo->set_native_pose( align_pose );
120 stepwise_monte_carlo->set_move( test_move );
122 StepWiseMonteCarloOptionsOP
options(
new StepWiseMonteCarloOptions );
123 options->initialize_from_command_line();
124 stepwise_monte_carlo->set_options( options );
125 if ( ( options->from_scratch_frequency() > 0.0 || const_full_model_info( *pose_op ).other_pose_list().size() > 0 ) && !
scorefxn->has_nonzero_weight( other_pose ) )
scorefxn->set_weight( other_pose, 1.0 );
128 if (
option[ out::overwrite ]() ) remove_silent_file_if_it_exists( silent_file );
129 stepwise_monte_carlo->set_out_path(
FileName( silent_file ).
path() );
130 stepwise_monte_carlo->set_submotif_library( SubMotifLibraryCOP(
new SubMotifLibrary( rsd_set, options->lores() , options->use_first_jump_for_submotif() ) ) );
133 StepWiseJobDistributorOP stepwise_job_distributor(
new StepWiseMonteCarloJobDistributor( stepwise_monte_carlo, silent_file,
option[
out::nstruct ]() ) );
135 stepwise_job_distributor = StepWiseJobDistributorOP(
new StepWiseCSA_JobDistributor( stepwise_monte_carlo, silent_file,
option[
out::nstruct ](),
option[ csa::csa_bank_size ](),
option[ csa::csa_rmsd ](),
option[ csa::csa_output_rounds ]() ) );
137 stepwise_job_distributor->set_native_pose(
native_pose );
138 stepwise_job_distributor->set_superimpose_over_all(
option[ OptionKeys::stepwise::superimpose_over_all ]() );
139 stepwise_job_distributor->initialize(
pose );
141 while ( stepwise_job_distributor->has_another_job() ) {
142 stepwise_job_distributor->apply(
pose );
151 clock_t
const my_main_time_start( clock() );
153 protocols::viewer::clear_conformation_viewers();
154 std::cout <<
"Total time to run " <<
static_cast<Real>( clock() - my_main_time_start ) / CLOCKS_PER_SEC <<
" seconds." << std::endl;
161 main(
int argc,
char * argv [] )
164 std::cout << std::endl <<
"Basic usage: " << argv[0] <<
" -fasta <fasta file with sequence> -s <start pdb> -input_res <input pdb1> [ -native <native pdb file> ] " << std::endl;
165 std::cout << std::endl <<
" Type -help for full slate of options." << std::endl << std::endl;
167 option.add_relevant( in::file::fasta );
168 option.add_relevant( in::file::input_res );
171 option.add_relevant( out::overwrite );
175 option.add_relevant( OptionKeys::full_model::other_poses );
176 option.add_relevant( OptionKeys::full_model::jump_res );
177 option.add_relevant( OptionKeys::full_model::root_res );
178 option.add_relevant( OptionKeys::full_model::virtual_sugar_res );
179 option.add_relevant( OptionKeys::full_model::cutpoint_open );
180 option.add_relevant( OptionKeys::full_model::cutpoint_closed );
181 option.add_relevant( OptionKeys::full_model::sample_res );
182 option.add_relevant( OptionKeys::full_model::motif_mode );
183 option.add_relevant( OptionKeys::full_model::rna::force_syn_chi_res_list );
184 option.add_relevant( OptionKeys::full_model::rna::bulge_res );
185 option.add_relevant( OptionKeys::full_model::extra_min_res );
186 option.add_relevant( OptionKeys::full_model::rna::terminal_res );
187 option.add_relevant( OptionKeys::full_model::rna::block_stack_above_res );
188 option.add_relevant( OptionKeys::full_model::rna::block_stack_below_res );
190 option.add_relevant( OptionKeys::stepwise::monte_carlo::skip_deletions );
191 option.add_relevant( OptionKeys::stepwise::monte_carlo::add_delete_frequency );
192 option.add_relevant( OptionKeys::stepwise::monte_carlo::minimize_single_res_frequency );
193 option.add_relevant( OptionKeys::stepwise::monte_carlo::switch_focus_frequency );
194 option.add_relevant( OptionKeys::stepwise::monte_carlo::just_min_after_mutation_frequency );
195 option.add_relevant( OptionKeys::stepwise::monte_carlo::submotif_frequency );
196 option.add_relevant( OptionKeys::stepwise::monte_carlo::allow_internal_hinge_moves );
197 option.add_relevant( OptionKeys::stepwise::monte_carlo::allow_internal_local_moves );
198 option.add_relevant( OptionKeys::stepwise::monte_carlo::allow_skip_bulge );
199 option.add_relevant( OptionKeys::stepwise::monte_carlo::temperature );
200 option.add_relevant( OptionKeys::stepwise::monte_carlo::allow_variable_bond_geometry );
201 option.add_relevant( OptionKeys::stepwise::monte_carlo::csa::csa_bank_size );
202 option.add_relevant( OptionKeys::stepwise::monte_carlo::csa::csa_rmsd );
203 option.add_relevant( OptionKeys::stepwise::monte_carlo::csa::csa_output_rounds );
204 option.add_relevant( OptionKeys::stepwise::superimpose_over_all );
205 option.add_relevant( OptionKeys::stepwise::move );
206 option.add_relevant( OptionKeys::stepwise::num_random_samples );
207 option.add_relevant( OptionKeys::stepwise::num_pose_minimize );
208 option.add_relevant( OptionKeys::stepwise::align_pdb );
209 option.add_relevant( OptionKeys::stepwise::enumerate );
210 option.add_relevant( OptionKeys::stepwise::preminimize );
211 option.add_relevant( OptionKeys::stepwise::atr_rep_screen );
213 option.add_relevant( OptionKeys::stepwise::min_tolerance );
214 option.add_relevant( OptionKeys::stepwise::virtualize_free_moieties_in_native );
215 option.add_relevant( OptionKeys::stepwise::new_move_selector );
216 option.add_relevant( OptionKeys::stepwise::rna::erraser );
217 option.add_relevant( OptionKeys::stepwise::rna::force_centroid_interaction );
218 option.add_relevant( OptionKeys::stepwise::rna::rebuild_bulge_mode );
219 option.add_relevant( OptionKeys::stepwise::rna::integration_test );
220 option.add_relevant( OptionKeys::stepwise::protein::allow_virtual_side_chains );
221 option.add_relevant( OptionKeys::rna::corrected_geo );
222 option.add_relevant( OptionKeys::rna::data_file );
226 protocols::viewer::viewer_main(
my_main );
229 std::cout <<
"caught exception " << e.
msg() << std::endl;
virtual std::string const msg() const
BooleanOptionKey const user("options:user")
File name class supporting Windows and UN*X/Linux format names.
void stepwise_monte_carlo()
std::vector with 1-based indexing
File name class supporting Windows and UN*X/Linux format names.
basic::options::IntegerOptionKey const nstruct("nstruct")
rule< Scanner, options_closure::context_t > options
int main(int argc, char *argv[])
ocstream cout(std::cout)
Wrapper around std::cout.
BooleanOptionKey const exit("options:exit")
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
void init()
set global 'init_was_called' to true
Program options global and initialization function.
int const silent
Named verbosity levels.
static THREAD_LOCAL basic::Tracer TR("apps.pilot.rhiju.stepwise_monte_carlo")
rule< Scanner, option_closure::context_t > option