/* _______________________________________________________________________ * * RDPARM/PTRAJ: APR 2000 * _______________________________________________________________________ * * $Header: /thr/gamow/cvsroot/amber7/src/ptraj/actions.h,v 1.10 2001/07/13 21:59:20 cheatham Exp $ * * Revision: $Revision: 1.10 $ * Date: $Date: 2001/07/13 21:59:20 $ * Last checked in by $Author: cheatham $ * * This source is now archived under CVS at Scripps in the amber7 tree. * * NOTE: this is a beta, pre-release version, is under constant development, * probably contains some bugs and is under constant revision; therefore * take care. Please report bugs (and fixes!) to cheatham@chpc.utah.edu or * cheatham@cgl.ucsf.edu * * Do not distribute this code without explicit permission. * Do not incorporate into other codes without explicit permission. * * Current contact information: * * Thomas Cheatham, III * 2000 East, 30 South, Skaggs Hall 201 * Department of Medicinal Chemistry * University of Utah * Salt Lake City, UT 84112-5820 * cheatham@chpc.utah.edu * (801) 587-9653 * FAX: (801) 585-5366 * * Other contributors: * * David Case (Scripps) * Michael Crowley (Scripps) * Jed Pitera (UCSF) * Vickie Tsui (Scripps) * _______________________________________________________________________ */ /* * This is the header file for action.c which contains the basic structures * necessary for implementing the ACTIONS called by ptraj(). In this file, * the definitions are as follows: * * (1) EXTERNALLY VISIBLE DEFINITIONS * (2) GLOBAL VARIABLES * (3) EXTERNALLY VISIBLE FUNCTION PROTOTYPES * (4) LOCAL STRUCTURES */ /* * (1) EXTERNALLY VISIBLE DEFINITIONS */ /* * possible ptraj ACTIONS */ typedef enum _actionType { TRANSFORM_NOOP, TRANSFORM_ACCEPTOR, TRANSFORM_ANALYZE, TRANSFORM_ANGLE, TRANSFORM_ATOMICFLUCT, TRANSFORM_AVERAGE, TRANSFORM_BOX, TRANSFORM_CENTER, TRANSFORM_CHECKDNA, TRANSFORM_CHECKOVERLAP, TRANSFORM_CLOSESTWATERS, TRANSFORM_DIFFUSION, TRANSFORM_DIHEDRAL, TRANSFORM_DIPOLE, TRANSFORM_DISTANCE, TRANSFORM_DONOR, TRANSFORM_GRID, TRANSFORM_HBOND, TRANSFORM_IMAGE, TRANSFORM_PUCKER, TRANSFORM_PRINCIPAL, TRANSFORM_PRNLEV, TRANSFORM_RADIAL, TRANSFORM_REFERENCE, TRANSFORM_RMS, TRANSFORM_RUNNINGAVERAGE, TRANSFORM_SCALE, TRANSFORM_STRIP, TRANSFORM_SMARTIMAGE, TRANSFORM_SOLVENT, TRANSFORM_TRAJIN, TRANSFORM_TRAJOUT, TRANSFORM_TRANSFORM, TRANSFORM_TRANSLATE, TRANSFORM_TRUNCOCT, TRANSFORM_TEST, TRANSFORM_VECTOR, TRANSFORM_CORRELATION, TRANSFORM_WATERSHELL, TRANSFORM_2DRMS } actionType; /* * ACTION FUNCTION TYPE DEFINITION * * action->fxn(action, X, Y, Z, box, ptrajMode) */ # ifdef __STDC__ typedef int (*actionFunction)( void *, double *, double *, double *, double *, int); # else typedef int (*actionFunction)(); # endif /* * ACTION INFORMATION (passed in as the first argument * to the action function) */ typedef struct _actionInformation { actionFunction fxn; actionType type; ptrajState *state; int suppressProcessing; int *mask; int iarg1; int iarg2; int iarg3; int iarg4; double darg1; double darg2; double darg3; double darg4; void *carg1; void *carg2; void *carg3; void *carg4; } actionInformation; #define INITIALIZE_actionInformation(_p_) \ _p_->fxn = NULL; \ _p_->type = TRANSFORM_NOOP; \ _p_->state = NULL; \ _p_->suppressProcessing = 0;\ _p_->mask = NULL; \ _p_->iarg1 = 0; \ _p_->iarg2 = 0; \ _p_->iarg3 = 0; \ _p_->iarg4 = 0; \ _p_->darg1 = 0.0; \ _p_->darg2 = 0.0; \ _p_->darg3 = 0.0; \ _p_->darg4 = 0.0; \ _p_->carg1 = NULL; \ _p_->carg2 = NULL; \ _p_->carg3 = NULL; \ _p_->carg4 = NULL typedef struct _trajectoryInfo { ptrajState *state; int atoms; int current; int allocated; int rollover; float *x; float *y; float *z; } trajectoryInfo; #define INITIALIZE_trajectoryInfo(_p_) \ _p_->state = NULL; \ _p_->atoms = 0; \ _p_->current = 0; \ _p_->allocated = 0; \ _p_->rollover = 0; \ _p_->x = NULL; \ _p_->y = NULL; \ _p_->z = NULL /* * ACTION: TRANSFORM_RMS -- this structure needs to be global since it is * accessed by ptrajSetupIO */ typedef struct _transformRmsInfo { double *refx, *refy, *refz; char *filename; char *name; double *rmsValues; int currentFrame; } transformRmsInfo; enum _rmsActions { RMS_NOOP, RMS_PREVIOUS, RMS_FIRST, RMS_REFERENCE }; #define INITIALIZE_transformRmsInfo(_p_) \ _p_->refx = NULL; \ _p_->refy = NULL; \ _p_->refz = NULL; \ _p_->filename = NULL; \ _p_->name = NULL; \ _p_->rmsValues = NULL; \ _p_->currentFrame = 0 /* * ACTION: TRANSFORM_HBOND -- this structure needs to be global since it is * accessed by analyze.c functions */ typedef struct _transformHBondInfo { ptrajState *state; char *name; int numdonor; int *donor; int numacceptor; int *acceptor; int *acceptorH; int solventNeighbor; int numSolventDonor; int *solventDonor; int numSolventAcceptor; int *solventAcceptor; int *solventAcceptorH; int window; int series; int visit; float timeinterval; float distanceCutoff; float angleCutoff; float *occupied; float *distance; float *distance2; float *angle; float *angle2; float *seriesOccupied; float *seriesDistance; float *seriesAngle; } transformHBondInfo; #define INITIALIZE_transformHBondInfo(_p_) \ _p_->state = NULL; \ _p_->name = NULL; \ _p_->numdonor = 0; \ _p_->donor = NULL; \ _p_->numacceptor = 0; \ _p_->acceptor = NULL; \ _p_->acceptorH = NULL; \ _p_->solventNeighbor = 6; \ _p_->numSolventDonor = 0; \ _p_->solventDonor = NULL; \ _p_->numSolventAcceptor = 0; \ _p_->solventAcceptor = NULL; \ _p_->solventAcceptorH = NULL; \ _p_->window = 0; \ _p_->series = 0; \ _p_->visit = 0; \ _p_->timeinterval = 1.0; \ _p_->distanceCutoff = 3.0; \ _p_->angleCutoff = 120.0; \ _p_->occupied = NULL; \ _p_->distance = NULL; \ _p_->distance2 = NULL; \ _p_->angle = NULL; \ _p_->angle2 = NULL; \ _p_->seriesOccupied = NULL; \ _p_->seriesDistance = NULL; \ _p_->seriesAngle = NULL /* * (2) GLOBAL VARIABLES */ #ifdef ACTION_MODULE int closestWaters = 0; int *closestWatersMask = NULL; stackType *hbondDonorStack = NULL; stackType *hbondAcceptorStack = NULL; stackType *hbondAcceptorH1Stack = NULL; stackType *hbondAcceptorH2Stack = NULL; stackType *hbondAcceptorH3Stack = NULL; int *hbondDonor = NULL; int *hbondAcceptor = NULL; int *hbondAcceptorH1 = NULL; int *hbondAcceptorH2 = NULL; int *hbondAcceptorH3 = NULL; /* * to keep track of the reference configurations for RMS calculations */ #else extern int closestWaters; extern int *closestWatersMask; extern stackType *hbondDonorStack; extern stackType *hbondAcceptorStack; extern stackType *hbondAcceptorH1Stack; extern stackType *hbondAcceptorH2Stack; extern stackType *hbondAcceptorH3Stack; extern int *hbondDonor; extern int *hbondAcceptor; extern int *hbondAcceptorH1; extern int *hbondAcceptorH2; extern int *hbondAcceptorH3; #endif /* * (3) EXTERNALLY VISIBLE FUNCTION PROTOTYPES */ #ifndef ACTION_MODULE # ifdef __STDC__ extern int actionTest(actionInformation *, double *, double *, double *, double *, int); extern int transformAngle(actionInformation *, double *, double *, double *, double *, int); extern int transformAtomicFluct(actionInformation *, double *, double *, double *, double *, int); extern int transformAverage(actionInformation *, double *, double *, double *, double *, int); extern int transformCenter(actionInformation *, double *, double *, double *, double *, int); extern int transformCheckOverlap(actionInformation *, double *, double *, double *, double *, int); extern int transformClosestWaters(actionInformation *, double *, double *, double *, double *, int); extern int transformCorr(actionInformation *, double *, double *, double *, double *, int); extern int transformDiffusion(actionInformation *, double *, double *, double *, double *, int); extern int transformDihedral(actionInformation *, double *, double *, double *, double *, int); extern int transformDipole(actionInformation *, double *, double *, double *, double *, int); extern int transformDistance(actionInformation *, double *, double *, double *, double *, int); extern int transformGrid(actionInformation *, double *, double *, double *, double *, int); extern int transformHBond(actionInformation *, double *, double *, double *, double *, int); extern int transformImage(actionInformation *, double *, double *, double *, double *, int); extern int transformPrincipal(actionInformation *, double *, double *, double *, double *, int); extern int transformPucker(actionInformation *, double *, double *, double *, double *, int); extern int transformRadial(actionInformation *, double *, double *, double *, double *, int); extern int transformRMS(actionInformation *, double *, double *, double *, double *, int); extern int transformRunningAverage(actionInformation *, double *, double *, double *, double *, int); extern int transformScale(actionInformation *, double *, double *, double *, double *, int); extern int transformStrip(actionInformation *, double *, double *, double *, double *, int); extern int transformTranslate(actionInformation *, double *, double *, double *, double *, int); extern int transformTruncOct(actionInformation *, double *, double *, double *, double *, int); extern int transformVector(actionInformation *, double *, double *, double *, double *, int); extern int transformWatershell(actionInformation *, double *, double *, double *, double *, int); extern int transform2dRMS(actionInformation *, double *, double *, double *, double *, int); # else /* __STDC__ */ extern int actionTest(); extern int transformAngle(); extern int transformAtomicFluct(); extern int transformAverage(); extern int transformCenter(); extern int transformCorr(); extern int transformClosestWaters(); extern int transformDihedral(); extern int transformDiffusion(); extern int transformDipole(); extern int transformDistance(); extern int transformGrid(); extern int transformHBond(); extern int transformImage(); extern int transformPrincipal(); extern int transformPucker(); extern int transformRadial(); extern int transformRMS(); extern int transformRunningAverage(); extern int transformScale(); extern int transformStrip(); extern int transformTranslate(); extern int transformTruncOct(); extern int transformVector(); extern int transformWatershell(); extern int transform2dRMS(); # endif /* __STDC__ */ #endif /* ACTION_MODULE */ /* * (4) LOCAL STRUCTURES */ #ifdef ACTION_MODULE /* * ACTION: TRANSFORM_CORRELATION */ typedef struct _transformCorrInfo { char *name; char *filename; int totalFrames; int frame; int mode; int *mask; int *mask2; double *cx, *cy, *cz; double *vx, *vy, *vz; int tmin; int tcorr; int tmax; } transformCorrInfo; enum _corrInfo { CORR_BOX, CORR_MASK }; #define INITIALIZE_transformCorrInfo(_p_) \ _p_->name = NULL; \ _p_->filename = NULL; \ _p_->totalFrames = 0; \ _p_->frame = 0; \ _p_->mode = 0; \ _p_->mask = NULL; \ _p_->mask2 = NULL; \ _p_->cx = NULL; \ _p_->cy = NULL; \ _p_->cz = NULL; \ _p_->vx = NULL; \ _p_->vy = NULL; \ _p_->vz = NULL; \ _p_->tmin = 0; \ _p_->tcorr = 0; \ _p_->tmax = 0 /* * ACTION: TRANSFORM_DIFFUSION */ typedef struct _transformDiffusionInfo { double *dx; /* reference coordinates: MUST BE SET */ double *dy; /* TO NULL IN transformSetup */ double *dz; double timePerFrame; /* in picoseconds */ double *prevx; /* the previous x for active atoms */ double *prevy; /* the previous y */ double *prevz; /* the previous z */ double *distancex; /* the active atoms distances */ double *distancey; /* the active atoms distances */ double *distancez; /* the active atoms distances */ double *distance; /* the active atoms distances */ double *deltax; double *deltay; double *deltaz; int activeAtoms; /* the total number of active atoms in the mask */ int elapsedFrames; /* number of frames so far... */ char *outputFilenameRoot; FILE *outputx; FILE *outputy; FILE *outputz; FILE *outputr; FILE *outputa; FILE *outputxyz; } transformDiffusionInfo; #define INITIALIZE_transformDiffusionInfo(_p_) \ _p_->dx = NULL; \ _p_->dy = NULL; \ _p_->dz = NULL; \ _p_->timePerFrame = 0.0; \ _p_->prevx = NULL; \ _p_->prevy = NULL; \ _p_->prevz = NULL; \ _p_->distancex = NULL; \ _p_->distancey = NULL; \ _p_->distancez = NULL; \ _p_->distance = NULL; \ _p_->deltax = NULL; \ _p_->deltay = NULL; \ _p_->deltaz = NULL; \ _p_->activeAtoms = 0; \ _p_->elapsedFrames = 0; \ _p_->outputFilenameRoot = NULL; \ _p_->outputx = NULL; \ _p_->outputy = NULL; \ _p_->outputz = NULL; \ _p_->outputr = NULL; \ _p_->outputxyz = NULL /* * ACTION: TRANSFORM_GRID, TRANSFORM_DIPOLE */ typedef struct _transformGridInfo { double dx; double dy; double dz; int nx; int ny; int nz; int frames; float *grid; float *dipolex; float *dipoley; float *dipolez; char *filename; } transformGridInfo; #define INITIALIZE_transformGridInfo(_p_) \ _p_->dx = 0.0; \ _p_->dy = 0.0; \ _p_->dz = 0.0; \ _p_->nx = 0; \ _p_->ny = 0; \ _p_->nz = 0; \ _p_->frames = 0; \ _p_->grid = NULL; \ _p_->dipolex = NULL; \ _p_->dipoley = NULL; \ _p_->dipolez = NULL; \ _p_->filename = NULL /* * ACTION: TRANSFORM_RADIAL_INFO */ typedef struct _transformRadialInfo { double spacing; double maximum; double maximum_obs; double density; double minimum; double volume; double *distances; int *solventMask; int solventCount; int *soluteMask; int soluteCount; int *histogram; int visits; int closest; int measurements; char *fileroot; } transformRadialInfo; #define INITIALIZE_transformRadialInfo(_p_) \ _p_->spacing = 0.0; \ _p_->maximum = 0.0; \ _p_->maximum_obs = 0.0; \ _p_->density = 0.0; \ _p_->minimum = 0.0; \ _p_->volume = 0.0; \ _p_->distances = NULL; \ _p_->solventMask = NULL; \ _p_->solventCount = 0; \ _p_->soluteMask = NULL; \ _p_->soluteCount = 0; \ _p_->histogram = NULL; \ _p_->visits = 0; \ _p_->closest = 0; \ _p_->measurements = 0; \ _p_->fileroot = NULL /* * ACTION: TRANSFORM_WATERSHELL */ typedef struct _transformShellInfo { int *soluteMask; int *solventMask; int *activeResidues; int *lower; int *upper; int visits; double lowerCutoff; double upperCutoff; char *filename; } transformShellInfo; #define INITIALIZE_transformShellInfo(_p_) \ _p_->soluteMask = NULL; \ _p_->solventMask = NULL; \ _p_->activeResidues = NULL; \ _p_->lower = NULL; \ _p_->upper = NULL; \ _p_->visits = 0; \ _p_->lowerCutoff = 0.0; \ _p_->upperCutoff = 0.0; \ _p_->filename = NULL /* * ACTION: TRANSFORM_VECTOR */ typedef enum _vectorMode { VECTOR_NOOP, VECTOR_PRINCIPAL_X, VECTOR_PRINCIPAL_Y, VECTOR_PRINCIPAL_Z, VECTOR_DIPOLE, VECTOR_BOX, VECTOR_MASK } vectorMode; typedef struct _transformVectorInfo { char *name; char *filename; int totalFrames; int frame; vectorMode mode; int *mask; int *mask2; int tstep; int tcorr; double *cx, *cy, *cz; double *vx, *vy, *vz; } transformVectorInfo; #define INITIALIZE_transformVectorInfo(_p_) \ _p_->name = NULL; \ _p_->filename = NULL; \ _p_->totalFrames = 0; \ _p_->mode = VECTOR_NOOP; \ _p_->mask = NULL; \ _p_->mask2 = NULL; \ _p_->tstep = 0; \ _p_->tcorr = 0; \ _p_->cx = NULL; \ _p_->cy = NULL; \ _p_->cz = NULL; \ _p_->vx = NULL; \ _p_->vy = NULL; \ _p_->vz = NULL #endif /* ACTION_MODULE */