6e87a75dcbde2adc7d76bfc569ba881a90a8c640
[alexxy/gromacs.git] / include / pdbio.h
1 /*
2  * $Id$
3  * 
4  *       This source code is part of
5  * 
6  *        G   R   O   M   A   C   S
7  * 
8  * GROningen MAchine for Chemical Simulations
9  * 
10  *               VERSION 2.0
11  * 
12  * Copyright (c) 1991-1999
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * Please refer to:
17  * GROMACS: A message-passing parallel molecular dynamics implementation
18  * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19  * Comp. Phys. Comm. 91, 43-56 (1995)
20  * 
21  * Also check out our WWW page:
22  * http://md.chem.rug.nl/~gmx
23  * or e-mail to:
24  * gromacs@chem.rug.nl
25  * 
26  * And Hey:
27  * Good ROcking Metal Altar for Chronical Sinners
28  */
29
30 #ifndef _pdbio_h
31 #define _pdbio_h
32
33 static char *SRCID_pdbio_h = "$Id$";
34
35 #ifdef HAVE_CONFIG_H
36 #include <config.h>
37 #endif
38
39 #ifdef HAVE_IDENT
40 #ident  "@(#) pdbio.h 1.12 7/28/97"
41 #endif /* HAVE_IDENT */
42 #include "sysstuff.h"
43 #include "typedefs.h"
44 #include "symtab.h"
45
46 /* THE pdb format (for ATOM/HETATOM lines) */
47 static char *pdbformat ="%-6s%5u  %-4.4s%3.3s %c%4d    %8.3f%8.3f%8.3f";
48 static char *pdbformat4="%-6s%5u %-4.4s %3.3s %c%4d    %8.3f%8.3f%8.3f";
49
50 /* Enumerated type for pdb records. The other entries are ignored
51  * when reading a pdb file 
52  */
53 enum { epdbATOM, epdbHETATM, epdbANISOU, epdbCRYST1, epdbCOMPND, 
54        epdbMODEL, epdbENDMDL, epdbTER, epdbHEADER, epdbTITLE, epdbREMARK, 
55        epdbNR };
56
57 /* Enumerated value for indexing an uij entry (anisotropic temperature factors) */
58 enum { U11, U22, U33, U12, U13, U23 };
59        
60 extern void set_pdb_wide_format(bool bSet);
61 /* If bSet, use wider format for occupancy and bfactor */
62
63 extern void pdb_use_ter(bool bSet);
64 /* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE) */
65
66 extern void write_pdbfile_indexed(FILE *out,char *title,t_atoms *atoms,
67                                   rvec x[],matrix box,char chain,
68                                   int model_nr,atom_id nindex,atom_id index[]);
69 /* REALLY low level */
70
71 extern void write_pdbfile(FILE *out,char *title,t_atoms *atoms,
72                           rvec x[],matrix box,char chain,int model_nr);
73 /* Low level pdb file writing routine.
74  * 
75  *          ONLY FOR SPECIAL PURPOSES,
76  * 
77  *       USE write_sto_conf WHEN YOU CAN.
78  *
79  * override chain-identifiers with chain when chain>0
80  * write ENDMDL when bEndmodel is TRUE */
81   
82 extern int read_pdbfile(FILE *in,char *title,int *model_nr,
83                         t_atoms *atoms,rvec x[],matrix box,bool bChange);
84 /* Function returns number of atoms found. */
85
86 extern void read_pdb_conf(char *infile,char *title, 
87                           t_atoms *atoms,rvec x[],matrix box,bool bChange);
88 /* Read a pdb file and extract ATOM and HETATM fields.
89  * Read a box from the CRYST1 line, return 0 box when no CRYST1 is found.
90  * Change atom names according to protein conventions if wanted
91  */
92
93 extern void get_pdb_coordnum(FILE *in,int *natoms);
94 /* Read a pdb file and count the ATOM and HETATM fields. */
95
96 extern bool is_hydrogen(char *nm);
97 /* Return whether atom nm is a hydrogen */
98
99 extern bool is_dummymass(char *nm);
100 /* Return whether atom nm is a dummy mass */
101
102 #endif  /* _pdbio_h */