15 #include <core/types.hh>
16 #include <core/chemical/ChemicalManager.hh>
17 #include <core/id/NamedAtomID.hh>
18 #include <core/id/AtomID.hh>
19 #include <core/io/silent/BinarySilentStruct.hh>
20 #include <core/scoring/ScoreFunctionFactory.hh>
21 #include <core/scoring/constraints/ConstraintSet.hh>
22 #include <core/scoring/constraints/ConstraintSet.fwd.hh>
23 #include <core/scoring/constraints/ConstraintIO.hh>
24 #include <core/scoring/ScoreFunction.hh>
25 #include <core/scoring/rms_util.hh>
29 #include <protocols/viewer/viewers.hh>
30 #include <core/pose/Pose.hh>
31 #include <core/pose/util.hh>
32 #include <protocols/stepwise/setup/FullModelInfoSetupFromCommandLine.hh>
33 #include <core/pose/annotated_sequence.hh>
34 #include <core/init/init.hh>
36 #include <core/io/pdb/pose_io.hh>
37 #include <core/import_pose/import_pose.hh>
38 #include <core/import_pose/pose_stream/PoseInputStream.hh>
39 #include <core/import_pose/pose_stream/PoseInputStream.fwd.hh>
40 #include <core/import_pose/pose_stream/PDBPoseInputStream.hh>
41 #include <core/import_pose/pose_stream/SilentFilePoseInputStream.hh>
46 #include <protocols/farna/setup/RNA_DeNovoPoseSetup.hh>
47 #include <protocols/farna/movers/RNA_Minimizer.hh>
48 #include <protocols/farna/options/RNA_MinimizerOptions.hh>
49 #include <protocols/farna/util.hh>
50 #include <protocols/stepwise/modeler/util.hh>
51 #include <protocols/stepwise/modeler/align/util.hh>
52 #include <protocols/toolbox/AtomLevelDomainMap.hh>
59 #include <basic/options/keys/out.OptionKeys.gen.hh>
60 #include <basic/options/keys/in.OptionKeys.gen.hh>
61 #include <basic/options/keys/rna.OptionKeys.gen.hh>
62 #include <basic/options/keys/constraints.OptionKeys.gen.hh>
63 #include <basic/options/keys/full_model.OptionKeys.gen.hh>
64 #include <basic/options/keys/score.OptionKeys.gen.hh>
69 OPT_KEY( Boolean, one_torsion_test )
75 using io::
pdb::dump_pdb;
88 using namespace basic::options::OptionKeys;
90 using namespace core::chemical;
91 using namespace core::scoring;
92 using namespace core::kinematics;
94 using namespace core::import_pose::pose_stream;
95 using namespace core::pose::full_model_info;
96 using namespace protocols::toolbox;
97 using namespace protocols::farna;
98 using namespace protocols::farna::movers;
99 using namespace protocols::stepwise;
100 using namespace protocols::stepwise::setup;
102 ResidueTypeSetCOP rsd_set;
103 rsd_set = core::chemical::ChemicalManager::get_instance()->residue_type_set( FA_STANDARD );
106 bool is_dump_pdb(
true );
111 PoseInputStreamOP
input;
114 SilentFilePoseInputStreamOP input1(
new SilentFilePoseInputStream(
116 option[ in::file::tags ]()
118 input1->set_order_by_energy(
true );
122 input1->set_order_by_energy(
true );
131 bool native_exists(
false );
134 core::import_pose::pose_from_pdb(
native_pose, *rsd_set, native_pdb_file );
136 native_exists =
true;
140 RNA_MinimizerOptionsOP
options(
new RNA_MinimizerOptions );
141 options->initialize_from_command_line();
142 RNA_Minimizer rna_minimizer( options );
146 SilentFileData silent_file_data;
150 if (
option[ full_model::other_poses ].
user() ) get_other_poses( other_poses,
option[ full_model::other_poses ](), rsd_set );
158 while (
input->has_another_pose() ) {
165 fill_full_model_info_from_command_line(
pose, other_poses );
168 if (
option[OptionKeys::constraints::cst_fa_file].
user() ) {
173 core::pose::make_pose_from_sequence( test_pose,
pose.annotated_sequence(), *rsd_set );
174 ConstraintSetOP cst_set = ConstraintIO::get_instance()->read_constraints(
175 option[OptionKeys::constraints::cst_fa_file][1], ConstraintSetOP(
new ConstraintSet ), test_pose );
176 pose.constraint_set( cst_set );
191 AtomLevelDomainMapOP atom_level_domain_map(
new AtomLevelDomainMap(
pose ) );
192 if (
option[ in::file::minimize_res ].
user() ) {
194 atom_level_domain_map->set(
false );
195 options->set_extra_minimize_res(
option[ in::file::minimize_res ]() );
196 rna_minimizer.set_options( options );
197 }
else if (
option[ one_torsion_test ]() ) {
204 atom_level_domain_map->set(
true );
206 rna_minimizer.set_atom_level_domain_map( atom_level_domain_map );
210 if ( i == 1 ) protocols::viewer::add_conformation_viewer(
pose.conformation(),
"current", 400, 400 );
215 rna_minimizer.apply(
pose );
218 std::string
tag = tag_from_pose(
pose );
220 if ( pos != std::string::npos ) tag.replace( pos, 4,
"" );
224 if ( native_exists ) {
226 for (
Size k = 1; k <=
pose.total_residue(); ++k ) superimpose_res.push_back( k );
227 core::id::AtomID_Map< id::AtomID >
const & alignment_atom_id_map_native =
228 protocols::stepwise::modeler::align::create_alignment_id_map_legacy(
pose,
native_pose, superimpose_res );
229 core::scoring::superimpose_pose(
pose,
native_pose, alignment_atom_id_map_native );
230 core::scoring::superimpose_pose( pose_init,
native_pose, alignment_atom_id_map_native );
233 BinarySilentStruct
s(
pose, tag );
235 if ( native_exists ) {
238 std::cout <<
"All atom rmsd: " << rmsd_init <<
" to " << rmsd << std::endl;
239 s.add_energy(
"rms", rmsd );
240 s.add_energy(
"rms_init", rmsd_init );
253 std::cout <<
"Outputting " << tag <<
" to silent file: " << silent_file << std::endl;
254 silent_file_data.write_silent_struct( s, silent_file,
false );
256 std::string
const out_file = tag +
".pdb";
258 dump_pdb(
pose, out_file );
272 protocols::viewer::clear_conformation_viewers();
279 main(
int argc,
char * argv [] )
283 using namespace basic::options::OptionKeys;
285 std::cout << std::endl <<
"Basic usage: " << argv[0] <<
" -s <pdb file> " << std::endl;
286 std::cout <<
" " << argv[0] <<
" -in:file:silent <silent file> " << std::endl;
287 std::cout << std::endl <<
" Type -help for full slate of options." << std::endl << std::endl;
299 NEW_OPT( params_file,
"Input file for pairings",
"" );
300 NEW_OPT( one_torsion_test,
"tracking down problem with geom_sol",
false );
310 protocols::viewer::viewer_main(
my_main );
312 std::cout <<
"caught exception " << e.
msg() << std::endl;
#define utility_exit_with_message(m)
Exit with file + line + message.
virtual std::string const msg() const
BooleanOptionKey const user("options:user")
common derived classes for thrown exceptions
static void add_relevant(const OptionKey &key)
add OptionKey to list of application relevant options
Functions for opening database files.
std::vector with 1-based indexing
rule< Scanner, options_closure::context_t > options
#define OPT_KEY(type, key)
void rna_fullatom_minimize_test()
utility::options::OptionCollection option
OptionCollection global.
#define NEW_OPT(akey, help, adef)
ocstream cout(std::cout)
Wrapper around std::cout.
BooleanOptionKey const exit("options:exit")
vector1: std::vector with 1-based indexing
int main(int argc, char *argv[])
void init()
set global 'init_was_called' to true
Program options global and initialization function.
rule< Scanner, tag_closure::context_t > tag
int const silent
Named verbosity levels.