Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Macros | Functions | Variables
HAddPDB.c File Reference

Add hydrogens to a PDB linked list. More...

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include "MathType.h"
#include "SysDefs.h"
#include "pdb.h"
#include "fsscanf.h"
#include "macros.h"
#include "general.h"

Go to the source code of this file.

Macros

#define MAXTYPE   300 /* Max number of H definitions in PGP file */
 
#define MAXLABEL   8 /* Max chars in a label */
 
#define MAXBUFF   160 /* Buffer size */
 
#define DATAENV   "DATADIR" /* Unix environment variable for data */
 
#define DATADIR   "AMDATA:" /* VMS/AMigaDOS assign for data */
 
#define EXPLPGP   "Explicit.pgp" /* The PGP filename */
 
#define ALLHPGP   "AllH.pgp" /* The PGP filename */
 

Functions

int blHAddPDB (FILE *fp, PDB *pdb)
 
int blReadPGP (FILE *fp)
 
FILE * blOpenPGPFile (char *pgpfile, BOOL AllHyd)
 

Variables

HADDINFO gHaddInfo
 

Detailed Description

Add hydrogens to a PDB linked list.

Version
V2.22
Date
23.06.15
Author
Dr. Andrew C. R. Martin
Institute of Structural & Molecular Biology, University College London, Gower Street, London. WC1E 6BT.
andre.nosp@m.w@bi.nosp@m.oinf..nosp@m.org..nosp@m.uk andre.nosp@m.w.ma.nosp@m.rtin@.nosp@m.ucl..nosp@m.ac.uk

This code is NOT IN THE PUBLIC DOMAIN, but it may be copied according to the conditions laid out in the accompanying file COPYING.DOC.

The code may be modified as required, but any modifications must be documented so that the person responsible can be identified.

The code may not be sold commercially or included as part of a commercial product except as described in the file COPYING.DOC.

Description:

Routine to add hydrogens to a protein linked list of type PDB. The routine allocates space for the new atoms and inserts them into the list at the appropriate positions within the residues.

N.B. Because of the variation in styles required for N-terminal Hs, this routine adds no hydrogens to the N-terminal residue. FixPDB() may be used for this purpose if CHARMM/CONGEN style hydrogens are required.

Usage:

nhyd = blHAddPDB(fp,pdb)
Parameters
[in]*fpFile containing proton generation parameters.
[in,out]*pdbLinked list of protein structure.
Returns
Number of hydrogens added.

The globally defined structure gHaddInfo gives information on the number of each hydrogen type created. This structure is defined as follows:

typdef struct
{
int Total, Total hydrogens
T1, Type 1 C-H's
T2, Type 2 C-H2's
T3, Type 3 C-H3's
T4, Type 4 sp2 C-H's,>N-H
T5; Type 5 O-H's =N-H's

To examine these values in your code, reference the structure as: extern HADDINFO gHaddInfo;

Revision History:

Definition in file HAddPDB.c.

Macro Definition Documentation

#define ALLHPGP   "AllH.pgp" /* The PGP filename */

Definition at line 177 of file HAddPDB.c.

#define DATADIR   "AMDATA:" /* VMS/AMigaDOS assign for data */

Definition at line 175 of file HAddPDB.c.

#define DATAENV   "DATADIR" /* Unix environment variable for data */

Definition at line 174 of file HAddPDB.c.

#define EXPLPGP   "Explicit.pgp" /* The PGP filename */

Definition at line 176 of file HAddPDB.c.

#define MAXBUFF   160 /* Buffer size */

Definition at line 173 of file HAddPDB.c.

#define MAXLABEL   8 /* Max chars in a label */

Definition at line 172 of file HAddPDB.c.

#define MAXTYPE   300 /* Max number of H definitions in PGP file */

Definition at line 171 of file HAddPDB.c.

Function Documentation

int blHAddPDB ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpFile pointer to PGP file
[in,out]*pdbPDB Linked list to which Hs are added
Returns
Number of Hs added. -1 on error.

Globals: HADDINFO gHaddInfo Information on Hs added

This routine adds hydrogens to a PDB linked list. Performs all necessary functions.

N.B. Because of the variation in styles required for N-terminal Hs, this routine adds no hydrogens to the N-terminal residue. FixPDB() may be used for this purpose if CHARMM/CONGEN style hydrogens are required.

  • 16.05.90 Original By: ACRM
  • 04.01.94 Changed check on return=NULL to 0
  • 08.03.94 Only reads PGP on first call. err_flag changed to BOOL.
  • 28.11.05 Removes any dummy hydrogens added because there were missing atoms
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.02.15 Uses blRenumAtomsPDB() By: ACRM
  • 20.03.15 Returns -1 on error since zero hydrogens may be valid

Definition at line 250 of file HAddPDB.c.

FILE* blOpenPGPFile ( char *  pgpfile,
BOOL  AllHyd 
)
Parameters
[in]*pgpfileName of a PGP file or NULL
[in]AllHydIf name of PGP not specified, this flag specified whether all or explicit hydrogen file required
Returns
File pointer

Open the PGP file

  • 23.08.94 Original By: ACRM
  • 28.07.05 Added conditionals for msdos and Mac OS/X
  • 07.07.14 Use bl prefix for functions By: CTP
  • 18.03.15 Changed to use MAXBUFF By: ACRM

Definition at line 1347 of file HAddPDB.c.

int blReadPGP ( FILE *  fp)
Parameters
[in]*fpPointer to PGP file.
Returns
Number of parameters read. (0 on error)

Read a proton generation parameter file. All data are placed in static arrays used by the hydrogen adding routines. Normally this routine is only called by the first call to HAddPDB(). It is only necessary to call this routine explicitly if the PGP file is changed between calls to HAddPDB() and thus needs re-reading.

  • 16.05.90 Original By: ACRM
  • 27.07.93 Changed to use fsscanf()
  • 01.03.94 Changed static variable names
  • 01.09.94 Moved n++ out of the fsscanf()
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.03.15 Skips comments
  • 20.03.15 Returns 0 on error (MAXTYPE exceeded)

Definition at line 301 of file HAddPDB.c.

Variable Documentation

HADDINFO gHaddInfo

Definition at line 210 of file HAddPDB.c.