/*************************************************************************** anmr_mod.cpp - description ------------------- begin : Fri Jun 15 17:25:01 2007 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 using namespace Almost; struct FragH { enum { PLAIN, METHYL}; vector H; vector name; int f_pos; string f_name; int kind; FragH(){ kind = PLAIN; } }; template<> inline string to_string(const Molecules &){ return ""; } template<> inline string to_string(const FragH &){ return ""; } template<> inline string to_string(const NMR::Atom &){ return ""; } template<> inline string to_string(const NMR::DB &){ return ""; } template<> inline string to_string(const NMR::AlmNoesy &){ return ""; } void extract_h(const Molecules & mols, vector & frag_h){ frag_h.clear(); for(int i=0;i atm = mols.fragment_atoms(i); fh.f_name = mols.fragment_name(i,Molecules::BASE); string f_name_short = mols.fragment_name(i); fh.f_pos = i; { //Set kind } for(int aa=0;aa & fh, string in_shx, string out_noesy){ map shx; { ifstream in; in.open(in_shx.c_str()); istream_iterator iter(in),end; while(iter!=end){ string s = *iter;++iter; double d = atof(iter->c_str()); ++iter; shx[s] = d; } } ofstream out; out.open(out_noesy.c_str()); for(int i=0;i> Missing shx for "<> Missing shx for "<(mod.self(),"fragh") ; Class >(mod.self(),"fraghvect") .def_method("push_back",&vector::push_back) .def_method("size",&vector::size) .def_method("clear",&vector::clear) // .def_method("resize",&vector::resize) ; Class >(mod.self(),"db"); Class > >(mod.self(),"almnoesy") .def_method("bootstrap",&NMR::AlmNoesy::bootstrap) .def_method("set_dw",&NMR::AlmNoesy::set_dw) .def_method("validate",&NMR::AlmNoesy::validate) .def_method("validate_name",&NMR::AlmNoesy::validate_name) .def_method("validate_sym",&NMR::AlmNoesy::validate_sym) .def_method("validate_all",&NMR::AlmNoesy::validate_all) .def_method("validate_str",&NMR::AlmNoesy::validate_str) .def_method("validate_str2",&NMR::AlmNoesy::validate_str2) .def_method("mkmrg",&NMR::AlmNoesy::mkmrg) ; mod.def_function("extract_h","",extract_h); mod.def_function("mk_noesy","",mk_noesy); mod.def_function("mk_noesy3d","",NMR::mk_noesy3d); mod.def_function("mk_hlist","",NMR::mk_hlist); } }