/* ************************************************************************ * All Copyright Reserved! * * * * Prog: respgen * * Version: version 1.0 * * Author: Junmei Wang * * * * Department of Pharmaceutical Chemistry * * School of Pharmacy * * University of California * * San Francisco CA 94143 * * Octomber, 2001 * ************************************************************************ */ # include "common.h" # include "define.h" # include "atom.h" # include "utility.c" # include "common.c" # include "ac.c" # define MAXCONF 20 # define MAXCHARGE 20 typedef struct { char name[20]; double charge; int id; } CHARGE; typedef struct { char resat[20]; char capat[20]; int resid; int capid; } SEPBOND; ATOM *atom; BOND *bond; int atomnum = 0; int bondnum = 0; int *flag; CONTROLINFO cinfo; MOLINFO minfo; int i, j, k; FILE *fpin; FILE *fpout; char line[MAXCHAR]; char ifilename[MAXCHAR]; int overflow_flag = 0; int confnum = 1; SEPBOND sepbond[2]; int sepbondnum; CHARGE charge[MAXCHARGE]; int chargenum = 0; int residueatnum ; double netcharge = 0; char inputfile[MAXCHAR]; char espfile[MAXCHAR]; char prepfile[MAXCHAR]; char residue_symbol[MAXCHAR] = "MOL"; char residue_file_name[MAXCHAR] = "MOL.res"; int *selectelement; int selectnum ; int selectnum2; void findpath(ATOM atm[], int selectnum, int startnum) { int i, j; int start; int resetindex = -1; start = -1; selectelement[selectnum++] = startnum; for (i = 0; i < 6; i++) { if(atm[startnum].con[i] == -1) return; if(atm[startnum].con[i] == sepbond[1].resid) { selectelement[selectnum++] = sepbond[1].resid; selectnum2 = selectnum ; return; } start = atm[startnum].con[i]; for (j = 0; j < selectnum; j++) if (start == selectelement[j]) { resetindex = 1; break; } if(resetindex == 1) { resetindex = -1; continue; } if (start == -1) return; findpath(atm, selectnum, start); } } void group_atom(int index) { int i, j, num, num_old; int id; num = 1; num_old = 0; if(index == 0) { flag[sepbond[0].resid] = 1; flag[sepbond[1].resid] = 1; } else if(index == 1) flag[sepbond[0].capid] = 1; else if(index == 2) flag[sepbond[1].capid] = 1; while (num_old < num) { num_old = num; for (i = 0; i 2) { fprintf(stderr, "\nToo many separative bonds, exit"); exit(1); } continue; } if (strncmp("NET_CHARGE", line, 10) == 0) { sscanf(&line[11], "%lf", &netcharge); continue; } if (strncmp("PREP_FILE", line, 9) == 0) { sscanf(&line[10], "%s", prepfile); continue; } if (strncmp("RESIDUE_FILE_NAME", line, 17) == 0) { sscanf(&line[18], "%s", residue_file_name); continue; } if (strncmp("RESIDUE_SYMBOL", line, 14) == 0) { sscanf(&line[15], "%s", residue_symbol); continue; } if (strncmp("ATOM_CHARGE", line, 11) == 0) { sscanf(&line[12], "%s%lf", charge[chargenum].name, &charge[chargenum].charge); chargenum++; continue; } } fclose(fpin); if(sepbondnum != 2 && sepbondnum != 0) { printf("There must be two separative bonds or no separative bond at all"); exit(1); } printf("\nINPUT_FILE:\t\t%s", inputfile); printf("\nESP_FILE:\t\t%s", espfile); printf("\nCONF_NUM:\t\t%d", confnum); printf("\nNET_CHARGE:\t\t%-9.5lf", netcharge); for(i=0;i