15 #include <core/types.hh>
16 #include <core/chemical/ChemicalManager.hh>
17 #include <core/import_pose/import_pose.hh>
18 #include <core/io/pdb/pdb_writer.hh>
19 #include <core/pose/Pose.hh>
20 #include <core/pose/util.hh>
21 #include <protocols/magnesium/util.hh>
22 #include <protocols/magnesium/minimize_util.hh>
23 #include <protocols/magnesium/MgOrbitalFrameFinder.hh>
24 #include <protocols/magnesium/MgWaterHydrogenPacker.hh>
25 #include <protocols/magnesium/MgHydrater.hh>
26 #include <protocols/magnesium/MgMonteCarlo.hh>
27 #include <protocols/magnesium/MgScanner.hh>
28 #include <protocols/viewer/viewers.hh>
29 #include <core/scoring/ScoreFunction.hh>
30 #include <core/scoring/ScoreFunctionFactory.hh>
47 using namespace basic::options::OptionKeys;
74 using namespace basic::options::OptionKeys;
82 ResidueTypeSetCOP rsd_set( core::chemical::ChemicalManager::get_instance()->
residue_type_set( core::chemical::FA_STANDARD ) );
86 for (
Size q = 1; q <= input_pdb_files.size(); q++ ) {
87 std::string
const pdb_file = input_pdb_files[ q ];
88 import_pose::pose_from_file(
pose, *rsd_set, file_path +
'/' + pdb_file , core::import_pose::PDB_file);
90 std::cout <<
"Doing input file ==> " << pdb_file << std::endl;
92 if ( q == 1 ) protocols::viewer::add_conformation_viewer (
pose.conformation(),
"current", 500, 500, false );
97 if ( input_pdb_files.size() > 0 && pdb_mg_res.size() > 0 ) {
98 runtime_assert( input_pdb_files.size() == input_pdb_mg_res.size() );
104 fixup_magnesiums(
pose );
105 TR <<
TR.
Blue <<
"Just did basic fixup -- mg frame orientation & water-bound mg repacking." <<
TR.
Reset << std::endl;
106 TR <<
TR.
Blue <<
"If you want to build mg2+-bound waters, run this app with -hydrate flag." <<
TR.
Reset << std::endl;
109 MgOrbitalFrameFinder mg_orbital_frame_finder;
110 mg_orbital_frame_finder.apply(
pose );
111 remove_waters_except_mg_bound(
pose, get_mg_water_pairs(
pose, pdb_to_pose(
pose, pdb_mg_res ) ) );
112 MgWaterHydrogenPacker mg_water_hydrogen_packer( pdb_to_pose(
pose, pdb_mg_res ) );
114 mg_water_hydrogen_packer.apply(
pose );
115 tag =
"pack_water_hydrogens";
118 MgHydrater mg_hydrater( pdb_to_pose(
pose, pdb_mg_res ) );
120 mg_hydrater.set_verbose(
true );
121 mg_hydrater.apply(
pose );
124 update_mg_hoh_fold_tree(
pose );
131 MgMonteCarlo mg_monte_carlo;
136 mg_monte_carlo.apply(
pose );
139 strip_out_magnesiums(
pose );
140 add_single_magnesium(
pose );
143 MgScanner mg_scanner;
146 mg_scanner.set_scorefxn( scorefxn );
151 mg_scanner.set_input_scan_res( input_scan_res );
163 mg_scanner.apply(
pose );
170 std::cout <<
"Outputting: " << outfile << std::endl;
172 pose.dump_pdb( outfile );
182 clock_t
const my_main_time_start( clock() );
184 protocols::viewer::clear_conformation_viewers();
185 std::cout <<
"Total time to run " <<
static_cast<Real>( clock() - my_main_time_start ) / CLOCKS_PER_SEC <<
" seconds." << std::endl;
191 main(
int argc,
char * argv [] )
232 protocols::viewer::viewer_main(
my_main );
235 std::cout <<
"caught exception " << e.
msg() << std::endl;
StringOptionKey const silent("out:file:silent")
BooleanOptionKey const hydrate("magnesium:hydrate")
#define utility_exit_with_message(m)
Exit with file + line + message.
BooleanOptionKey const minimize_during_scoring("magnesium:minimize_during_scoring")
RealOptionKey const xyz_step("magnesium:xyz_step")
static THREAD_LOCAL basic::Tracer TR("mg_modeler")
virtual std::string const msg() const
IntegerOptionKey const cycles("magnesium:montecarlo:cycles")
BooleanOptionKey const scan("magnesium:scan")
ResidueChainVectorOptionKey const ligand_res("magnesium:ligand_res")
BooleanOptionKey const lores_scan("magnesium:lores_scan")
StringOptionKey const residue_type_set
BooleanOptionKey const scoring
void init(int argc, char *argv[])
Command line init() version.
RealOptionKey const temperature("magnesium:montecarlo:temperature")
#define runtime_assert(_Expression)
Assert that the condition holds. Evaluated for both debug and release builds.
IntegerVectorOptionKey const pose_ligand_res("magnesium:pose_ligand_res")
BooleanOptionKey const monte_carlo("magnesium:monte_carlo")
basic::options::OptionKeys collection
PathOptionKey const pdb("out:path:pdb")
ResidueChainVectorOptionKey const input_res("in:file:input_res")
RealOptionKey const minimize_mg_coord_constraint_distance("magnesium:minimize_mg_coord_constraint_distance")
IntegerVectorOptionKey const mg_res("magnesium:mg_res")
basic::options::OptionKeys collection
macros to define options on a per-application basis at the top of app files (those with main) ...
RealOptionKey const add_delete_frequency("magnesium:montecarlo:add_delete_frequency")
BooleanOptionKey const pack_water_hydrogens("magnesium:pack_water_hydrogens")
static utility::CSI_Sequence Reset
std::vector with 1-based indexing
PathVectorOptionKey const pdb("in:path:pdb")
std::string replace_in(std::string const &name_in, std::string const &find_string, std::string const &replace_string)
Generate new string from 'source' by replacing all occurrences of 'from' to 'to' string.
basic::options::OptionKeys collection
rule< Scanner, options_closure::context_t > options
static utility::CSI_Sequence Blue
BooleanOptionKey const tether_to_closest_res("magnesium:tether_to_closest_res")
BooleanOptionKey const dump("magnesium:montecarlo:dump")
BooleanOptionKey const magnesium
StringOptionKey const weights("score:weights")
ocstream cout(std::cout)
Wrapper around std::cout.
RealOptionKey const score_cut_PDB("magnesium:score_cut_PDB")
BooleanOptionKey const exit("options:exit")
vector1: std::vector with 1-based indexing
StringOptionKey const o("out:file:o")
Class for handling user debug/warnings/errors. Use instance of this class instead of 'std::cout' for ...
int main(int argc, char *argv[])
BooleanOptionKey const scored_hydrogen_sampling("magnesium:scored_hydrogen_sampling")
BooleanOptionKey const leave_other_waters("magnesium:leave_other_waters")
basic::options::OptionKeys collection
BooleanOptionKey const all_hydration_frames("magnesium:all_hydration_frames")
Program options global and initialization function.
rule< Scanner, tag_closure::context_t > tag
RealOptionKey const score_cut("magnesium:score_cut")
BooleanOptionKey const chemical
BooleanOptionKey const fixup("magnesium:fixup")
BooleanOptionKey const integration_test("magnesium:integration_test")
StringOptionKey const user
BooleanOptionKey const minimize("magnesium:minimize")
FileVectorOptionKey const s("in:file:s")
rule< Scanner, option_closure::context_t > option