Tagged files with gromacs 3.0 header and added some license info
[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 3.0
11  * 
12  * Copyright (c) 1991-2001
13  * BIOSON Research Institute, Dept. of Biophysical Chemistry
14  * University of Groningen, The Netherlands
15  * 
16  * This program is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU General Public License
18  * as published by the Free Software Foundation; either version 2
19  * of the License, or (at your option) any later version.
20  * 
21  * If you want to redistribute modifications, please consider that
22  * scientific software is very special. Version control is crucial -
23  * bugs must be traceable. We will be happy to consider code for
24  * inclusion in the official distribution, but derived work must not
25  * be called official GROMACS. Details are found in the README & COPYING
26  * files - if they are missing, get the official version at www.gromacs.org.
27  * 
28  * To help us fund GROMACS development, we humbly ask that you cite
29  * the papers on the package - you can find them in the top README file.
30  * 
31  * Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
32  * 
33  * And Hey:
34  * Good ROcking Metal Altar for Chronical Sinners
35  */
36
37 #ifndef _pdbio_h
38 #define _pdbio_h
39
40 static char *SRCID_pdbio_h = "$Id$";
41 #ifdef HAVE_CONFIG_H
42 #include <config.h>
43 #endif
44
45 #ifdef HAVE_IDENT
46 #ident  "@(#) pdbio.h 1.12 7/28/97"
47 #endif /* HAVE_IDENT */
48 #include "sysstuff.h"
49 #include "typedefs.h"
50 #include "symtab.h"
51
52 /* THE pdb format (for ATOM/HETATOM lines) */
53 static char *pdbformat ="%-6s%5u  %-4.4s%3.3s %c%4d    %8.3f%8.3f%8.3f";
54 static char *pdbformat4="%-6s%5u %-4.4s %3.3s %c%4d    %8.3f%8.3f%8.3f";
55
56 /* Enumerated type for pdb records. The other entries are ignored
57  * when reading a pdb file 
58  */
59 enum { epdbATOM, epdbHETATM, epdbANISOU, epdbCRYST1, epdbCOMPND, 
60        epdbMODEL, epdbENDMDL, epdbTER, epdbHEADER, epdbTITLE, epdbREMARK, 
61        epdbNR };
62
63 /* Enumerated value for indexing an uij entry (anisotropic temperature factors) */
64 enum { U11, U22, U33, U12, U13, U23 };
65        
66 extern void set_pdb_wide_format(bool bSet);
67 /* If bSet, use wider format for occupancy and bfactor */
68
69 extern void pdb_use_ter(bool bSet);
70 /* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE) */
71
72 extern void write_pdbfile_indexed(FILE *out,char *title,t_atoms *atoms,
73                                   rvec x[],matrix box,char chain,
74                                   int model_nr,atom_id nindex,atom_id index[]);
75 /* REALLY low level */
76
77 extern void write_pdbfile(FILE *out,char *title,t_atoms *atoms,
78                           rvec x[],matrix box,char chain,int model_nr);
79 /* Low level pdb file writing routine.
80  * 
81  *          ONLY FOR SPECIAL PURPOSES,
82  * 
83  *       USE write_sto_conf WHEN YOU CAN.
84  *
85  * override chain-identifiers with chain when chain>0
86  * write ENDMDL when bEndmodel is TRUE */
87   
88 extern int read_pdbfile(FILE *in,char *title,int *model_nr,
89                         t_atoms *atoms,rvec x[],matrix box,bool bChange);
90 /* Function returns number of atoms found. */
91
92 extern void read_pdb_conf(char *infile,char *title, 
93                           t_atoms *atoms,rvec x[],matrix box,bool bChange);
94 /* Read a pdb file and extract ATOM and HETATM fields.
95  * Read a box from the CRYST1 line, return 0 box when no CRYST1 is found.
96  * Change atom names according to protein conventions if wanted
97  */
98
99 extern void get_pdb_coordnum(FILE *in,int *natoms);
100 /* Read a pdb file and count the ATOM and HETATM fields. */
101
102 extern bool is_hydrogen(char *nm);
103 /* Return whether atom nm is a hydrogen */
104
105 extern bool is_dummymass(char *nm);
106 /* Return whether atom nm is a dummy mass */
107
108 #endif  /* _pdbio_h */