/* * Copyright <2012> * Copyright <2013-2018> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef DH_RPDBB #define DH_RPDBB #include #include #include #include "atom.h" #include "pertable.h" #include "utils.h" #include "memhandler.h" #include "math.h" #include "fparams.h" /* * Plugin header files; get plugin source from www.ks.uiuc.edu/Research/vmd" */ #include "libmolfile_plugin.h" #include "molfile_plugin.h" #define M_PDB_LINE_LEN 80 /**< actual record size */ #define M_PDB_BUF_LEN 83 /**< size need to buffer + CR, LF, and NUL */ #define M_PDB_FILE_NAME_LEN 500 /**< size allocated for PDB file names*/ #define M_KEEP_LIG 1 /**< Keep ligand flag*/ #define M_DONT_KEEP_LIG 0 /**< Don't keep ligand flag*/ #define M_PDB_HEADER 1 #define M_PDB_REMARK 2 #define M_PDB_ATOM 3 #define M_PDB_CONECT 4 #define M_PDB_HETATM 5 #define M_PDB_CRYST1 6 #define M_PDB_EOF 7 #define M_PDB_END 8 #define M_PDB_UNKNOWN 9 #define NB_MM_TYPES 9 /* * API functions start here */ /** Container of the PDB structure */ typedef struct s_atom_ptr_list{ s_atm **latoms; int natoms; } s_atom_ptr_list; typedef struct s_pdb_grid{ s_atom_ptr_list ***atom_ptr; /**< values of the md grid (i.e. number of alpha spheres nearby*/ float *origin; /**< origin of the grid (3 positons, xyz)*/ int nx,ny,nz; /**< gridsize at the x, y, z axis*/ float resolution; /**< resolution of the grid; in general 1A*/ } s_pdb_grid; typedef struct s_pdb { FILE *fpdb ; /**< file handle of the pdb file*/ s_pdb_grid *grid; s_atm *latoms ; /**< The list of atoms: contains all atoms! */ s_atm **latoms_p ; /**< List of pointers to latoms elements. */ s_atm **lhetatm ; /**< List of pointer to heteroatoms in the latoms list. */ s_atm **latm_lig ; /**< List of pointer to the ligand atoms in the atom list*/ float *xlig_x; /**