/*************************************************************************** rosedb.cpp - description ------------------- begin : Tue Nov 18 01:45:35 2003 copyright : (C) 1999-2006 by Cavalli Andrea author : : cavalli $ date : : 2003/12/09 11:10:33 $ id : : coor.h,v 1.1.2.2 2003/12/09 11:10:33 cavalli Exp $ email : cavalli@bioc.unizh.ch amc82@cam.ac.uk **************************************************************************/ /*************************************************************************** * * * 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 namespace Almost { ostream & operator<<(ostream & out, const RoseDBProtein & p){ int s = p.sequ.size(); out<>(istream & in, RoseDBProtein &p){ int s; in>>s; p.resize(s); in>>p.name; for(int i=0;i> aa; in >> c; p.sequ[i] = c; in >> c; p.ss[i] = c; in >> d; p.ha[i] = d; in >> d; p.h[i] = d; in >> d; p.n[i] = d; in >> d; p.ca[i] = d; in >> d; p.cb[i] = d; in >> d; p.c[i] = d; in >> d; p.phi[i] = d; in >> d; p.psi[i] = d; in >> d; p.omega[i] = d; } for(int i=0;i> q; for(int aa=0;aa<20;aa++){ double d; in >> d; p.psi_blast[i][aa] = d; } } return in; } void rose_db_protein_from_files(string mrg, string prf, RoseDBProtein & p ){ ifstream mrg_in, prf_in; mrg_in.open(mrg.c_str()); vector res_data; { string name = mrg; istream_iterator iter(mrg_in),end; int pos = name.rfind("/"); string n; if(pos==string::npos) n = name; else n = string(name.begin()+pos+1,name.end()); while(iter!=end){ ResidueData rd; strcpy(rd.prot, n.c_str()); rd.num = atoi((*iter).c_str()); ++iter; rd.name = (*iter)[0]; ++iter; rd.phi = atof((*iter).c_str()); ++iter; rd.psi = atof((*iter).c_str()); ++iter; rd.ome = atof((*iter).c_str()); ++iter; rd.ha = atof((*iter).c_str()); ++iter; rd.h = atof((*iter).c_str()); ++iter; rd.n = atof((*iter).c_str()); ++iter; rd.ca = atof((*iter).c_str()); ++iter; rd.cb = atof((*iter).c_str()); ++iter; rd.c = atof((*iter).c_str()); ++iter; rd.ss = (*iter)[0]; ++iter; res_data.push_back(rd); } } vector > matx; { Utils::read_mtx(prf,matx); } //Merge data in p; p.resize(res_data.size()); p.name = res_data[0].prot; for(int aa=0;aa