00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef DH_RPDBB
00034 #define DH_RPDBB
00035
00036 #include <stdio.h>
00037 #include <stdlib.h>
00038 #include <string.h>
00039
00040 #include "atom.h"
00041 #include "pertable.h"
00042 #include "utils.h"
00043 #include "memhandler.h"
00044
00045
00046 #define M_PDB_LINE_LEN 80
00047 #define M_PDB_BUF_LEN 83
00048
00049 #define M_KEEP_LIG 1
00050 #define M_DONT_KEEP_LIG 0
00051
00052 #define M_PDB_HEADER 1
00053 #define M_PDB_REMARK 2
00054 #define M_PDB_ATOM 3
00055 #define M_PDB_CONECT 4
00056 #define M_PDB_HETATM 5
00057 #define M_PDB_CRYST1 6
00058 #define M_PDB_EOF 7
00059 #define M_PDB_END 8
00060 #define M_PDB_UNKNOWN 9
00061
00062
00063
00064
00065
00066
00067
00068 typedef struct s_pdb
00069 {
00070 FILE *fpdb ;
00071
00072 s_atm *latoms ;
00073
00074 s_atm **latoms_p ;
00075 s_atm **lhetatm ;
00076 s_atm **latm_lig ;
00077
00078 int natoms,
00079 nhetatm,
00080 natm_lig ;
00081
00082 float A, B, C,
00083 alpha, beta, gamma ;
00084
00085 char header[M_PDB_BUF_LEN] ;
00086
00087 } s_pdb ;
00088
00089
00090
00091
00092 s_pdb* rpdb_open(char *fpath, const char *ligan, const int keep_lig) ;
00093 void rpdb_read(s_pdb *pdb, const char *ligan, const int keep_lig) ;
00094
00095 void rpdb_extract_atm_resname(char *pdb_line, char *res_name) ;
00096 int element_in_kept_res(char *res_name);
00097 void guess_element(char *aname, char *element, char *res_name) ;
00098
00099 void rpdb_extract_cryst1(char *rstr, float *alpha, float *beta, float *gamma,
00100 float *a, float *b, float *c) ;
00101 void rpdb_extract_atom_values(char *pdb_line, float *x, float *y, float *z,
00102 float *occ, float *beta) ;
00103
00104 void rpdb_extract_pdb_atom( char *pdb_line, char *type, int *atm_id, char *name,
00105 char *alt_loc, char *res_name, char *chain,
00106 int *res_id, char *insert,
00107 float *x, float *y, float *z, float *occ,
00108 float *bfactor, char *symbol, int *charge, int *guess_flag) ;
00109
00110 void free_pdb_atoms(s_pdb *pdb) ;
00111
00112 #endif