/* ++++++++ */ # define HEADER "util.h" /* ++++++++ */ # undef HEADER # ifndef __UTIL_H__ # define __UTIL_H__ #ifdef __cplusplus extern "C" { #endif # include # include # include # include # include # include # include "util.essential.h" # include "little-nr.h" /* not in libstr # include "nrutil.h" */ /* ** None of these splicing macros work correctly on the iris or the alliant. */ # ifdef OFF # define ITOD(i) {printf("%s [%d]: " #i "= %d",__FILE__,__LINE__,i);} # define ITOD(s,i) {printf("%s [%d]: arg= %d\n",__FILE__,__LINE__,s,i);} # define SPLICE(arg) "arg" # define ITOD(i) {printf("%s [%d]: " SPLICE(arg) " =%d\n,"__FILE__,__LINE__,i);} # endif /* ** None of these splicing macros work with Concentrix 3.0 */ # ifdef OFF # define ITOD(splicearg) \ {printf("%s [%d]: splicearg = %d\n",__FILE__,__LINE__,splicearg);} # define ATOD(splicearg) \ {printf("%s [%d]: splicearg = %s\n",__FILE__,__LINE__,splicearg);} # define FTOD(splicearg) \ {printf("%s [%d]: splicearg = %f\n",__FILE__,__LINE__,splicearg);} # define ITOE(splicearg) \ {fprintf(stderr,"%s [%d]: splicearg = %d\n",__FILE__,__LINE__,splicearg);} # define ATOE(splicearg) \ {fprintf(stderr,"%s [%d]: splicearg = %s\n",__FILE__,__LINE__,splicearg);} # define FTOE(splicearg) \ {fprintf(stderr,"%s [%d]: splicearg = %f\n",__FILE__,__LINE__,splicearg);} # define VTOD(splicearg)\ {printf("%s [%d]: splicearg=( %f %f %f )\n",__FILE__,__LINE__,\ splicearg[0],splicearg[1],splicearg[2]);} # define NRTOD(splicearg)\ {printf("%s [%d]: splicearg=( %f %f %f )\n",__FILE__,__LINE__,\ splicearg[0],splicearg[1],splicearg[2]);} # endif # define ITOD_OFF(i) # define FTOD_OFF(i) # define offITOD(i) # define offFTOD(i) /* ---- */ # define POPF(argv,fvar) \ /* ---- */\ { fvar = atof(*argv++); FTOD(fvar); } /* ------ */ # define ENVDEF(envvar,default) \ /* ------ */\ (getenv(envvar) == NULL ? default : atof(getenv(envvar))) /* ------ */ # define ENVSTR(envvar) \ /* ------ */\ (getenv(envvar) == NULL ? envvar : getenv(envvar)) /* ---------- */ # define ARGV2DVECT(v) v = argv2dvect(&argc,&argv,MAKESTRING(v)) /* ---------- */ /* ------------- */ # define CHANGE_HEADER(M)\ /* ------------- */\ {\ M->mxyz[0] = M->nu2 - M->nu1 +1;\ M->mxyz[1] = M->nv2 - M->nv1 +1;\ M->mxyz[2] = M->nw2 - M->nw1 +1;\ M->nu1 = - M->mxyz[0] / 2;\ M->nv1 = - M->mxyz[1] / 2;\ M->nu2 = M->mxyz[0] / 2 - 1;\ M->nv2 = M->mxyz[1] / 2 - 1;\ } extern char *getenv (const char *s); # include # include "hohvect.h" # include "water.h" # include "old.pdbio.h" # include "stats.h" # include "myawk.h" # include "util_prototypes.h" /****************************************************************************** 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 1 HT1 TRP 1 0.101 0.574 -1.385 1.00 0.00 TRYP 1 6 ATOM | HETATM 7 11 iser %5d 12 1X 13 16 atnam %4c 17 alt location identifier 18 20 resnam %3c (%4c in XPLOR) 21 1X 22 chnnam %1c 23 26 iresn %4d 27 insertion code 28 20 3X 31 38 xx %8.3lf 39 46 yy %8.3lf 47 54 zz %8.3lf 55 60 occ %6.2lf 61 66 b %6.2lf 67 73 76 segid %4c ******************************************************************************/ /****************************************************************************** Print this residue in Diamond format. if (chain == 1) { printf (DIAFMT,$7,$8,$9,$11,k,res,++j,$10,$4,str,$3) x y z b ityp ires iatom restyp resnam atmnam } else { printf (DIAFMT,$6,$7,$8,$10,k,res,++j,$9,$4,$5,$3) A = diamond field number B = PDB/dia field name C = PDB field number A B C - ------ -- 1 xx = $6 2 yy = $7 3 zz = $8 4 b = $10 5 k 6 iresn = iresn (for aml2) 7 iser 8 occ = $9 9 res = iresn (after sprintf) 10 resnam = $4 11 atnam = $3 } ******************************************************************************/ #ifdef __cplusplus } #endif # endif /* !__UTIL_H__ */