HAddPDB.c



int HAddPDB(FILE *fp, PDB *pdb)

Inputs

FILE *fp File pointer to PGP file

Input/Output

PDB *pdb PDB Linked list to which Hs are added

Returns

int Number of Hs added. 0 if error. HADDINFO gHaddInfo Information on Hs added

Description

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.

Created: 16.05.90 Last Modified: 08.03.94


int ReadPGP(FILE *fp)

Inputs

FILE *fp Pointer to PGP file.

Returns

int Number of parameters read.

Description

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.

Created: 16.05.90 Last Modified: 01.09.94


static int GenH(PDB *pdb, BOOL *err_flag)

Input/Output

PDB *pdb PDB Linked to which Hs are added
BOOL *err_flag Error flag

Returns

int Number of hydrogens added (0 if error)

Description

Does the actual work of generating a set of hydrogens

Created: 16.05.90 Last Modified: 26.01.96


static PDB *makeh(int HType, REAL BondLen, REAL alpha, REAL beta, BOOL firstres)

Inputs

int HType Hydrogen type number
REAL BondLen Length of the bond to the added hydrogen
REAL alpha The first angle defining the H coordinate
REAL beta The second angle defining the H coordinate
REAL firstres If set, don't add a planar hydrogen as it's the first residue of a chain

Returns

PDB * Pointer to linked list of created hydrogens. NULL if memory allocation fails or this is the Nter N where we don't require a planar H or all atoms have been done.

Description

Generate a set of hydrogen coordinates. The antecedent atoms are set in static external variables. A linked list containing the appropriate number of Hs is returned.

Created: 16.05.90 Last Modified: 24.05.99


static BOOL AddH(PDB *hlist, PDB **position, int HType)

Inputs

PDB *hlist Linked list of hydrogens to be merged
PDB **position Array of PDB pointers for atoms in this residue
int HType Hydrogen type

Returns

BOOL Success?

Description

AddH() merges a list of hydrogens for this atom into the main pdb structure list. Returns FALSE if the procedure failed.

Created: 16.05.90 Last Modified: 16.05.90


FILE *OpenPGPFile(char *pgpfile, BOOL AllHyd)

Inputs

char *pgpfile Name of a PGP file or NULL
BOOL AllHyd If name of PGP not specified, this flag specified whether all or explicit hydrogen file required

Returns

FILE * File pointer

Created: 23.08.94 Last Modified: 23.08.94