#ifndef __PDB_H__ #define __PDB_H__ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include /* #include "mallocd.h" */ #include "lf-string.h" #include "macros.h" #include "stat.h" #include "util.h" #ifndef ON #define ON #endif extern int opterr,optind; extern char * optarg ; typedef struct translation {int number; char *string ;} translation; typedef struct function_translation {int number; void (*function)() ;} function_translation; extern int GLY_type ; extern int ALA_type ; extern int VAL_type ; extern int LEU_type ; extern int ILE_type ; extern int PRO_type ; extern int MET_type ; extern int PHE_type ; extern int TYR_type ; extern int TRP_type ; extern int SER_type ; extern int THR_type ; extern int ASN_type ; extern int GLN_type ; extern int CYS_type ; extern int HIS_type ; extern int GLU_type ; extern int ASP_type ; extern int ARG_type ; extern int LYS_type ; #define ZN 20 #define HEM 21 #define ACE 22 #define ASH 23 #define WAT 24 typedef struct atom_definition { double charge,vdw,covalent ; double eradius, eradsq ; /* values set dynamically */ char name[4] ; int flag ; int type_index; } atom_definition ; typedef struct residue_description { int index,atomnum; char name[4] ; atom_definition atom_definitions[1] ; /* This must always last */ } residue_description ; typedef struct a_matrix { double xx,xy,xz,yx,yy,yz,zx,zy,zz; } a_matrix ; typedef struct symmetry_operation { double xx,xy,xz,yx,yy,yz,zx,zy,zz,addx,addy,addz; } symmetry_operation ; typedef struct space_group { char s_name[16], name[16] ; int number, ops_number, primitives ; symmetry_operation ops[48] ; } space_group ; typedef struct residue_record *residue_record_pointer ; typedef struct file_records * file_records_pointer; typedef struct atom_record *atom_record_pointer ; typedef struct AtomList * AtomListPointer ; typedef struct residue_record { char resname [4] ; residue_description *restype ; int start,end; atom_record_pointer ca,cb,n,o,c; file_records_pointer file; int flags ; int index ; int number ; char chain ; char x_char; residue_record_pointer prev,next ; } residue_record ; /* Notes a) we should realy change this to a union, because it is used as a union b) Normally definition field is pointing into an atom_definition in a residue description. If you want to change individual atom, MALLOC a definition, copy the one the atom points to, and then modify the new one, and set the atom to point to it. You also have to: 1) OR into flags MODIFIED_ATOM for free_atom_record 2) make sure traverse_atom_definitions find it. c) Moving the relative position in the structure of the residue_description and atom_description pointers messes up the cube calculation in inexplicable ways. */ typedef struct atom_record { int atomtype; /* the number associated with ident */ char ident[7] ; /* the keywords in the beginning e.g ATOM */ char resname[4] ; /* directly from the file */ char name[4] ; /* directly from the file */ char extraflag ; /* directly from the file, the character before resname */ char chain; /* directly from the file */ char x_char; /* directly from the file */ int number; /* directly from the file */ int resnum; /* directly from the file */ /* - These next 8 must occur sequentially */ double v[1] ; /* 0. Checked in ResidueLinkup.c so v[1]=x */ double x; /* 1. directly from the file */ double y; /* 2. directly from the file */ double z; /* 3. directly from the file */ double occ ; /* 4. directly from the file */ double b ; /* 5. directly from the file */ double volume; /* 6. Directly from the file or calculated */ double surface; /* 7. Directly from the file or calculated */ /* - */ char * footnote; /* Only for output at present */ char * strg71on; /* Only for output at present: Columns 71 on of normal pdb file. */ residue_description *restype; /* the residue description (note (c) above) */ atom_definition * definition ; /* the atom definition (note (b) above) */ int dumm_solvents; /* dumm_solvent used in calculating the volume */ int flags; /* for internal working, see below */ atom_record_pointer chaining; /* for internal working (Used in Grid.c & neibour-cube.c) */ AtomListPointer Contacts ; /* For lists of contacting atoms */ residue_record * InRes ; int Index ; } atom_record ; /* Not used : AtomListPointer BondedTo ; AtomListPointer HBondedTo ; */ /* The atom record is explained in more detail for two example atoms: 1 2 3 4 5 6 7 8 012345678901234567890123456789012345678901234567890123456789012345678901234567890 ATOM 47 O VAL 6 -33.066 13.006 21.795 1.00 81.00 ATOM 322 HB10W10 32 9.686 6.317 -0.186 The atom_record fields would be: position Field atom1 atom2 beg end ----- ----- ----- --- --- indent "ATOM " 0 5 number 47 322 6 11 name "O" "HB1" 12 15 extraflag ' ' '0' 16 resname "VAL" "W10" 17 19 chain ' ' ' ' 21 resnum 6 32 22 25 xchar ' ' ' ' 26 x -33.066 30 y 13.006 z 21.795 occ 1.00 b 81.00 */ typedef struct file_records { atom_record **atoms; /* An array location to hold all the atom_records */ int atomnum; /* The number of atoms in a structure */ char *name ; char *header ; residue_record ** residues[128]; residue_record * FirstResidue ; int resnum[128] ; int residue_count, LinkCount ; int flag, LinkUpResiduesFlag ; space_group sg ; double a,b,c,alpha,beta,gamma; symmetry_operation scale; a_matrix inverse_scale; void * ExtraAtomData; } file_records ; /* values for the atomtype field in atom_record */ #define RECORD_REMARK 0 #define RECORD_CRYST 1 #define RECORD_SCALE 2 #define RECORD_SSBOND 3 #define RECORD_EXPDTA 4 #define RECORD_HEADER 5 #define RECORD_MODEL 6 #define RECORD_ENDMDL 7 #define RECORD_SCALE1 8 #define RECORD_SCALE2 8 #define RECORD_SCALE3 8 /* keep this larger than the others above, so can check for interesting records just by comparing to RECORD_ATOM, i.e. if(RECORD_ATOM <= atom->atomtype) */ #define RECORD_ATOM 1000 #define RECORD_HETATM 1001 #define RECORD_DUMMY 1002 /* Values for the flag field in atom_record */ #define IGNORE_ATOM 1 #define DONT_CALCULATE_ATOM 2 #define MODIFIED_ATOM 4 #define SULPHUR_BRIDGE 8 #define MAIN_CHAIN_ATOM 16 #define REJECTED_ATOM 32 #define BURIED_WATER 64 /* New flag definitions from MBG */ #define FLAG_1_DESELECT IGNORE_ATOM #define FLAG_2_DESELECT DONT_CALCULATE_ATOM #define SWITCH_ON(atom,flag) atom->flags |= flag #define SWITCH_OFF(atom,flag) atom->flags &= ~flag /* flags defining the format of the file */ #define BROOKHAVEN 0 /* additional flags that can be or'ed into the file format */ #define IO_ALL_RECORDS 0x1000 /* read/write also records that don't describe atoms */ #define IO_VOLUME 0x2000 /* read/write surface, volume etc too */ #define IO_HYDROGEN 0x4000 /* read hydrogen atoms */ #define IO_SURFACE 0x8000 #define IO_SHORT 0x10000 #define IO_ONLY_SELECTED 0x20000 #define IO_NOT_IGNORED 0x40000 #define IO_FOOTPLUS 0x80000 /* write the footnote and strg71on fields of an atom */ typedef struct grid_descriptor { int xdim; int ydim; int zdim ; int yzdim ; double edge ; double origx; double origy; double origz; atom_record ** grid; } grid_descriptor ; #define GRID_SLOTS(gd) int xdim = gd->xdim; \ int ydim = gd->ydim; \ int zdim = gd->zdim; \ int yzdim = gd->yzdim; \ double origx = gd->origx; \ double origy = gd->origy; \ double origz = gd->origz; \ atom_record ** grid = gd->grid; \ double edge = gd->edge; \ #define GRID(x,y,z) grid[x * yzdim + y * zdim + z] #define MAX_ATOM_TYPE 120 typedef struct AtomList { atom_record *atom; /* pointer to atom_record */ struct AtomList * NextAtom; /* pointer to another node */ double Dist ; } AtomList; # define MAX_CUBE_DIM 100 typedef struct cube { AtomList *GridData[MAX_CUBE_DIM][MAX_CUBE_DIM][MAX_CUBE_DIM] ; /* Array of pointers to nodes */ double rcut; /* Cutoff distance */ int dimx,dimy,dimz; /* dimensions of the grid */ double MinX,MinY,MinZ; /* Minimum coordinates of grid*/ } Cube; #define ACTION_NMR 1 #define ACTION_END_MODEL 2 extern int model_number ; extern int action_flag ; extern int read_nmr_files ; extern double atom_vdw[ MAX_ATOM_TYPE ] ; extern double atom_covalent[ MAX_ATOM_TYPE ] ; extern double atom_charge[ MAX_ATOM_TYPE ] ; extern residue_description *dumm_residue ; extern atom_definition *default_atom ; extern double maximum_x, maximum_y,maximum_z, maximum_r,minimum_x,minimum_y,minimum_z ,minimum_r ; extern int residue_character_types[] ; extern int first_water_type ; extern int second_water_type ; extern double reference_volume []; extern double residue_frequency[]; extern double residue_molecular_weight[]; extern double distance_check ; extern residue_description ** residue_types ; extern int handle_missing_atom_definition ; /* definitions for debugging switches */ extern int debugging ; #define DEBUG_LEVEL_1 1 #define DEBUG_LEVEL_2 2 #define DEBUG_LEVEL_3 4 #define DEBUG_SURFACE 8 #define DEBUG_CUBE 16 #define DEBUG_VOLUME 32 #define DEBUG_SYMMETRY 64 #define DEBUG_VOLUME_2 128 #define ARG_TYPE_INTEGER 2 #define ARG_TYPE_STRING 1 #define ARG_TYPE_ATOM 3 /* flags fro call_with_neibours */ #define CWN_ALL_ATOMS -1 #define CWN_NOT_IGNORE -2 #define CWN_NOT_SELCTED -3 # include "ExtraAtomRecords.h" # include "pdb_prototypes1.h" # include "pdb_prototypes2.h" #include "NSelect.h" #ifdef __cplusplus } #endif #endif /* !__PDB_H__ */