17 #include <core/chemical/ChemicalManager.hh>
18 #include <core/conformation/ResidueFactory.hh>
19 #include <core/chemical/ResidueType.hh>
20 #include <core/chemical/ResidueTypeSet.hh>
22 #include <core/id/AtomID.hh>
26 #include <basic/options/keys/match.OptionKeys.gen.hh>
27 #include <basic/options/keys/run.OptionKeys.gen.hh>
29 #include <core/pose/Pose.hh>
34 #include <protocols/match/Matcher.hh>
35 #include <protocols/match/MatcherMover.hh>
36 #include <protocols/match/MatcherTask.hh>
38 #include <protocols/match/output/ProcessorFactory.hh>
39 #include <protocols/match/output/MatchProcessor.hh>
42 #include <core/pack/rotamers/SingleLigandRotamerLibrary.hh>
43 #include <core/pack/rotamers/SingleResidueRotamerLibraryFactory.hh>
49 #include <core/import_pose/import_pose.hh>
54 #if defined(WIN32) || defined(__CYGWIN__)
66 int main(
int argc,
char * argv [] )
70 using namespace basic::options::OptionKeys;
76 std::cout <<
"caught exception " << e.
msg() << std::endl;
85 using namespace core::chemical;
86 using namespace core::id;
89 using namespace protocols::match;
90 using namespace protocols::match::downstream;
92 using namespace protocols::match::upstream;
95 using namespace basic::options::OptionKeys;
100 option[OptionKeys::run::preserve_header ].value(
true);
102 MatcherTaskOP mtask(
new MatcherTask );
105 if ( input_jobs.size() == 0 )
utility_exit_with_message(
"No input scaffold structures specified for matcher. Check for -s <pdbfile> in arguments.");
109 core::import_pose::pose_from_pdb( scaffold, input_jobs[ 1 ] );
110 scaffold.update_residue_neighbors();
113 core::conformation::ResidueOP ligres = core::conformation::ResidueFactory::create_residue(
114 core::chemical::ChemicalManager::get_instance()->residue_type_set( FA_STANDARD )->name_map(
115 option[ basic::options::OptionKeys::match::lig_name ] )
117 ligpose.append_residue_by_jump( *ligres, 1 );
119 if (
option[ OptionKeys::match::ligand_rotamer_index ].
user() ) {
120 set_ligpose_rotamer( ligpose );
124 Size cent, nbr1, nbr2;
125 ligres->select_orient_atoms( cent, nbr1, nbr2 );
127 T <<
"Selecting orientation atoms:";
128 T <<
" " << ligres->atom_name( cent );
129 T <<
" " << ligres->atom_name( nbr1 );
130 T <<
" " << ligres->atom_name( nbr2 ) << std::endl;
132 mtask->set_upstream_pose( scaffold );
135 oats[ 1 ] = AtomID( nbr2, 1 ); oats[ 2 ] = AtomID( nbr1, 1 ); oats[ 3 ] = AtomID( cent, 1 );
137 mtask->set_downstream_pose( ligpose, oats );
138 mtask->initialize_from_command_line();
141 time_t matcher_start_time = time(NULL), find_hits_end_time( time( NULL ) );
142 long processing_time(0);
143 MatcherOP matcher(
new Matcher );
144 matcher->initialize_from_task( *mtask );
145 MatchProcessorOP processor = ProcessorFactory::create_processor( matcher, mtask );
147 if ( matcher->find_hits() ) {
148 find_hits_end_time = time(NULL);
149 time_t process_start_time( time(NULL) );
150 matcher->process_matches( *processor );
151 processing_time = (long) (time(NULL) - process_start_time);
154 find_hits_end_time = time(NULL);
156 long find_hits_time = (long)(find_hits_end_time - matcher_start_time );
157 time_t matcher_end_time = time(NULL);
158 T <<
"Matcher ran for " << (long)(matcher_end_time - matcher_start_time) <<
" seconds, where finding hits took " << find_hits_time <<
" seconds and processing the matches took " << processing_time <<
" seconds." << std::endl;
#define utility_exit_with_message(m)
Exit with file + line + message.
virtual std::string const msg() const
int main(int argc, char *argv[])
void init(int argc, char *argv[])
Command line init() version.
BooleanOptionKey const user("options:user")
common derived classes for thrown exceptions
rule< Scanner, options_closure::context_t > options
ocstream cout(std::cout)
Wrapper around std::cout.
vector1: std::vector with 1-based indexing
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
utility::vector1< std::string > start_files()
Some std::string helper functions.
Program options global and initialization function.
rule< Scanner, option_closure::context_t > option