// discSt.cpp assign disccrete state to each amino acid in a *.ang file #include #include #include #include #include #include #include #include #include using namespace std; #define pi 3.1415926 typedef map SIMAP; typedef map SSMAP; SSMAP AAMap; SIMAP AIMap; SIMAP::iterator aiItr; SSMAP::iterator aaItr; void editMap(); void Usage(); void at_co(double alpha, double tau, double& x, double& y, double& z); int main(int argc, char* argv[]) { int i, j, k, NC=4, PI=0,aaP,posn; char fileName[200],OutFile[200],temp[200],caa[5]; string saa,fname; double x,y,state[20][8][3]; strcpy(fileName, "at.dat"); strcpy(OutFile,"out.tmp"); editMap(); ifstream infile; ofstream outfile; i=1; if(argc==1){ Usage(); } while(i>saa; if((aiItr=AIMap.find(saa))!=AIMap.end()) posn=(*aiItr).second; else { cout<<" can not find the amino acid type "<>x>>y; at_co(x,y,state[posn][j][0],state[posn][j][1],state[posn][j][2]); } ++i; } infile.close(); infile.open(fileName); if(!infile.is_open()) { fname=fname.substr(0,fname.size()-4); strcpy(fileName,"/mnt/autofs/home/jinfeng/SharedData/pc30_res2.0_ca_ang/"); strcat(fileName,fname.c_str()); strcat(fileName,".ca.ang"); infile.open(fileName); if(!infile.is_open()) { cout<<"Erro in opening file "<