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>
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;
86 using namespace core::id;
87 using namespace core::io;
90 using namespace protocols::match::downstream;
92 using namespace protocols::match::upstream;
95 using namespace basic::options::OptionKeys;
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_file( scaffold, input_jobs[ 1 ] , core::import_pose::PDB_file);
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(
117 ligpose.append_residue_by_jump( *ligres, 1 );
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.
basic::options::OptionKeys collection
virtual std::string const msg() const
int main(int argc, char *argv[])
basic::options::OptionKeys collection
StringOptionKey const residue_type_set
void init(int argc, char *argv[])
Command line init() version.
BooleanOptionKey const match
StringOptionKey const lig_name
common derived classes for thrown exceptions
IntegerOptionKey const ligand_rotamer_index
rule< Scanner, options_closure::context_t > options
BooleanOptionKey const preserve_header
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.
BooleanOptionKey const chemical
StringOptionKey const output
StringOptionKey const user
rule< Scanner, option_closure::context_t > option