/* ************************************************************************ * 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 # define MAXSEPBOND 100 /*one one defines more than 100 separating bonds*/ typedef struct { char name[20]; double charge; int id; } CHARGE; typedef struct { char resat[20]; char capat[20]; int resid; int capid; int type; } 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[MAXSEPBOND]; int sepbondnum = 0; 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"; char pseudo_head_name[20] = "PSEUDO_HEAD"; char pseudo_tail_name[20] = "PSEUDO_TAIL"; int *selectelement; int selectnum ; int selectnum2; int pre_head_id = -1; int post_tail_id = -1; int head_id = -1; int tail_id = -1; int num_terminal_atom = 0; int length; int start_atomid; 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] == tail_id) { selectelement[selectnum++] = tail_id; 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_atom1(int id) { int i, j, num, num_old; int atid; num = 1; num_old = 0; for (i = 0; i 1) { fprintf(stderr, "Error: only one or none SEP_BOND has a type of '1'\n"); exit(1); } if(num_sep_bond_type2 > 1) { fprintf(stderr, "Error: only one or none SEP_BOND has a type of '-1'\n"); exit(1); } /* find atom ids for terminal atoms */ num_terminal_atom = 0; if(num_sep_bond_type1 == 1) num_terminal_atom ++; if(num_sep_bond_type2 == 1) num_terminal_atom ++; if(head_id == -1 && strcmp(pseudo_head_name, "PSEUDO_HEAD") != 0) { for(i=0;i 0) { for(i=0;i