/*************************************************************************** dynamip_mod.cpp - description ------------------- begin : Thu Sep 16 04:19:17 2004 copyright : (C) 2002 by Cavalli Andrea email : cavalli@bioc.unizh.ch **************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include #include #include #include // extern vector mip_constraints; // namespace Almost { // vector get_mipconst(){ return mip_constraints;} // void clear_mipconst(){ // for(int i=0;i \ inline string to_string(const s & ){ \ return "<" #s ">"; \ } ALMTOSTRING(MoveSet); ALMTOSTRING(ConstraintCollection); // typedef DynaMIPData, // DynaMIPGoOptions, // ENERGY> GoData; // typedef DynaMIPTraits, // CoorManagerOptions, // DefGoForceField, // DefGoOptions, // MoveSet, // Metropolis, // GoData, // DynaMIPGoOptions > GoTraits; // template<> // void ForceFieldFactory::create(DefGoForceField ** force_field, // const Molecules & molecules, // const DynaMIPGoOptions &options, // const MDB & mdb, // const string & ff_pr){ // logMsg(ff_pr, // "Initializing "+ DefGoOptions::ff_name()+" force field"); // *force_field = // new DefGoForceField(molecules, // options.ff_options(), // mdb); // logMsg(ff_pr,"Done\n"); // } // typedef DynaMIPData, // DynaMIPIGoOptions, // ENERGY> IGoData; // typedef DynaMIPTraits, // CoorManagerOptions, // DefIGoForceField, // DefIGoOptions, // MoveSet, // Metropolis, // IGoData, // DynaMIPIGoOptions > IGoTraits; // template<> // void ForceFieldFactory::create(DefIGoForceField ** force_field, // const Molecules & molecules, // const DynaMIPIGoOptions &options, // const MDB & mdb, // const string & ff_pr){ // logMsg(ff_pr, // "Initializing "+ DefIGoOptions::ff_name()+" force field"); // *force_field = // new DefIGoForceField(molecules, // options.ff_options(), // mdb); // logMsg(ff_pr,"Done\n"); // } // template // inline string to_string(const DynaMIPGoOptions & opt){ // stringstream s; // s< // inline string to_string(const DynaMIPIGoOptions & opt){ // stringstream s; // s< > * (DynaMIP::*mc_factory_19)(const XMolecules & molecules, const DynaMIPOptions & options, const MDB & mdb); #if (__GNUC__ >= 3) template<> #endif map DynaMIP::factory #if (__GNUC__ >= 3) = map(); #endif ; // template<> // inline string to_string(const DynaMIPImplementation &){ // return ""; // } // template<> // inline string to_string(const DynaMIPImplementation &){ // return ""; // } template<> inline string to_string(const DynaMIP &){ return ""; } template DynaType const_dynamip(MoveSet & ms, ConstraintCollection & cc){ return DynaType(ms,cc); } //operators for GO // template // DynaLogStream & operator<<(DynaLogStream &log, // const DynaMIPData, // DynaMIPGoOptions, // ENERGY> &data){ // char buff[256]; // string prmpt=Almost::DynaMIPStatPr; // log.stream()< // DynaDataStream & operator<<(DynaDataStream &dat, // const DynaMIPData, // DynaMIPGoOptions, // ENERGY> &data){ // dat.stream()< // template<> // DynaLogStream & operator<< , // DynaMIPIGoOptions, // ENERGY> (DynaLogStream &log, // const DynaMIPData, // DynaMIPIGoOptions, // ENERGY> &data){ // char buff[256]; // string prmpt=Almost::DynaMIPStatPr; // log.stream()< // template<> // DynaDataStream & operator<<(DynaDataStream &dat, // const DynaMIPData, // DynaMIPIGoOptions, // ENERGY> &data){ // dat.stream()< c19_defaults_mip(int FF){ DynaMIPOptions opts(DynaMIPOptions::C19); if(FF==DynaMIPOptions::EEF1){ opts.elec = DynaMIPOptions::RDIE; opts. elec_cutoff = DynaMIPOptions::SWITCH; opts.vdw = DynaMIPOptions::LJ; opts.vdw_cutoff = DynaMIPOptions::SWITCH; opts.eps = 1.0; opts.solv = DynaMIPOptions::EEF1; opts.cut_on = 7.0; opts.cut_off = 9.0; opts.cut_nb = 10.0; } else if(FF!=DynaMIPOptions::SASA) opts.solv = DynaMIPOptions::NONE; return opts; } DynaMIPOptions c19_options_mip(){ return DynaMIPOptions(DynaMIPOptions::C19); } DynaMIPOptions c22_options_mip(){ return DynaMIPOptions(DynaMIPOptions::C22); } template<> inline string to_string(const XMolecules & molecules){ return ""; } extern "C" { void init_dynamip(){ //declarations here Module mod = Module("dynamip","Replica Monte Carlo simulations"); // Class >(mod.self(),"go_options") // .def_attribute("e_native",&DynaMIPGoOptions::e_native) // .def_attribute("e_non_native",&DynaMIPGoOptions::e_non_native) // .def_attribute("alpha",&DynaMIPGoOptions::alpha) // .def_attribute("lambda",&DynaMIPGoOptions::lambda) // .def_attribute("ignore_mode",&DynaMIPGoOptions::ignore_mode) // .def_attribute("native_map",&DynaMIPGoOptions::native_map) // .def_attribute("const_file",&DynaMIPGoOptions::const_file) // .def_attribute("move_set",&DynaMIPGoOptions::move_set) // .def_attribute("trj",&DynaMIPGoOptions::trj) // .def_attribute("rst",&DynaMIPGoOptions::rst) // .def_attribute("log",&DynaMIPGoOptions::log) // .def_attribute("dat",&DynaMIPGoOptions::dat) // .def_attribute("steps",&DynaMIPGoOptions::steps) // .def_attribute("nprint",&DynaMIPGoOptions::nprint) // .def_attribute("nsave",&DynaMIPGoOptions::nsave) // .def_attribute("temp",&DynaMIPGoOptions::temp) // .def_attribute("seed",&DynaMIPGoOptions::seed) // .def_attribute("selection",&DynaMIPGoOptions::selection) // .def_attribute("save_fitted",&DynaMIPGoOptions::save_fitted) // .def_attribute("nreplica",&DynaMIPGoOptions::nreplica) // ; // Class >(mod.self(),"vdw_go_options") // .def_attribute("nn_factor",&DynaMIPIGoOptions::nn_factor) // .def_attribute("alpha",&DynaMIPIGoOptions::alpha) // .def_attribute("lambda",&DynaMIPIGoOptions::lambda) // .def_attribute("ignore_mode",&DynaMIPIGoOptions::ignore_mode) // .def_attribute("native_map",&DynaMIPIGoOptions::native_map) // .def_attribute("const_file",&DynaMIPIGoOptions::const_file) // .def_attribute("move_set",&DynaMIPIGoOptions::move_set) // .def_attribute("trj",&DynaMIPIGoOptions::trj) // .def_attribute("rst",&DynaMIPIGoOptions::rst) // .def_attribute("log",&DynaMIPIGoOptions::log) // .def_attribute("dat",&DynaMIPIGoOptions::dat) // .def_attribute("steps",&DynaMIPIGoOptions::steps) // .def_attribute("nprint",&DynaMIPIGoOptions::nprint) // .def_attribute("nsave",&DynaMIPIGoOptions::nsave) // .def_attribute("temp",&DynaMIPIGoOptions::temp) // .def_attribute("seed",&DynaMIPIGoOptions::seed) // .def_attribute("selection",&DynaMIPIGoOptions::selection) // .def_attribute("save_fitted",&DynaMIPIGoOptions::save_fitted) // .def_attribute("nreplica",&DynaMIPIGoOptions::nreplica) // ; // Class >(mod.self(),"dyna_go") // .def_method("run", // &DynaMIPImplementation::run) // .def_method("run_from_mol", // &DynaMIPImplementation::run_from_mol) // .def_method("cont",&DynaMIPImplementation::cont) // .def_method("restart", // &DynaMIPImplementation::restart) // ; // Class >(mod.self(),"dyna_vdw_go") // .def_method("run", // &DynaMIPImplementation::run) // .def_method("run_from_mol", // &DynaMIPImplementation::run_from_mol) // .def_method("cont",&DynaMIPImplementation::cont) // .def_method("restart", // &DynaMIPImplementation::restart) // ; Class >(mod.self(),"options") .def_attribute("kind",&DynaMIPOptions::kind,"Undocumented") .def_attribute("elec",&DynaMIPOptions::elec,"Undocumented") .def_attribute("elec_cutoff",&DynaMIPOptions::elec_cutoff,"Undocumented") .def_attribute("vdw",&DynaMIPOptions::vdw,"Undocumented") .def_attribute("vdw_cutoff",&DynaMIPOptions::vdw_cutoff,"Undocumented") .def_attribute("solv",&DynaMIPOptions::solv,"Undocumented") .def_attribute("solv_ignore_h",&DynaMIPOptions::solv_ignore_h,"Undocumented") .def_attribute("cut_on",&DynaMIPOptions::cut_on,"Undocumented") .def_attribute("cut_off",&DynaMIPOptions::cut_off,"Undocumented") .def_attribute("e_zero",&DynaMIPOptions::e_zero,"Undocumented") .def_attribute("e_14",&DynaMIPOptions::e_14,"Undocumented") .def_attribute("eps",&DynaMIPOptions::eps,"Undocumented") .def_attribute("r_water",&DynaMIPOptions::r_water,"Undocumented") .def_attribute("vect",&DynaMIPOptions::vect,"Undocumented") .def_attribute("trj",&DynaMIPOptions::trj,"Undocumented") .def_attribute("rst",&DynaMIPOptions::rst,"Undocumented") .def_attribute("log",&DynaMIPOptions::log,"Undocumented") .def_attribute("dat",&DynaMIPOptions::dat,"Undocumented") .def_attribute("steps",&DynaMIPOptions::steps,"Undocumented") .def_attribute("nprint",&DynaMIPOptions::nprint,"Undocumented") .def_attribute("nsave",&DynaMIPOptions::nsave,"Undocumented") .def_attribute("temp",&DynaMIPOptions::temp,"Undocumented") .def_attribute("seed",&DynaMIPOptions::seed,"Undocumented") .def_attribute("selection",&DynaMIPOptions::selection,"Undocumented") .def_attribute("save_fitted",&DynaMIPOptions::save_fitted,"Undocumented") .def_attribute("nreplica",&DynaMIPOptions::nreplica,"Undocumented") ; Class,ArgList1 & > >(mod.self(),"dynamip") .def_method("run", &DynaMIP::run) .def_method("run_from_mol", &DynaMIP::run_from_mol) .def_method("cont",&DynaMIP::cont) .def_method("restart", &DynaMIP::restart) ; mod.def_function("const_dynamip","Run a constrained MC simulation", const_dynamip >); mod .def_const("C19",(int)DynaMIPOptions::C19) .def_const("C22",(int)DynaMIPOptions::C22) .def_const("NONE",(int)DynaMIPOptions::NONE) .def_const("SASA",(int)DynaMIPOptions::SASA) .def_const("EEF1",(int)DynaMIPOptions::EEF1) ; mod .def_function("c19_defaults","Return options with right defaults",c19_defaults_mip) .def_function("c19_options","Return options with right defaults",c19_options_mip) .def_function("c22_options","Return options with right defaults",c22_options_mip); } }