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

Include file for PDB routines. More...

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "MathType.h"
#include "SysDefs.h"
#include "general.h"
#include "hash.h"
#include "deprecated.h"

Go to the source code of this file.

Data Structures

struct  _blAtomInfo
 
struct  pdb_entry
 
struct  pdbresidue
 
struct  pdbchain
 
struct  PDBSTRUCT
 
struct  sec_entry
 
struct  _wholepdb
 
struct  _compnd
 
struct  _pdbsource
 
struct  _modres
 
struct  _biomt
 
struct  _biomolecule
 
struct  _disulphide
 
struct  HADDINFO
 

Macros

#define MAXSTDAA   21 /* Number of standard amino acids (w/ PCA) */
 
#define MAXATINAA   14 /* Max number of (heavy) atoms in a standard aa */
 
#define MAXATINRES
 
#define MAXCONECT   8 /* Max number of CONECT connections */
 
#define DEFCONECTTOL   0.1 /* Default CONECT tolerence */
 
#define MAXPDBANNOTATION
 
#define blMAXCHAINLABEL   8
 
#define SELECT(x, w)
 
#define SEC   (The_type_SEC_is_now_called_SECSTRUC_You_must_change_your_code *)
 
#define CLEAR_PDB(p)
 
#define ISWATER(z)
 
#define CHAINMATCH(chain1, chain2)   !strcmp(chain1, chain2)
 
#define INSERTMATCH(ins1, ins2)   !strcmp(ins1, ins2)
 
#define PDBCHAINMATCH(p, q)   !strcmp((p)->chain, (q)->chain)
 
#define PDBINSERTMATCH(p, q)   !strcmp((p)->insert, (q)->insert)
 
#define CREATEPDBEXTRAS(x, y)
 
#define FREEPDBEXTRAS(x)
 
#define PDBEXTRASPTR(p, type)   ((type *)((p)->extras))
 
#define MAKERESID(x, p)
 
#define RESIDMATCH(p, q)
 
#define STRUCTURE_TYPE_UNKNOWN   0
 
#define STRUCTURE_TYPE_XTAL   1
 
#define STRUCTURE_TYPE_NMR   2
 
#define STRUCTURE_TYPE_MODEL   3
 
#define STRUCTURE_TYPE_ELECTDIFF   4
 
#define STRUCTURE_TYPE_FIBER   5
 
#define STRUCTURE_TYPE_SSNMR   6
 
#define STRUCTURE_TYPE_NEUTRON   7
 
#define STRUCTURE_TYPE_EM   8
 
#define STRUCTURE_TYPE_SOLSCAT   9
 
#define STRUCTURE_TYPE_IR   10
 
#define STRUCTURE_TYPE_POWDER   11
 
#define STRUCTURE_TYPE_FRET   12
 
#define CTER_STYLE_STD   0
 
#define CTER_STYLE_GROMOS   1
 
#define CTER_STYLE_CHARMM   2
 
#define XTAL_DATA_CRYST   0x0001
 
#define XTAL_DATA_ORIGX   0x0002
 
#define XTAL_DATA_SCALE   0x0004
 
#define ZONE_MODE_RESNUM   0
 
#define ZONE_MODE_SEQUENTIAL   1
 
#define FORCEXML_NOFORCE   0
 
#define FORCEXML_PDB   1
 
#define FORCEXML_XML   2
 
#define FORCEPDB   gPDBXMLForce = FORCEXML_PDB
 
#define FORCEXML   gPDBXMLForce = FORCEXML_XML
 
#define ATOMTYPE_NONRESIDUE   128
 
#define ATOMTYPE_UNDEF   0
 
#define ATOMTYPE_ATOM   1
 
#define ATOMTYPE_NUC   2
 
#define ATOMTYPE_MODPROT   3
 
#define ATOMTYPE_MODNUC   4
 
#define ATOMTYPE_NONSTDAA   5
 
#define ATOMTYPE_NONSTDNUC   6
 
#define ATOMTYPE_HETATM   (7 | ATOMTYPE_NONRESIDUE)
 
#define ATOMTYPE_METAL   (8 | ATOMTYPE_NONRESIDUE)
 
#define ATOMTYPE_WATER   (9 | ATOMTYPE_NONRESIDUE)
 
#define ATOMTYPE_BOUNDHET   (10 | ATOMTYPE_NONRESIDUE)
 
#define ATOMTYPE_BOUNDPOLYHET   (11 | ATOMTYPE_NONRESIDUE)
 
#define _PDB_H_DEPRECATED
 

Typedefs

typedef struct _blAtomInfo blATOMINFO
 
typedef struct pdb_entry PDB
 
typedef struct pdbresidue PDBRESIDUE
 
typedef struct pdbchain PDBCHAIN
 
typedef struct sec_entry SECSTRUC
 
typedef struct _wholepdb WHOLEPDB
 
typedef struct _compnd COMPND
 
typedef struct _pdbsource PDBSOURCE
 
typedef struct _modres MODRES
 
typedef struct _biomt BIOMT
 
typedef struct _biomolecule BIOMOLECULE
 
typedef struct _disulphide DISULPHIDE
 

Functions

PDBblReadPDB (FILE *fp, int *natom)
 
PDBblReadPDBAll (FILE *fp, int *natom)
 
PDBblReadPDBAtoms (FILE *fp, int *natom)
 
PDBblReadPDBOccRank (FILE *fp, int *natom, int OccRank)
 
PDBblReadPDBAtomsOccRank (FILE *fp, int *natom, int OccRank)
 
WHOLEPDBblDoReadPDB (FILE *fp, BOOL AllAtoms, int OccRank, int ModelNum, BOOL DoWhole)
 
WHOLEPDBblDoReadPDBML (FILE *fp, BOOL AllAtoms, int OccRank, int ModelNum, BOOL DoWhole)
 
BOOL blCheckFileFormatPDBML (FILE *fp)
 
int blWritePDB (FILE *fp, PDB *pdb)
 
int blWritePDBAsPDBorGromos (FILE *fp, PDB *pdb, BOOL doGromos)
 
BOOL blWritePDBAsPDBML (FILE *fp, PDB *pdb)
 
void blWriteTerCard (FILE *fp, PDB *p)
 
BOOL blFormatCheckWritePDB (PDB *pdb)
 
BOOL blWriteWholePDB (FILE *fp, WHOLEPDB *wpdb)
 
BOOL blWriteWholePDBNoConect (FILE *fp, WHOLEPDB *wpdb)
 
void blWriteWholePDBHeader (FILE *fp, WHOLEPDB *wpdb)
 
void blWriteWholePDBTrailer (FILE *fp, WHOLEPDB *wpdb, int numTer)
 
void blWriteWholePDBHeaderNoRes (FILE *fp, WHOLEPDB *wpdb)
 
BOOL blBuildConectData (PDB *pdb, REAL tol)
 
BOOL blAddConect (PDB *p, PDB *q)
 
BOOL blAddOneDirectionConect (PDB *p, PDB *q)
 
BOOL blDeleteConect (PDB *p, PDB *q)
 
BOOL blDeleteAConectByNum (PDB *pdb, int cNum)
 
void blDeleteAtomConects (PDB *pdb)
 
BOOL blCopyConects (PDB *out, PDB *in)
 
BOOL blIsConected (PDB *p, PDB *q)
 
BOOL blIsBonded (PDB *p, PDB *q, REAL tol)
 
PDBblDeleteAtomPDB (PDB *pdb, PDB *atom)
 
PDBblDeleteAtomRangePDB (PDB *pdb, PDB *start, PDB *stop)
 
BOOL blAreResiduesBonded (PDB *pdb, char *chain1, int resnum1, char *insert1, char *chain2, int resnum2, char *insert2, REAL tol)
 
BOOL blAreResiduePointersBonded (PDB *res1, PDB *res2, REAL tol)
 
void blWritePDBRecord (FILE *fp, PDB *pdb)
 
void blWritePDBRecordAtnam (FILE *fp, PDB *pdb)
 
void blWriteGromosPDB (FILE *fp, PDB *pdb)
 
void blWriteGromosPDBRecord (FILE *fp, PDB *pdb)
 
void blGetCofGPDB (PDB *pdb, VEC3F *cg)
 
void blGetCofGPDBRange (PDB *start, PDB *stop, VEC3F *cg)
 
void blGetCofGPDBSCRange (PDB *start, PDB *stop, VEC3F *cg)
 
void blOriginPDB (PDB *pdb)
 
void blRotatePDB (PDB *pdb, REAL rm[3][3])
 
void blTranslatePDB (PDB *pdb, VEC3F tvect)
 
BOOL blFitPDB (PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
 
BOOL blFitCaPDB (PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
 
BOOL blFitNCaCPDB (PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
 
BOOL blFitCaCbPDB (PDB *ref_pdb, PDB *fit_pdb, REAL rm[3][3])
 
REAL blCalcRMSPDB (PDB *pdb1, PDB *pdb2)
 
int blGetPDBCoor (PDB *pdb, COOR **coor)
 
BOOL blFindZonePDB (PDB *pdb, int start, char *startinsert, int stop, char *stopinsert, char *chain, int mode, PDB **pdb_start, PDB **pdb_stop)
 
int blHAddPDB (FILE *fp, PDB *pdb)
 
int blReadPGP (FILE *fp)
 
FILE * blOpenPGPFile (char *pgpfile, BOOL AllHyd)
 
PDBblSelectAtomsPDBAsCopy (PDB *pdbin, int nsel, char **sel, int *natom)
 
PDBblStripHPDBAsCopy (PDB *pdbin, int *natom)
 
SECSTRUCblReadSecPDB (FILE *fp, int *nsec)
 
SECSTRUCblReadSecWholePDB (WHOLEPDB *wpdb, int *nsec)
 
void blRenumAtomsPDB (PDB *pdb, int offset)
 
PDBblFindEndPDB (PDB *start)
 
PDBblFixOrderPDB (PDB *pdb, BOOL Pad, BOOL Renum)
 
PDBblShuffleResPDB (PDB *start, PDB *end, BOOL Pad)
 
BOOL blGetAtomTypes (char *resnam, char **AtomTypes)
 
PDBblKillPDB (PDB *pdb, PDB *prev)
 
void blCopyPDB (PDB *out, PDB *in)
 
BOOL blMovePDB (PDB *move, PDB **from, PDB **to)
 
PDBblAppendPDB (PDB *first, PDB *second)
 
PDBblShuffleBB (PDB *pdb)
 
REAL blCalcChi (PDB *pdb, int type)
 
PDBblGetPDBByN (PDB *pdb, int n)
 
void blSetChi (PDB *pdb, PDB *next, REAL chi, int type)
 
BOOL blKillSidechain (PDB *ResStart, PDB *NextRes, BOOL doCB)
 
PDBblDeleteResiduePDB (PDB **pPDB, PDB *res)
 
void blSetResnam (PDB *ResStart, PDB *NextRes, char *resnam, int resnum, char *insert, char *chain)
 
void blApplyMatrixPDB (PDB *pdb, REAL matrix[3][3])
 
BOOL blGetResolPDB (FILE *fp, REAL *resolution, REAL *RFactor, int *StrucType)
 
BOOL blGetResolWholePDB (WHOLEPDB *wpdb, REAL *resolution, REAL *RFactor, int *StrucType)
 
BOOL blGetExptlPDB (FILE *fp, REAL *resolution, REAL *RFactor, REAL *FreeR, int *StrucType)
 
BOOL blGetExptlWholePDB (WHOLEPDB *wpdb, REAL *resolution, REAL *RFactor, REAL *FreeR, int *StrucType)
 
BOOL blGetExptlOld (FILE *fp, REAL *resolution, REAL *RFactor, REAL *FreeR, int *StrucType)
 
char * blReportStructureType (int type)
 
PDB ** blIndexPDB (PDB *pdb, int *natom)
 
PDB ** blIndexAtomNumbersPDB (PDB *pdb, int *indexSize)
 
DISULPHIDEblReadDisulphidesPDB (FILE *fp, BOOL *error)
 
DISULPHIDEblReadDisulphidesWholePDB (WHOLEPDB *wpdb, BOOL *error)
 
BOOL blParseResSpec (char *spec, char *chain, int *resnum, char *insert)
 
void blPrintResSpecHelp (FILE *fp)
 
void blBuildResSpec (PDB *p, char *resspec)
 
BOOL blDoParseResSpec (char *spec, char *chain, int *resnum, char *insert, BOOL uppercaseresspec)
 
BOOL blRepSChain (PDB *pdb, char *sequence, char *ChiTable, char *RefCoords)
 
PDBblFindNextChainPDB (PDB *pdb)
 
BOOL blFixCterPDB (PDB *pdb, int style)
 
BOOL blCalcCterCoords (PDB *p, PDB *ca_p, PDB *c_p, PDB *o_p)
 
int blCalcTetraHCoords (PDB *nter, COOR *coor)
 
int blAddNTerHs (PDB **ppdb, BOOL Charmm)
 
char * blFNam2PDB (char *filename)
 
PDBblTermPDB (PDB *pdb, int length)
 
char ** blGetPDBChainLabels (PDB *pdb, int *nchains)
 
PDBblGetPDBChainAsCopy (PDB *pdbin, char *chain)
 
PDBblFindHetatmResidueSpec (PDB *pdb, char *resspec)
 
PDBblFindResidueSpec (PDB *pdb, char *resspec)
 
PDBblFindNextResidue (PDB *pdb)
 
PDBblDupePDB (PDB *in)
 
BOOL blCopyPDBCoords (PDB *out, PDB *in)
 
void blCalcCellTrans (VEC3F UnitCell, VEC3F CellAngles, VEC3F *xtrans, VEC3F *ytrans, VEC3F *ztrans)
 
int blGetCrystPDB (FILE *fp, VEC3F *UnitCell, VEC3F *CellAngles, char *spacegroup, REAL OrigMatrix[3][4], REAL ScaleMatrix[3][4])
 
int blGetCrystWholePDB (WHOLEPDB *wpdb, VEC3F *UnitCell, VEC3F *CellAngles, char *spacegroup, REAL OrigMatrix[3][4], REAL ScaleMatrix[3][4])
 
void blWriteCrystPDB (FILE *fp, VEC3F UnitCell, VEC3F CellAngles, char *spacegroup, REAL OrigMatrix[3][4], REAL ScaleMatrix[3][4])
 
PDBblExtractZonePDBAsCopy (PDB *inpdb, char *chain1, int resnum1, char *insert1, char *chain2, int resnum2, char *insert2)
 
PDBblExtractZoneSpecPDBAsCopy (PDB *pdb, char *firstRes, char *lastRes)
 
PDBblExtractNotZonePDBAsCopy (PDB *inpdb, char *chain1, int resnum1, char *insert1, char *chain2, int resnum2, char *insert2)
 
PDBblExtractNotZoneSpecPDBAsCopy (PDB *pdb, char *firstRes, char *lastRes)
 
PDBblFindResidue (PDB *pdb, char *chain, int resnum, char *insert)
 
PDBblFindHetatmResidue (PDB *pdb, char *chain, int resnum, char *insert)
 
PDBblFindAtomInRes (PDB *pdb, char *atnam)
 
BOOL blInPDBZone (PDB *p, char *chain, int resnum1, char *insert1, int resnum2, char *insert2)
 
BOOL blInPDBZoneSpec (PDB *p, char *resspec1, char *resspec2)
 
BOOL blAtomNameMatch (char *atnam, char *spec, BOOL *ErrorWarn)
 
BOOL blAtomNameRawMatch (char *atnam, char *spec, BOOL *ErrorWarn)
 
BOOL blLegalAtomSpec (char *spec)
 
BOOL blRepOneSChain (PDB *pdb, char *ResSpec, char aa, char *ChiTable, char *RefCoords)
 
BOOL blRepOneSChainForce (PDB *pdb, char *ResSpec, char aa, char *ChiTable, char *RefCoords)
 
void blEndRepSChain (void)
 
char ** blReadSeqresPDB (FILE *fp, int *nchains)
 
char ** blReadSeqresWholePDB (WHOLEPDB *wpdb, int *nchains)
 
PDBblSelectCaPDB (PDB *pdb)
 
char * blFixAtomName (char *name, REAL occup)
 
void blFreeWholePDB (WHOLEPDB *wpdb)
 
WHOLEPDBblReadWholePDB (FILE *fpin)
 
WHOLEPDBblReadWholePDBAtoms (FILE *fpin)
 
BOOL blAddCBtoGly (PDB *pdb)
 
BOOL blAddCBtoAllGly (PDB *pdb)
 
PDBblStripGlyCB (PDB *pdb)
 
PDBblRemoveAlternates (PDB *pdb)
 
PDBblBuildAtomNeighbourPDBListAsCopy (PDB *pdb, PDB *pRes, REAL NeighbDist)
 
PDBblFindAtomWildcardInRes (PDB *pdb, char *pattern)
 
PDBblDupeResiduePDB (PDB *in)
 
PDBblStripWatersPDBAsCopy (PDB *pdbin, int *natom)
 
PDBSTRUCTblAllocPDBStructure (PDB *pdb)
 
PDBblFindNextChain (PDB *pdb)
 
void blFreePDBStructure (PDBSTRUCT *pdbstruct)
 
void blSetElementSymbolFromAtomName (char *element, char *atom_name)
 
BOOL blGetHeaderWholePDB (WHOLEPDB *wpdb, char *header, int maxheader, char *date, int maxdate, char *pdbcode, int maxcode)
 
char * blGetTitleWholePDB (WHOLEPDB *wpdb)
 
BOOL blGetCompoundWholePDBChain (WHOLEPDB *wpdb, char *chain, COMPND *compnd)
 
int blFindMolID (WHOLEPDB *wpdb, char *chain)
 
BOOL blGetSpeciesWholePDBChain (WHOLEPDB *wpdb, char *chain, PDBSOURCE *source)
 
BOOL blGetCompoundWholePDBMolID (WHOLEPDB *wpdb, int molid, COMPND *compnd)
 
BOOL blGetSpeciesWholePDBMolID (WHOLEPDB *wpdb, int molid, PDBSOURCE *source)
 
char * blGetSeqresAsStringWholePDB (WHOLEPDB *wpdb, char **chains, MODRES *modres, BOOL doNucleic)
 
HASHTABLEblGetSeqresByChainWholePDB (WHOLEPDB *wpdb, MODRES *modres, BOOL doNucleic)
 
MODRESblGetModresWholePDB (WHOLEPDB *wpdb)
 
void blFindOriginalResType (char *orig, char *new, MODRES *modres)
 
BIOMOLECULEblGetBiomoleculeWholePDB (WHOLEPDB *wpdb)
 
void blFreeBiomolecule (BIOMOLECULE *biomolecule)
 
STRINGLISTblSetPDBAtomTypes (PDB *pdb)
 

Variables

char gRSCError [80]
 
BOOL gPDBPartialOcc
 
int gPDBMultiNMR
 
BOOL gPDBXML
 
BOOL gPDBModelNotFound
 
int gPDBXMLForce
 

Detailed Description

Include file for PDB routines.

Version
V1.96
Date
30.09.17
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:

Usage:

Revision History:

Definition in file pdb.h.

Macro Definition Documentation

#define _PDB_H_DEPRECATED

Definition at line 839 of file pdb.h.

#define ATOMTYPE_ATOM   1

Definition at line 596 of file pdb.h.

#define ATOMTYPE_BOUNDHET   (10 | ATOMTYPE_NONRESIDUE)

Definition at line 605 of file pdb.h.

#define ATOMTYPE_BOUNDPOLYHET   (11 | ATOMTYPE_NONRESIDUE)

Definition at line 606 of file pdb.h.

#define ATOMTYPE_HETATM   (7 | ATOMTYPE_NONRESIDUE)

Definition at line 602 of file pdb.h.

#define ATOMTYPE_METAL   (8 | ATOMTYPE_NONRESIDUE)

Definition at line 603 of file pdb.h.

#define ATOMTYPE_MODNUC   4

Definition at line 599 of file pdb.h.

#define ATOMTYPE_MODPROT   3

Definition at line 598 of file pdb.h.

#define ATOMTYPE_NONRESIDUE   128

Definition at line 594 of file pdb.h.

#define ATOMTYPE_NONSTDAA   5

Definition at line 600 of file pdb.h.

#define ATOMTYPE_NONSTDNUC   6

Definition at line 601 of file pdb.h.

#define ATOMTYPE_NUC   2

Definition at line 597 of file pdb.h.

#define ATOMTYPE_UNDEF   0

Definition at line 595 of file pdb.h.

#define ATOMTYPE_WATER   (9 | ATOMTYPE_NONRESIDUE)

Definition at line 604 of file pdb.h.

#define blMAXCHAINLABEL   8

Definition at line 248 of file pdb.h.

#define CHAINMATCH (   chain1,
  chain2 
)    !strcmp(chain1, chain2)

Definition at line 495 of file pdb.h.

#define CLEAR_PDB (   p)
Value:
strcpy(p->record_type," "); \
p->atnum=0; \
strcpy(p->atnam," "); \
strcpy(p->atnam_raw," "); \
strcpy(p->resnam," "); \
p->resnum=0; \
strcpy(p->insert," "); \
strcpy(p->chain," "); \
p->x = 0.0; p->y = 0.0; p->z = 0.0; \
p->altpos = ' '; \
p->occ = 0.0; p->bval = 0.0; \
p->next = NULL; \
p->extras = NULL; \
p->access = 0.0; \
p->radius = 0.0; \
p->formal_charge = 0; \
p->partial_charge = 0.0; \
strcpy(p->element," "); \
strcpy(p->segid," "); \
p->conect[0] = NULL; \
p->nConect = 0; \
p->atomInfo = NULL; \
p->atomtype = 0; \
p->secstr = ' '; \
p->entity_id = 0;
#define NULL
Definition: array2.c:99

Definition at line 460 of file pdb.h.

#define CREATEPDBEXTRAS (   x,
 
)
Value:
{ PDB *_cpe_p; \
for(_cpe_p=(x); _cpe_p!=NULL; _cpe_p=_cpe_p->next){ \
_cpe_p->extras = (APTR)malloc(sizeof(y)); \
} \
}
APTR extras
Definition: pdb.h:305
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
void * APTR
Definition: SysDefs.h:59
struct pdb_entry * next
Definition: pdb.h:307

Definition at line 502 of file pdb.h.

#define CTER_STYLE_CHARMM   2

Definition at line 573 of file pdb.h.

#define CTER_STYLE_GROMOS   1

Definition at line 572 of file pdb.h.

#define CTER_STYLE_STD   0

Definition at line 571 of file pdb.h.

#define DEFCONECTTOL   0.1 /* Default CONECT tolerence */

Definition at line 244 of file pdb.h.

#define FORCEPDB   gPDBXMLForce = FORCEXML_PDB

Definition at line 590 of file pdb.h.

#define FORCEXML   gPDBXMLForce = FORCEXML_XML

Definition at line 591 of file pdb.h.

#define FORCEXML_NOFORCE   0

Definition at line 585 of file pdb.h.

#define FORCEXML_PDB   1

Definition at line 586 of file pdb.h.

#define FORCEXML_XML   2

Definition at line 587 of file pdb.h.

#define FREEPDBEXTRAS (   x)
Value:
{ PDB *_fpe_p; \
for(_fpe_p=(x); _fpe_p!=NULL; _fpe_p=_fpe_p->next){ \
if(_fpe_p->extras != NULL){ \
free(_fpe_p->extras); \
_fpe_p->extras = NULL; \
} \
} \
}
APTR extras
Definition: pdb.h:305
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
struct pdb_entry * next
Definition: pdb.h:307

Definition at line 510 of file pdb.h.

#define INSERTMATCH (   ins1,
  ins2 
)    !strcmp(ins1, ins2)

Definition at line 496 of file pdb.h.

#define ISWATER (   z)
Value:
(!strncmp((z)->resnam,"HOH",3) || \
!strncmp((z)->resnam,"OH2",3) || \
!strncmp((z)->resnam,"OHH",3) || \
!strncmp((z)->resnam,"DOD",3) || \
!strncmp((z)->resnam,"OD2",3) || \
!strncmp((z)->resnam,"ODD",3) || \
!strncmp((z)->resnam,"WAT",3))

Definition at line 487 of file pdb.h.

#define MAKERESID (   x,
 
)
Value:
do { \
char _makeresid_dot[2]; \
int _makeresid_len = strlen((p)->chain); \
_makeresid_dot[0] = '\0'; \
if(_makeresid_len > 0) { \
if(isdigit((p)->chain[_makeresid_len - 1])) { \
strcpy(_makeresid_dot, "."); \
} \
} \
if((p)->insert[0]!=' ') \
sprintf((x), "%s%s%d%s", (p)->chain, _makeresid_dot, \
(p)->resnum, (p)->insert); \
else \
sprintf((x), "%s%s%d", (p)->chain, _makeresid_dot, \
(p)->resnum); \
} while(0)

Definition at line 532 of file pdb.h.

#define MAXATINAA   14 /* Max number of (heavy) atoms in a standard aa */

Definition at line 239 of file pdb.h.

#define MAXATINRES
Value:
23 /* Max number of (heavy) atoms in a standard aa
or nucleotide
*/

Definition at line 240 of file pdb.h.

#define MAXCONECT   8 /* Max number of CONECT connections */

Definition at line 243 of file pdb.h.

#define MAXPDBANNOTATION
Value:
640 /* Max size for storing a PDB header
annotation
*/

Definition at line 245 of file pdb.h.

#define MAXSTDAA   21 /* Number of standard amino acids (w/ PCA) */

Definition at line 238 of file pdb.h.

#define PDBCHAINMATCH (   p,
 
)    !strcmp((p)->chain, (q)->chain)

Definition at line 498 of file pdb.h.

#define PDBEXTRASPTR (   p,
  type 
)    ((type *)((p)->extras))

Definition at line 529 of file pdb.h.

#define PDBINSERTMATCH (   p,
 
)    !strcmp((p)->insert, (q)->insert)

Definition at line 499 of file pdb.h.

#define RESIDMATCH (   p,
 
)
Value:
(((p)->resnum == (q)->resnum) && \
(!strcmp((p)->chain, (q)->chain)) && \
(!strcmp((p)->insert, (q)->insert)))

Definition at line 551 of file pdb.h.

#define SEC   (The_type_SEC_is_now_called_SECSTRUC_You_must_change_your_code *)

Definition at line 436 of file pdb.h.

#define SELECT (   x,
 
)
Value:
(x) = (char *)malloc(5 * sizeof(char)); \
if((x) != NULL) strncpy((x),(w),5)
#define NULL
Definition: array2.c:99

Definition at line 357 of file pdb.h.

#define STRUCTURE_TYPE_ELECTDIFF   4

Definition at line 560 of file pdb.h.

#define STRUCTURE_TYPE_EM   8

Definition at line 564 of file pdb.h.

#define STRUCTURE_TYPE_FIBER   5

Definition at line 561 of file pdb.h.

#define STRUCTURE_TYPE_FRET   12

Definition at line 568 of file pdb.h.

#define STRUCTURE_TYPE_IR   10

Definition at line 566 of file pdb.h.

#define STRUCTURE_TYPE_MODEL   3

Definition at line 559 of file pdb.h.

#define STRUCTURE_TYPE_NEUTRON   7

Definition at line 563 of file pdb.h.

#define STRUCTURE_TYPE_NMR   2

Definition at line 558 of file pdb.h.

#define STRUCTURE_TYPE_POWDER   11

Definition at line 567 of file pdb.h.

#define STRUCTURE_TYPE_SOLSCAT   9

Definition at line 565 of file pdb.h.

#define STRUCTURE_TYPE_SSNMR   6

Definition at line 562 of file pdb.h.

#define STRUCTURE_TYPE_UNKNOWN   0

Definition at line 556 of file pdb.h.

#define STRUCTURE_TYPE_XTAL   1

Definition at line 557 of file pdb.h.

#define XTAL_DATA_CRYST   0x0001

Definition at line 576 of file pdb.h.

#define XTAL_DATA_ORIGX   0x0002

Definition at line 577 of file pdb.h.

#define XTAL_DATA_SCALE   0x0004

Definition at line 578 of file pdb.h.

#define ZONE_MODE_RESNUM   0

Definition at line 581 of file pdb.h.

#define ZONE_MODE_SEQUENTIAL   1

Definition at line 582 of file pdb.h.

Typedef Documentation

typedef struct _biomolecule BIOMOLECULE
typedef struct _biomt BIOMT
typedef struct _blAtomInfo blATOMINFO
typedef struct _compnd COMPND
typedef struct _disulphide DISULPHIDE
typedef struct _modres MODRES
typedef struct pdb_entry PDB
typedef struct pdbchain PDBCHAIN
typedef struct pdbresidue PDBRESIDUE
typedef struct _pdbsource PDBSOURCE
typedef struct sec_entry SECSTRUC
typedef struct _wholepdb WHOLEPDB

Function Documentation

BOOL blAddCBtoAllGly ( PDB pdb)
Parameters
[in,out]*pdbThe PDB linked list
Returns
Success?

Adds a CB atom to all glycines in a PDB linked list. This is used when one needs to orientate a residue in a common frame of reference which makes use of the CB.

  • 04.01.06 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 239 of file GlyCB.c.

BOOL blAddCBtoGly ( PDB pdb)
Parameters
[in,out]*pdbThe PDB linked list for a Glycine
Returns
Success?

Adds a CB atom to a glycine. This is used when one needs to orientate a residue in a common frame of reference which makes use of the CB.

  • 04.01.06 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 112 of file GlyCB.c.

BOOL blAddConect ( PDB p,
PDB q 
)
Parameters
[in,out]*pFirst PDB item
[in,out]*qSecond PDB item
Returns
Success?

Adds a conect bteween p and q (i.e. in both directions) Fails if there are too many CONECTs

  • 19.02.15 Original By: ACRM

Definition at line 173 of file BuildConect.c.

int blAddNTerHs ( PDB **  ppdb,
BOOL  Charmm 
)
Parameters
[in,out]**ppdbPointer to pointer to PDB linked list
[in]CharmmDo Charmm style Nter
Returns
Number of hydrogens added

Adds hydrogens onto the N-termini

  • 23.08.94 Original By: ACRM
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.06.15 Added CLEAR_PDB() calls By: ACRM

Definition at line 123 of file AddNTerHs.c.

BOOL blAddOneDirectionConect ( PDB p,
PDB q 
)
Parameters
[in,out]*pFirst PDB item
[in,out]*qSecond PDB item
Returns
Success?

Adds a conect from p to q (i.e. one direction only) Fails if there are too many CONECTs

  • 19.02.15 Original By: ACRM

Definition at line 200 of file BuildConect.c.

PDBSTRUCT* blAllocPDBStructure ( PDB pdb)
Parameters
[in]*pdbPDB linked list
Returns
PDBSTRUCT structure containing chain linked list

Takes a PDB linked list and converts it into a hierarchical structure of chains, residues and atoms

  • 24.11.09 Original By: ACRM
  • 19.05.10 Correctly do doubly linked lists
  • 02.06.10 Fixed some initializations!
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 109 of file StructurePDB.c.

PDB* blAppendPDB ( PDB first,
PDB second 
)
Parameters
[in]*firstFirst linked list (may be NULL)
[in]*secondSecond linked list
Returns
Start of list

Appends list second onto first. Returns start of new list (useful if first was NULL).

  • 13.05.92 Original
  • 09.07.93 Changed to use LAST()
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 109 of file AppendPDB.c.

void blApplyMatrixPDB ( PDB pdb,
REAL  matrix[3][3] 
)
Parameters
[in,out]*pdbPDB linked list
[in]matrixMatrix to apply

Apply a rotation matrix to a PDB linked list.

  • 22.07.93 Original (old RotatePDB()) By: ACRM
  • 07.07.14 Renamed to blApplyMatrixPDB() By: CTP

Definition at line 92 of file ApMatPDB.c.

BOOL blAreResiduePointersBonded ( PDB res1,
PDB res2,
REAL  tol 
)
Parameters
[in]*res1Start of first residue
[in]*res2Start of second residue
[in]tolTolerance for distances
Returns
Are they bonded

Tests whether two residue are bonded using pointers to start of residues

  • 23.06.15 Original By: ACRM

Definition at line 394 of file BuildConect.c.

BOOL blAreResiduesBonded ( PDB pdb,
char *  chain1,
int  resnum1,
char *  insert1,
char *  chain2,
int  resnum2,
char *  insert2,
REAL  tol 
)
Parameters
[in]*pdbPDB linked list
[in]*chain1First chain label
[in]resnum1First residue number
[in]*insert1First insert code
[in]*chain2Second chain label
[in]resnum2Second residue number
[in]*insert2Second insert code
[in]tolTolerance for distances
Returns
Are they bonded

Tests whether two residue are bonded

  • 23.06.15 Original By: ACRM

Definition at line 360 of file BuildConect.c.

BOOL blAtomNameMatch ( char *  atnam,
char *  spec,
BOOL ErrorWarn 
)
Parameters
[in]*atnamThe atom name to test
[in]*specThe atom specification
[in,out]*ErrorWarnOn input, if TRUE, this routine will indicate errors. On output, indicates whether there was an error. Note that you must be careful to supply an lvalue here, you can't just use TRUE or FALSE since it's modified on return. NULL is allowed if you don't care about errors.

Tests whether an atom name matches an atom name specification. ? or % is used to match a single character is used to match any trailing characters; it may not be used for leading characters or in the middle of a specification (e.g. B, C*2 are both illegal). Wildcards may be escaped with a backslash.

For example: C* matches all carbon atoms, O5* matches an atom called O5* ?B* matches all beta atoms

  • 23.07.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 139 of file AtomNameMatch.c.

BOOL blAtomNameRawMatch ( char *  atnam,
char *  spec,
BOOL ErrorWarn 
)
Parameters
[in]*atnamThe atom name to check
[in]*specThe atom specification
[in,out]*ErrorWarnOn input, if TRUE, this routine will indicate errors. On output, indicates whether there was an error. Note that you must be careful to supply an lvalue here, you can't just use TRUE or FALSE since it's modified on return. NULL is allowed if you don't care about errors.

Tests whether an atom name matches an atom name specification.

This version should be given the raw atom name rather than the massaged one. i.e. " CA " is C-alpha, "CA " is Calcium

Normally it checks against the second character onwards unless the spec starts with a < in which case it checks from the beginning of the string

Written as a wrapper to AtomNameMatch()

  • 15.02.01 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 250 of file AtomNameMatch.c.

PDB* blBuildAtomNeighbourPDBListAsCopy ( PDB pdb,
PDB pRes,
REAL  NeighbDist 
)
Parameters
[in]*pdbPDB linked list of whole structure
[in]*pResPointer to start of residue of interest (may be in a separate linked list providing it's in the same coordinate frame)
[in]NeighbDistCutoff neighbour distance
Returns
PDB linked list of atoms within cutoff distance of the residue of interest. (NULL if allocations failed)

Builds a PDB linked list of atoms neighbouring those in a specified residue. The input list is unmodified.

  • 27.08.96 Original By: ACRM
  • 17.11.05 Fixed freed memory access
  • 08.11.07 Moved out of mutmodel. Added check on memory allocation. Uses occ rather than BVal as a flag MOVED FROM MUTMODEL
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Renamed function to blBuildAtomNeighbourPDBListAsCopy() By: CTP

Definition at line 113 of file BuildAtomNeighbourPDBList.c.

BOOL blBuildConectData ( PDB pdb,
REAL  tol 
)
Parameters
[in,out]*pdbPDB linked list
[in]tolTolerence for distance between atoms
Returns
Were all CONECTs added OK

Deletes all current connectivity data and rebuilds it using covalent radii data. A return of FALSE indicates that there were too many connections for an atom. If this happens, MAXCONECT needs to be increased in pdb.h

  • 19.02.15 Original By: ACRM
  • 26.02.15 Added tol paramater
  • 12.05.15 Conects are built involving backbone C and N if either atom is a HETATM

Definition at line 251 of file BuildConect.c.

void blBuildResSpec ( PDB p,
char *  resspec 
)
Parameters
[in]*pPDB record pointer

Builds a residue specification string for a PDB record

  • 11.08.16 Original By: ACRM

Definition at line 352 of file ParseRes.c.

void blCalcCellTrans ( VEC3F  UnitCell,
VEC3F  CellAngles,
VEC3F xtrans,
VEC3F ytrans,
VEC3F ztrans 
)
Parameters
[in]UnitCellThe unit cell dimensions
[in]CellAnglesThe unit cell angles
[out]*xtransTranslation to apply along X axis
[out]*ytransTranslation to apply along Y axis
[out]*ztransTranslation to apply along Z axis

Calculates the offsets to apply in X, Y and Z directions for creating a crystal lattice from the unit cell parameters.

  • 11.10.95 Original By: ACRM, Based losely on code from Rasmol
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 102 of file CalcCellTrans.c.

REAL blCalcChi ( PDB pdb,
int  type 
)
Parameters
[in]*pdbPDB linked list
[in]typeTorsion type (see below)
Returns
Torsion angle

Calculates a sidechain torsion angle from a pdb linked list. The atoms to be included in the calculation are specified by type.

     type     Atom names        Sequential atom numbers
     --------------------------------------------------
     0        N,  CA, CB, XG    (0 - 1 - 4 - 5)
     1        CA, CB, XG, XD    (1 - 4 - 5 - 6)
     2        CB, XG, XD, XE    (4 - 5 - 6 - 7)
     3        XG, XD, XE, XZ    (5 - 6 - 7 - 8)
  • 13.05.92 Original
  • 27.02.98 Removed unreachable break from switch()
  • 07.07.14 Use bl prefix for functions By: CTP
  • 14.12.16 Added check that all atoms are found Returns 9999.0 if any atom not found By: ACRM

Definition at line 111 of file CalcChiPDB.c.

BOOL blCalcCterCoords ( PDB p,
PDB ca_p,
PDB c_p,
PDB o_p 
)
Parameters
[in,out]*pOT2 PDB record whose coords are to be fixed
[in]*ca_pAntecedent CA PDB pointer
[in]*c_pAntecedent C PDB pointer
[in]*o_pAntecedent O PDB pointer
Returns
Success

Calculates the CTER OT2 coords

  • 15.07.90 Original
  • 07.07.14 Use bl prefix for functions By: CTP
  • 26.08.14 Removed unused d23 By: ACRM

Definition at line 111 of file CalcCterCoords.c.

REAL blCalcRMSPDB ( PDB pdb1,
PDB pdb2 
)
Parameters
[in]*pdb1First PDB linked list
[in]*pdb2Second PDB linked list
Returns
RMS deviation

Calculate the RMS deviation between two fitted PDB linked lists. No fitting is done. The two lists must contain equivalent structures (same atom types in same order). No checks are made on this.

  • 11.03.94 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 110 of file CalcRMSPDB.c.

int blCalcTetraHCoords ( PDB nter,
COOR coor 
)
Parameters
[in]*nterPointer to the N-terminus
[out]*coorArray of hydrogen coordinates
Returns
Number of hydrogens calculated (3) 0 if antecedant atoms missing

Calculates coordinates for the extra hydrogens.

  • 23.08.94 Original By: ACRM
  • 20.03.14 Updated error message. By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 26.08.14 Removed unused r21 By: ACRM
  • 05.03.15 Replaced blFindEndPDB() with blFindNextResidue()
  • 20.03.15 No longer prints a message on not finding atoms

Definition at line 117 of file CalcTetraHCoords.c.

BOOL blCheckFileFormatPDBML ( FILE *  fp)
Parameters
[in]*fpA pointer to type FILE.
Returns
File is in PDBML format?

Simple test to detect PDBML-formatted pdb file.

Todo: Consider replacement with general function to detect file format for uncompressed file returning file type (eg pdb/pdbml/unknown).

  • 22.04.14 Original By: CTP
  • 07.07.14 Renamed to blCheckFileFormatPDBML() By: CTP
  • 29.08.14 Function re-written to take sample from the input stream then reset the stream with ungetc. By: CTP
  • 31.08.14 Bugfix: Check for 'PDBx:datablock' tag skipped if blank line before xml tag. By: CTP
  • 09.09.14 Use rewind() for DOS instead of pushing sample back on stream with ungetc(). By: CTP
  • 29.09.14 Use single character check for pdbml files for Windows or systems where ungetc() fails after pushback of singe char. By: CTP

Definition at line 2161 of file ReadPDB.c.

BOOL blCopyConects ( PDB out,
PDB in 
)
Parameters
[out]*outPDB linked list containing new CONECT records
[in]*inPDB linked list containing original CONECT records
Returns
Success

Updates the CONECT information in the out PDB linked list based on those in the in linked list. This is used when we have copied a PDB linked list (e.g. in the bl...AsCopy() routines) to make sure the CONECT data points to records in the new linked list instead of the old one.

  • 17.04.15 Original By: ACRM

Definition at line 574 of file BuildConect.c.

void blCopyPDB ( PDB out,
PDB in 
)
Parameters
[in]*inInput PDB record pointer
[out]*outOutput PDB record pointer

Copy a PDB record, except that the ->next is set to NULL;

  • 12.05.92 Original By: ACRM
  • 17.07.01 Now uses the generic *out=*in
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 108 of file CopyPDB.c.

BOOL blCopyPDBCoords ( PDB out,
PDB in 
)
Parameters
[in]*inInput PDB linked list
[out]*outOutput PDB linked list
Returns
Success?

Applies the coordinates of `in' to `out'. Assumes that the structures are equivalent with identical atom ordering. Makes a simple check on resnam and atnam at each position.

  • 11.10.95 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 112 of file CopyPDBCoords.c.

BOOL blDeleteAConectByNum ( PDB pdb,
int  cNum 
)
Parameters
[in]*pdbPDB pointer
[in]cNumIndex into the ->conect[] array for the CONECT to be deleted
Returns
Success

Deletes the link for the specified CONECT. Other CONECTs are shuffled down.

  • 16.03.15 Original By: ACRM

Definition at line 500 of file BuildConect.c.

void blDeleteAtomConects ( PDB pdb)
Parameters
[in]*pdbPDB pointer

Deletes all CONECT information associated with a PDB pointer. Also deletes the relevant CONECTs (back to this atom) from the partner atoms

  • 17.03.15 Original By: ACRM

Definition at line 536 of file BuildConect.c.

PDB* blDeleteAtomPDB ( PDB pdb,
PDB atom 
)
Parameters
[in]*pdbStart of PDB linked list
[in]*atomAtom to delete
Returns
New start of PDB linked list

Deletes an atom from the PDB linked list. Should be called as pdb=blDeleteAtomPDB(pdb, atom); to allow for the first atom in the linked list being deleted.

Returns NULL of all atoms have been deleted. Returns the input pdb linked list unmodified if the atom isn't found.

  • 17.03.15 Original By: ACRM

Definition at line 173 of file KillPDB.c.

PDB* blDeleteAtomRangePDB ( PDB pdb,
PDB start,
PDB stop 
)
Parameters
[in]*pdbStart of PDB linked list
[in]*startFirst atom to delete
[in]*stopAtom after the one to be deleted
Returns
New start of linked list

Deletes a range of atoms from the linked list re-linking the list and returning the new start of the list (in case the first atom has been deleted)

  • 17.03.15 Original By: ACRM

Definition at line 122 of file KillPDB.c.

BOOL blDeleteConect ( PDB p,
PDB q 
)
PDB* blDeleteResiduePDB ( PDB **  pPDB,
PDB res 
)
Parameters
[in,out]*pPDBPointer to pointer to start of PDB linked list
[in]*resPointer to residue to be removed
Returns
Next residue in PDB linked list

Remove a residue from the PDB linked list and re-link correctly. Returns the next item in the list, so will be NULL when the last residue has been deleted.

  • 30.09.17 Original

Definition at line 245 of file KillPDB.c.

BOOL blDoParseResSpec ( char *  inSpec,
char *  chain,
int *  resnum,
char *  insert,
BOOL  uppercaseresspec 
)
Parameters
[in]*inSpecResidue specification
[out]*chainChain label
[out]*resnumResidue number
[out]*insertInsert label
[in]uppercaseresspecConvert spec to upper case.
Returns
Success?

Note that chain and insert must be arrays of at least 2 characters, not character pointers

Splits up a residue specification of the form [c][.]num[i] into chain, resnum and insert. Chain and insert are optional and will be set to spaces if not specified. If uppercaseresspec equals TRUE, the spec is upper cased before processing

Multi-letter chain IDs can be parsed. Additionally, chain IDs with numerical characters can be parsed if a period is used to separate the chain from the residue number.

  • 21.07.93 Original By: ACRM
  • 17.07.95 Added BOOL return
  • 18.03.98 Added option to include a . to separate chain and residue number so numeric chain names can be used
  • 29.09.05 Moved this code to from ParseResSpec() to DoParseResSpec() and made that function just call this new function. This move is to allow this underlying function to have an extra parameter to specify whether or not the residue specification should be upper cased (without affecting code that calls the old function). By: TL
  • 12.10.12 insert is now a properly terminated string when there is no insert
  • 28.08.12 chain is now a properly terminated string The input specification is now copied so that actual strings can be passed into the routine as opposed to string delimited variables. This also removes the need for restoring the string which has now been removed
  • 26.02.14 Parsing handles multi-letter chains and numerical chain IDs. The "Extract chain from spec" section was re-written. If the period separator between the chain id and the residue number is absent then the chain id is set from any non-numeric lead characters. By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 214 of file ParseRes.c.

WHOLEPDB* blDoReadPDB ( FILE *  fpin,
BOOL  AllAtoms,
int  OccRank,
int  ModelNum,
BOOL  DoWhole 
)
Parameters
[in]*fpinA pointer to type FILE in which the .PDB file is stored.
[in]AllAtomsTRUE: ATOM & HETATM records FALSE: ATOM records only
[in]OccRankOccupancy ranking
[in]ModelNumNMR Model number (0 = all)
[in]DoWholeRead the whole PDB file rather than just the ATOM/HETATM records.
Returns
A pointer to a malloc'd WHOLEPDB structure

Reads a PDB file into a PDB linked list. The OccRank value indicates occupancy ranking to read for partial occupancy atoms. If any partial occupancy atoms are read the global flag gPDBPartialOcc is set to TRUE.

  • 04.11.88 V1.0 Original
  • 07.02.89 V1.1 Ignore records which aren't ATOM or HETATM
  • 28.03.90 V1.2 Altered field widths to match PDB standard better See notes above for deviations
  • 28.06.90 V1.2a Buffer size increased to 85 chars.
  • 15.02.91 V1.2b Changed comment header to match new standard.
  • 07.01.92 V1.3 Ignores blank lines properly
  • 11.05.92 V1.4 Check on EOF in while() loop, memset() buffer. ANSIed.
  • 01.06.92 V1.5 Documented for autodoc
  • 19.06.92 V1.6 Corrected use of stdlib
  • 01.10.92 V1.7 Changed to use fgets()
  • 10.06.93 V1.9 Returns 0 on failure rather than exiting Replaced SIZE with sizeof(PDB) directly
  • 17.06.93 V2.0 Rewritten to use fsscanf()
  • 08.07.93 V2.1 Split from ReadPDB()
  • 09.07.93 V2.2 Modified to return pointer to PDB. Rewrote allocation scheme.
  • 17.03.94 V2.3 Handles partial occupancies Sets natom to -1 if there was an error to distinguish from no atoms. Handles atom names which start in column 13 rather than column 14. This is allowed in the standard, but very rare. Sets flag for partials.
  • 06.04.94 V2.4 Atom names starting in column 13 have their first character moved to the end if it is a digit.
  • 03.10.94 V2.5 Check residue number as well as atom name when running through alternative atoms for partial occupancy Moved increment of NPartial, so only done if there is space in the array. If OccRank is 0, all atoms are read regardless of occupancy.
  • 06.03.95 V2.7 Added value for NMR model to read (0 = all) No longer static. Sets gPDBMultiNMR if ENDMDL records found.
  • 13.01.97 V2.8 Added check on return from fsscanf. Blank lines used to result in duplication of the previous line since fsscanf() does not reset the variables on receiving a blank line. Also fixed in fsscanf().
  • 25.02.98 V2.9 Added code to read gzipped PDB files transparently when GUNZIP_SUPPORT is defined
  • 17.08.98 V2.10 Added case to popen() for SunOS
  • 08.10.99 V2.11 Initialise CurIns and CurRes
  • 15.02.01 V2.12 Added atnam_raw
  • 27.04.05 V2.14 Added another atnam_raw for multiple occupancies
  • 03.06.05 V2.15 Added altpos
  • 14.10.05 V2.16 Modified detection of partial occupancy. handles residues like 1zeh/B16 where a lower partial is erroneously set to zero
  • 05.06.07 V2.19 Added support for Unix compress'd files
  • 21.12.11 V2.22 Modified for cases of single occupancy < 1.0
  • 22.04.14 V2.24 Call doReadPDBML() for PDBML-formatted PDB file. By: CTP
  • 02.06.14 V2.25 Updated doReadPDBML(). By: CTP
  • 09.06.14 V2.26 Set gPDBXML flag. By: CTP
  • 07.07.14 V2.27 Renamed to blDoReadPDB() By: CTP
  • 15.08.14 V2.29 Use CLEAR_PDB() to set default values. By: CTP
  • 16.08.14 V2.30 Replaced charge with formal_charge and partial_charge for PDB structure. By: CTP
  • 18.08.14 V2.31 Added XML_SUPPORT option allowing BiopLib to be compiled without support for PDBML format. By: CTP
  • 09.09.14 V2.35 Reading of gzipped files with gunzip not supported for MS Windows. By: CTP
  • 29.09.14 V2.36 Allow single character filetype check for gzipped files. By: CTP
  • 17.02.15 V2.37 Added segid support By: ACRM
  • 20.02.15 V3.0 NOT COMPATIBLE WITH PREVIOUS VERSIONS. The functionality of the old ReadWholePDB() is now integrated into this function.
  • 20.03.15 V3.3 Fixed behaviour with reading other than the first model and now sets a global error flag if the requested model was not found. Uses MODEL records rather than ENDMDL records in counting models
  • 02.04.15 V3.4 Rewind file after reading pdbxml header data. By: CTP
  • 28.04.15 V3.5 Removed rewind. Call to blDoReadPDBML() returns WHOLEPDB instead of PDB. By: CTP
  • 21.07.15 Changed atomType to atomInfo By: ACRM

    We need to deal with freeing wpdb if we are returning null. Also need to deal with some sort of error code

Definition at line 707 of file ReadPDB.c.

WHOLEPDB* blDoReadPDBML ( FILE *  fpin,
BOOL  AllAtoms,
int  OccRank,
int  ModelNum,
BOOL  DoWhole 
)
Parameters
[in]*fpinA pointer to type FILE in which the .PDB file is stored.
[in]AllAtomsTRUE: ATOM & HETATM records FALSE: ATOM records only
[in]OccRankOccupancy ranking
[in]ModelNumNMR Model number (0 = all)
[in]DoWholeRead the whole PDB file rather than just the ATOM/HETATM records.
Returns
A pointer to a malloc'd WHOLEPDB structure.

Reads a PDBML-formatted PDB file into a PDB linked list.

The OccRank value indicates occupancy ranking to read for partial occupancy atoms. If any partial occupancy atoms are read the global flag gPDBPartialOcc is set to TRUE.

The global multiple-models flag is set to true if more than one model is found.

Returns NULL if memory allocation fails or returns wpdb with wpdb->pdb set to NULL and wpdb->natoms set to -1.

  • 22.04.14 Original By: CTP
  • 02.06.14 Updated setting atnam_raw and parsing data from PDB atom site labels (label_seq_id, etc.) if author-defined labels are omitted. By: CTP
  • 09.06.14 Set gPDBXML flag. By: CTP
  • 07.07.14 Renamed to blDoReadPDBML() By: CTP
  • 04.08.14 Read element and formal charge. By: CTP
  • 15.08.14 Use CLEAR_PDB() to set default values. By: CTP
  • 16.08.14 Read formal and partial charges. Use blCopyPDB() to copy data for partial occupancy atoms. By: CTP
  • 18.08.14 Added XML_SUPPORT option. Return error if XML_SUPPORT not defined By: CTP
  • 26.08.14 Pad record_type to six characters. By: CTP
  • 17.02.15 Added segid support By: ACRM
  • 25.02.15 Added some checks on potential NULL pointers Changed all strcpy()s to strncpy()s Initialized numeric content variable before each sscanf() in case it fails Calls blRenumAtomsPDB() at the end since we don't use the atom site IDs for atom numbers
  • 13.03.15 Cosmetic changes
  • 28.04.15 Set identical input parameters to blDoReadPDB(). Added CONECT and header parsing. Return WHOLEPDB instead of PDB. By: CTP
  • 14.06.15 Read entity_id By: CTP
  • 25.06.15 Detect if residue number has been set from auth_seq_id using flag - fixes bug where auth_seq_id = 0. By: CTP
  • 01.07.15 Replaced ParseHeaderPDBML() with ParseHeaderRecordsPDBML() By: CTP

Definition at line 1624 of file ReadPDB.c.

PDB* blDupePDB ( PDB in)
Parameters
[in]*inInput PDB linked list
Returns
Duplicated PDB linked list (NULL on allocation failure)

Duplicates a PDB linked list. Allocates new linked list with identical data. CONECT data are updated to point within the new list.

  • 11.10.95 Original By: ACRM
  • 08.10.99 Initialise q to NULL
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.04.15 Added call to blCopyConect() By: ACRM

Definition at line 113 of file DupePDB.c.

PDB* blDupeResiduePDB ( PDB in)
Parameters
[in]*inPDB linked list pointing to residue to duplicate
Returns
Duplicate linked list of residue at `in' (NULL if allocation fails)

Makes a duplicate PDB linked list of just the residue pointed to by `in'. Note that CONECT data will not be preserved since it would not be valid.

  • 27.08.96 Original By: ACRM
  • 08.11.07 Initialize p and q Moved into bioplib
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 100 of file DupeResiduePDB.c.

void blEndRepSChain ( void  )

Cleans up open files and memory used by the sidechain replacement routines.

  • 12.08.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 479 of file rsc.c.

PDB* blExtractNotZonePDBAsCopy ( PDB inpdb,
char *  chain1,
int  resnum1,
char *  insert1,
char *  chain2,
int  resnum2,
char *  insert2 
)
Parameters
[in]*inpdbInput PDB linked list
[in]*chain1Start residue chain name
[in]resnum1Start residue number
[in]*insert1Start residue insert code
[in]*chain2End residue chain name
[in]resnum2End residue number
[in]*insert2End residue insert code
Returns
PDB linked list of the region of interest.

Reduces a PDB linked list to those residues outside a specified zone. Note that the PDB linked list is duplicated before extraction so pointers do not match those in the input PDB linked list. Excess records in the new PDB linked list are freed.

  • 07.10.15 Original By: ACRM
  • 08.10.15 Fixed return(FALSE) to return(NULL)

Definition at line 341 of file ExtractZonePDB.c.

PDB* blExtractNotZoneSpecPDBAsCopy ( PDB pdb,
char *  firstRes,
char *  lastRes 
)
Parameters
[in]pdbPDB linked list
[in]firstResResidue spec ([chain]resnum[insert])
[in]lastResResidue spec ([chain]resnum[insert])

Extracts atoms outside a zone from a PDB linked list, making a copy of the original list.

  • 07.10.15 Original By: ACRM

Definition at line 417 of file ExtractZonePDB.c.

PDB* blExtractZonePDBAsCopy ( PDB inpdb,
char *  chain1,
int  resnum1,
char *  insert1,
char *  chain2,
int  resnum2,
char *  insert2 
)
Parameters
[in]*inpdbInput PDB linked list
[in]*chain1Start residue chain name
[in]resnum1Start residue number
[in]*insert1Start residue insert code
[in]*chain2End residue chain name
[in]resnum2End residue number
[in]*insert2End residue insert code
Returns
PDB linked list of the region of interest.

Reduces a PDB linked list to those residues within a specified zone. Note that the PDB linked list is duplicated before extraction so pointers do not match those in the input PDB linked list. Excess records in the new PDB linked list are freed.

  • 10.01.96 Original By: ACRM
  • 22.03.06 Modified to allow non-exact zones. i.e. the extracted zone will be the widest subset of the specified zone. So, if you specifiy 30-35Z and the PDB file only has 30-35B then that will be extracted.
  • 29.10.10 Fixed extraction where end of zone matched last residue in a chain
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Renamed function to blExtractZonePDBAsCopy() By: CTP
  • 08.12.15 Now checks for an exact match first to deal with 6INS that uses the insert code for something different! By: ACRM
  • 17.02.16 Added fix on check for exact match - prev wasn't being set correctly if the match was to the first residue in the file

    TODO - This doesn't deal with CONECT information properly! ***

Definition at line 158 of file ExtractZonePDB.c.

PDB* blExtractZoneSpecPDBAsCopy ( PDB pdb,
char *  firstRes,
char *  lastRes 
)
Parameters
[in]pdbPDB linked list
[in]firstResResidue spec ([chain]resnum[insert])
[in]lastResResidue spec ([chain]resnum[insert])

Extracts a zone from a PDB linked list, making a copy of the original list.

  • 08.10.14 Original By: ACRM

Definition at line 300 of file ExtractZonePDB.c.

PDB* blFindAtomInRes ( PDB pdb,
char *  atnam_in 
)
Parameters
[in]*pdbThe beginning of a residue in a PDB linked list
[in]*atnam_inAn atom name to search for (doesn't need to be space-padded)
Returns
Pointer to required atom, NULL if not found

Finds an atom within a residue

  • 14.03.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 111 of file FindAtomInRes.c.

PDB* blFindAtomWildcardInRes ( PDB pdb,
char *  pattern 
)
Parameters
[in]*pdbPointer to start of a residue
[in]*patternAtom name pattern to find
Returns
Pointer to requested atom or NULL if not found.

Finds an atom within the residue given as a PDB pointer. Allows single character wildcards. Thus ?G? maybe used for any atom at the gamma position.

Returns the first atom which matches

  • 27.08.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 100 of file FindAtomWildcardInRes.c.

PDB* blFindEndPDB ( PDB start)
PDB* blFindHetatmResidue ( PDB pdb,
char *  chain,
int  resnum,
char *  insert 
)
Parameters
[in]pdbPDB linked list
[in]chainChain label
[in]resnumResidue number
[in]insertInsert code
Returns
Pointer to start of HET residue

Finds a pointer to the start of a residue in a PDB linked list, but requires the residue is a HETATM record Uses string for chain and insert.

  • 24.02.14 Original. By: CTP
  • 07.07.14 Renamed to FindHetatmResidue(). Use bl prefix for functions By: CTP

Definition at line 111 of file FindHetatmResidue.c.

PDB* blFindHetatmResidueSpec ( PDB pdb,
char *  resspec 
)
Parameters
[in]*pdbPDB linked list
[in]*resspecResidue specification
Returns
Pointer to first atom of specified residue (NULL if not found).

Search a PDB linked list for a specified residue (given as [chain]num[insert]) but limits search to HETATM residues

  • 26.10.11 Original By: ACRM
  • 28.08.13 Mofified for new ParseResSpec that terminates strings
  • 24.02.14 Now calls BiopFindResidue(). By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 105 of file FindHetatmResidueSpec.c.

int blFindMolID ( WHOLEPDB wpdb,
char *  chain 
)
Parameters
[in]*wpdbWHOLEPDB structure
[in]*chainChain label
Returns
MOL_ID or 0 if chain not found

Finds the MOL_ID for a specified chain

  • 28.04.15 Original By: ACRM
  • 04.06.15 Modified to use the ExtractField() routine instead of duplicating code here. Fixes a bug in dealing with compounds where the referenced chains span more than one line

Definition at line 481 of file PDBHeaderInfo.c.

PDB* blFindNextChain ( PDB pdb)
Parameters
[in]*pdbPDB linked list
Returns
Pointer to start of next chain

Takes a PDB linked list and find the start of the next chain. This is similar to another Bioplib routine (blFindNextChainPDB()) which terminates the first chain, but this routines doesn't terminate.

  • 24.11.09 Original By: ACRM
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 252 of file StructurePDB.c.

PDB* blFindNextChainPDB ( PDB pdb)
Parameters
[in,out]*pdbPDB linked list
Returns
Pointer to start of next chain in linked list

Terminates the linked list at the end of the current chain and returns a pointer to the start of the next chain. See blFindNextChain() for a routine which does not terminate the linked list.

  • 23.05.94 Original By: ACRM
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 112 of file FindNextChainPDB.c.

PDB* blFindNextResidue ( PDB pdb)
Parameters
[in]*pdbPDB linked list
Returns
Next residue in PDB linked list or NULL if there is none.

Finds the next residue in a PDB linked list.

  • 08.08.95 Original By: ACRM
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 21.08.15 Use INSERTMATCH By: ACRM

Definition at line 117 of file FindNextResidue.c.

void blFindOriginalResType ( char *  modAA,
char *  stdAA,
MODRES modres 
)
Parameters
[in]*modAANon-standard (modified) amino acid name
[out]*stdAAStandard amino acid from which it was derived
[in]*modresMODRES linked list

Uses the MODRES information to identify the original (standard) amino acid from which a modified amino acid was derived

  • 07.03.07 Original By: ACRM
  • 11.06.15 Moved to bioplib, renamed routine and parameters

Definition at line 940 of file PDBHeaderInfo.c.

PDB* blFindResidue ( PDB pdb,
char *  chain,
int  resnum,
char *  insert 
)
Parameters
[in]pdbPDB linked list
[in]chainChain label
[in]resnumResidue number
[in]insertInsert code
Returns
Pointer to start of specified residue

Finds a pointer to the start of a residue in a PDB linked list. Uses string for chain and insert.

  • 24.02.14 Original By: CTP
  • 07.07.14 Renamed to blFindResidue() Use bl prefix for functions By: CTP

Definition at line 117 of file FindResidue.c.

PDB* blFindResidueSpec ( PDB pdb,
char *  resspec 
)
Parameters
[in]*pdbPDB linked list
[in]*resspecResidue specification
Returns
Pointer to first atom of specified residue (NULL if not found).

Search a PDB linked list for a specified residue (given as [chain][.]num[insert])

  • 08.08.95 Original By: ACRM
  • 08.02.96 Now calls FindResidue() to do the actual work
  • 15.08.13 chain[] and insert[] are now arrays because of changes to ParseResSpec()
  • 24.02.14 Now calls BiopFindResidue() By: CTP
  • 07.07.14 Now calls blFindResidue() Use bl prefix for functions By: CTP

Definition at line 119 of file FindResidueSpec.c.

BOOL blFindZonePDB ( PDB pdb,
int  start,
char *  startinsert,
int  stop,
char *  stopinsert,
char *  chain,
int  mode,
PDB **  pdb_start,
PDB **  pdb_stop 
)
Parameters
[in]*pdbPDB linked list
[in]startResnum of start of zone
[in]*startinsertInsert code for start of zone
[in]stopResnum of end of zone
[in]*stopinsertInsert code for end of zone
[in]*chainChain name
[in]modeZONE_MODE_RESNUM: Use PDB residue numbers/chain ZONE_MODE_SEQUENTIAL: Use sequential numbering
[out]**pdb_startStart of zone
[out]**pdb_stopEnd of zone
Returns
OK?

Finds pointers to the start and end of a zone in a PDB linked list. The end is the atom after the specified zone

  • 20.03.14 Function based on FindZonePDB() but takes string for chain label and insert instead of single char. Function finds end of chain properly if stop set to -999. By: CTP

Definition at line 105 of file FindZonePDB.c.

BOOL blFitCaCbPDB ( PDB ref_pdb,
PDB fit_pdb,
REAL  rm[3][3] 
)
Parameters
[in]*ref_pdbReference PDB linked list
[in,out]*fit_pdbPDB linked list to be fitted
[out]rmRotation matrix
Returns
Success

Does a weigthed fitting of 2 PDB linked lists. The CA and CB are given a weight of 1.0 while the other atoms are given a weight of 1.0/natom in the residue. Thus for N,CA,C,CB backbone only, this will be N and C with weights of 0.25

  • 21.06.93 Original By: ACRM
  • 22.06.93 Added i increment (!). Corrected return of rm
  • 11.03.94 Changed call to matfit(). Corrected to normal matrix.
  • 15.03.94 Defines the rotation matrix locally and only copies for output if rm is not NULL
  • 14.03.96 Changed to use ApplyMatrixPDB() rather than RotatePDB() since we are already at the origin
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 122 of file FitCaCbPDB.c.

BOOL blFitCaPDB ( PDB ref_pdb,
PDB fit_pdb,
REAL  rm[3][3] 
)
Parameters
[in]*ref_pdbReference PDB linked list
[in,out]*fit_pdbMobile PDB linked list
[out]rmRotation matrix (May be input as NULL).
Returns
Success

Fits two PDB linked lists using only the CA atoms.

Actually fits fit_pdb onto ref_pdb and also returns the rotation matrix. This may be NULL if these data are not required.

  • 14.03.96 Original based on FitPDB() By: ACRM
  • 28.01.09 Initialize RetVal to TRUE!
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Added AsCopy suffix to calls to blSelectAtomsPDB() By: CTP

Definition at line 117 of file FitCaPDB.c.

BOOL blFitNCaCPDB ( PDB ref_pdb,
PDB fit_pdb,
REAL  rm[3][3] 
)
Parameters
[in]*ref_pdbReference PDB linked list
[in,out]*fit_pdbMobile PDB linked list
[out]rmRotation matrix (May be input as NULL).
Returns
Success

Fits two PDB linked lists using only the N, CA, C atoms.

Actually fits fit_pdb onto ref_pdb and also returns the rotation matrix. This may be NULL if these data are not required.

  • 12.12.01 Original based on FitCaPDB() By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Added AsCopy suffix to calls to blSelectAtomsPDB() By: CTP

Definition at line 114 of file FitNCaCPDB.c.

BOOL blFitPDB ( PDB ref_pdb,
PDB fit_pdb,
REAL  rm[3][3] 
)
Parameters
[in]*ref_pdbReference PDB linked list
[in,out]*fit_pdbMobile PDB linked list
[out]rmRotation matrix (May be input as NULL).
Returns
Success

Fits two PDB linked lists. Actually fits fit_pdb onto ref_pdb and also returns the rotation matrix. This may be NULL if these data are not required.

  • 17.06.93 Original based on code from ProFit By: ACRM
  • 11.03.94 Changed call to matfit(). Corrected to normal matrix.
  • 14.03.94 Actually fills in the rotation matrix (!). Restores original data if fitting failed.
  • 14.03.96 Changed to use ApplyMatrixPDB() rather than RotatePDB() since we are already at the origin
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 117 of file FitPDB.c.

char* blFixAtomName ( char *  name,
REAL  occup 
)
Parameters
[in]*nameAtom name read from file
[in]occupOccupancy to allow fixing of partial occupancy atom names
Returns
Fixed atom name (pointer into name)

Fixes an atom name by removing leading spaces, or moving a leading digit to the end of the string. Used by doReadPDB()

  • 06.04.94 Original By: ACRM
  • 01.03.01 No longer static
  • 03.06.05 The name passed in has always contained the column which is officially the alternate atom position indicator, but is used by some programs as part of the atom name. Thus the properly constructed variable coming into the routine should be something like '1HG1 ' or '1HG1A' for an alternate atom position. However some programs use ' HG11'. Therefore we now check for a character in the last position and replace it with a space if there is a space in the preceeding position (e.g. ' CA A' -> ' CA ') or if there is a character in the first position (e.g. '1HG1A' -> '1HG1 ') or if the occupancy is not zero/one NOTE!!! To support this, the routine now has a second parameter: REAL occup
  • 07.07.14 Renamed to blFixAtomName() By: CTP

Definition at line 1291 of file ReadPDB.c.

BOOL blFixCterPDB ( PDB pdb,
int  style 
)
Parameters
[in,out]*pdbPDB linked list to modify
[in]styleCTER_STYLE_STD, CTER_STYLE_GROMOS or CTER_STYLE_CHARMM
Returns
Memory allocation OK?

Renames C-ter atoms in required style and calls CalcCterCoords() as required to calculate coordinates ans splices them in. The input PDB linked list may have standard, CHARMM or GROMOS style.

  • 24.08.94 Original By: ACRM
  • 05.10.94 Removed unused variables
  • 12.11.96 If any of the antecedant coordinates are undefined, set the terminal oxygen to NULL coordinates
  • 13.11.96 Added check on finding CA,C and O1 If no C or O1 present, OXT not added
  • 06.02.03 Handles atnam_raw
  • 03.06.05 Handles altpos
  • 04.02.14 Use CHAINMATCH By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 17.02.15 Checks INIT() succeeded By: ACRM
  • 25.02.15 Ensures terminal oxygens are only added to amino acids not HETATM groups
  • 05.03.15 Replaced blFindEndPDB() with blFindNextResidue()

Definition at line 138 of file FixCterPDB.c.

PDB* blFixOrderPDB ( PDB pdb,
BOOL  Pad,
BOOL  Renum 
)
Parameters
[in]*pdbPDB linked list to fix atom order
[in]PadTRUE: Create dummy coordinate atoms for any missing atoms in standard residues
[in]RenumTRUE: Renumber the atoms
Returns
Corrected PDB linked list

Runs through a PDB linked list and corrects the atom order to match the N,CA,C,O,s/c standard. Only standard amino acids are processed. The input linked list is modified (i.e. a new list is not built), but the return value from the routine should be used for the corrected list rather than the input PDB pointer, since the start of the list may have changed. i.e. the routine should be called with the form:

           pdb = FixOrderPDB(pdb,TRUE,TRUE);

Definition at line 169 of file OrderPDB.c.

char* blFNam2PDB ( char *  filename)
Parameters
[in]*filenameA PDB filename containing a PDB code
Returns
The PDB code (lower case) NULL if memory allocation fails XXXX if filename blank or NULL or if unable to find PDB code

This routine attempts to convert a filename stem to a PDB code.

All the following inputs should produce the same output of 1fbj:

  $A:[PDB]PDB1FBJ.ENT
  C:\P1FBJ.PDB
  /pdb/p1fbj.pdb
  /pdb/pdb1fbj.pdb
  1fbj.pdb
  1fbjL

The routine first removes characters from the start of the filename up to the last : ] / or . It then searches for the following possible patterns (where N is a digit and X is an alphanumeric)

  pdbNXXX
  pNXXX
  NXXX
  XXXX.pdb
  XXXX.ent

This should cover just about any filename which includes a legal PDB code.

  • 24.07.95 Original By: ACRM
  • 26.07.95 Corrected a NULL to '\0'
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 123 of file FNam2PDB.c.

BOOL blFormatCheckWritePDB ( PDB pdb)
Parameters
[in]*pdbPDB linked list to write

Checks PDB linked list is compatible with PDB-formatted text file.

  • 21.06.14 Original By: CTP

Definition at line 269 of file WritePDB.c.

void blFreeBiomolecule ( BIOMOLECULE biomolecule)

Definition at line 1252 of file PDBHeaderInfo.c.

void blFreePDBStructure ( PDBSTRUCT pdbstruct)
Parameters
[in]*pdbstructPDBSTRUCT structure containing chain linked list

Frees memory used by the hierarchical description of a PDB structure. Note this does not free the underlying PDB linked list

  • 24.11.09 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 219 of file StructurePDB.c.

void blFreeWholePDB ( WHOLEPDB wpdb)
Parameters
[in]*wpdbWHOLEPDB structure to be freed

Frees the header, trailer and atom content from a WHOLEPDB structure

Definition at line 2293 of file ReadPDB.c.

BOOL blGetAtomTypes ( char *  resnam,
char **  AtomTypes 
)
Parameters
[in]*resnamResidue name for which to search
[out]**AtomTypesArray of atom names contained in the residue
Returns
Success

Fill in atom types for a given residue. AtomTypes must be pre-allocated and must be set up as an array of character pointers using Array2D() (or equivalent) rather than being created as a simple char types[][] - THIS WILL NOT WORK!

  • 08.07.93 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 349 of file OrderPDB.c.

BIOMOLECULE* blGetBiomoleculeWholePDB ( WHOLEPDB wpdb)
Parameters
[in]*wpdbPointer to WHOLEPDB structure
Returns
Pointer to malloc()'d BIOMOLECULE linked list

Reads the biomolecule assembly data from REMARK 300 and REMARK 350 headers.

The returned pointer is a linked list of BIOMOLECULE structures. The first item in the list contains the information from REMARK 300: the total number of biomolecule assemblies and any additional information provided in REMARK 300 beyond the standard comments. The additional information (biomolecule->details) is a STRINGLIST linked list.

The list of chains will appear in biomolcule->chains as a comma separated list and the transformation to be applied to them will appear in the biomolecule->biomt structure. This is also a linked list so if multiple transformations are required these will appear in further entries to this list.

Additional entries will be found in the BIOMOLECULE linked list for each different biomolecule.

See the test code in PDBHeaderInfo.c for example usage.

  • 26.06.15 Original By: ACRM

Definition at line 1232 of file PDBHeaderInfo.c.

void blGetCofGPDB ( PDB pdb,
VEC3F cg 
)
Parameters
[in]*pdbStart of PDB linked list
[out]*cgCentre of geometry of specified region

Finds the CofG of a PDB linked list, ignoring NULL coordinates.

  • 01.10.92 Original
  • 03.10.94 Fixed NULL coordinate ignoring
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 98 of file GetCGPDB.c.

void blGetCofGPDBRange ( PDB start,
PDB stop,
VEC3F cg 
)
Parameters
[in]*startStart of region of interest in PDB list
[in]*stopBeginning of next residue
[out]*cgCentre of geometry of specified region

Find CofG of a range in a PDB linked list, ignoring NULL coordinates (specified as all coords==9999.000)

  • 03.10.94 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 99 of file GetCofGPDBRange.c.

void blGetCofGPDBSCRange ( PDB start,
PDB stop,
VEC3F cg 
)
Parameters
[in]*startStart of region of interest in PDB list
[in]*stopBeginning of next residue
[out]*cgCentre of geometry of specified region

Find CofG of a range in a PDB linked list, ignoring NULL coordinates Looks only at the sidechain atoms (specified as all coords==9999.000) and backbone (N,CA,C,O). For Glycine, returns the CA coordinates.

  • 03.10.94 Original By: ACRM

Definition at line 101 of file GetCofGPDBSCRange.c.

BOOL blGetCompoundWholePDBChain ( WHOLEPDB wpdb,
char *  chain,
COMPND compnd 
)
Parameters
[in]*wpdbWHOLEPDB structure
[in]*chainChain label of interest
[out]*compndData from the COMPND records
Returns
BOOL Success

Extracts the COMPND data for a specified chain. Returns FALSE if the chain isn't found

  • 28.04.15 Original By: ACRM
  • 04.06.15 Modified to use the ExtractField() routine instead of duplicating code here. Fixes a bug in dealing with compounds where the referenced chains span more than one line

Definition at line 396 of file PDBHeaderInfo.c.

BOOL blGetCompoundWholePDBMolID ( WHOLEPDB wpdb,
int  molid,
COMPND compnd 
)
Parameters
[in]*wpdbWHOLEPDB structure
[in]molidMOL_ID from PDB-format COMPND record.
[out]*compndData from the COMPND records
Returns
BOOL Success

Extracts the COMPND data for a specified MOL_ID. Returns FALSE if the MOL_ID isn't found

Definition at line 600 of file PDBHeaderInfo.c.

int blGetCrystPDB ( FILE *  fp,
VEC3F UnitCell,
VEC3F CellAngles,
char *  spacegroup,
REAL  OrigMatrix[3][4],
REAL  ScaleMatrix[3][4] 
)
Parameters
[in]*fpInput file pointer
[out]*UnitCellThe unit cell dimensions
[out]*CellAnglesThe unit cell angles
[out]*spacegroupThe spacegroup
[out]OrigMatrixThe origin matrix
[out]ScaleMatrixThe scale matrix
Returns
Flags for elements read.
                                Flags for elements read:
                                    0: Nothing at all
                                    XTAL_DATA_CRYST: Unit cell
                                    XTAL_DATA_ORIGX: Origin matrix
                                    XTAL_DATA_SCALE: Scale matrix
                                    (These are ORed together)

Read the crystal parameters (unit cell, spacegroup, origin and scale matrices) out of a PDB file.

Stops searching as soon as an ATOM or HETATM record is hit and leaves the file in a state ready for ReadPDB() to do it's stuff (i.e. with the current file pointer at the first ATOM or HETATM record).

  • 12.10.95 Original By: ACRM
  • 17.10.95 Correctly returns retval if no ATOM/HETATM records not found
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 122 of file GetCrystPDB.c.

int blGetCrystWholePDB ( WHOLEPDB wpdb,
VEC3F UnitCell,
VEC3F CellAngles,
char *  spacegroup,
REAL  OrigMatrix[3][4],
REAL  ScaleMatrix[3][4] 
)
Parameters
[in]*wpdbWhole PDB pointer
[out]*UnitCellThe unit cell dimensions
[out]*CellAnglesThe unit cell angles
[out]*spacegroupThe spacegroup
[out]OrigMatrixThe origin matrix
[out]ScaleMatrixThe scale matrix
Returns
Flags for elements read.
                                Flags for elements read:
                                    0: Nothing at all
                                    XTAL_DATA_CRYST: Unit cell
                                    XTAL_DATA_ORIGX: Origin matrix
                                    XTAL_DATA_SCALE: Scale matrix
                                    (These are ORed together)

Read the crystal parameters (unit cell, spacegroup, origin and scale matrices) out of a PDB file.

Stops searching as soon as an ATOM or HETATM record is hit and leaves the file in a state ready for ReadPDB() to do it's stuff (i.e. with the current file pointer at the first ATOM or HETATM record).

Definition at line 293 of file GetCrystPDB.c.

BOOL blGetExptlOld ( FILE *  fp,
REAL resolution,
REAL RFactor,
REAL FreeR,
int *  StrucType 
)
Parameters
[in]*fpPDB file pointer
[out]*resolutionThe resolution (0.0 if not applicable)
[out]*RFactorThe R-factor (0.0 if not found)
[out]*FreeRThe Free R-factor (0.0 if not found)
[out]*StrucTypeStructure type: STRUCTURE_TYPE_XTAL STRUCTURE_TYPE_NMR STRUCTURE_TYPE_MODEL STRUCTURE_TYPE_UNKNOWN
Returns
TRUE if resolution found (even if not applicable)

This routine attempts to obtain resolution and R-factor information out of a PDB file. It returns TRUE or FALSE to indicate whether valid information was found. Resolution-not-applicable structures then have the resolution set to zero.

N.B. The resolution information returned by the routine is reliable; the R-factor information is stored in so many forms that it is difficult to read without some form of natural language parsing, but we manage to handle most situations. The routine assumes the R-factor to be the first number after the words `R-value' (or one of the other keys - see the case statement in the code for the valid keywords). Thus we cannot handle records of the form: THE R-VALUE FOR 7142 REFLECTIONS BETWEEN 10.0 AND 1.97 ANGSTROMS REFINEMENT CYCLE 73 IS 0.254. as appears in entries such as 1LZT. Here, the first number is the number of reflections. There is thus a kludge which sets the R-factor to zero if it was read as greater than 0.5 to avoid this situation. In these cases, we lose the R-factor information. This occurs in approx 3.5% of the 1XXX PDB entries.

  • 25.02.94 Original By: ACRM
  • 28.02.94 Added " R = " and check that VALUE wasn't B-VALUE
  • 17.07.96 Added check for EXPERIMENT TYPE : THEORETICAL MODEL Also fixed bug in searching REMARK record
  • 27.06.97 Added handing of RESOLUTION records which point you to another record for the experiment type. Fixed some calls to FindNextNumber() which were checking an 80 character width Fixed EXPERIMENT TYPE to look for NMR as well Looks for EXPDTA NMR record
  • 23.03.98 Added check that RESOLUTION record is in a REMARK 2
  • 08.03.99 Renamed to GetExptl() from GetResolPDB() and added FreeR parameter. GetResolPDB() is now a wrapper to this routine. Added additional pass which looks for the structured REMARK 3 records
  • 28.04.99 Initialise FindRefRecord et al. to zero
  • 18.06.99 Added other strings to the valid structured block for pass 0 Added check for -ve R-factor
  • 08.09.99 Now takes the first FREE R-factor followed by 17 spaces rather than the last
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 666 of file ResolPDB.c.

BOOL blGetExptlPDB ( FILE *  fp,
REAL resolution,
REAL RFactor,
REAL FreeR,
int *  StrucType 
)
Parameters
[in]*fpPDB file pointer
[out]*resolutionThe resolution (0.0 if not applicable)
[out]*RFactorThe R-factor (0.0 if not found)
[out]*FreeRThe Free R-factor (0.0 if not found)
[out]*StrucTypeStructure type: STRUCTURE_TYPE_XTAL STRUCTURE_TYPE_NMR STRUCTURE_TYPE_MODEL STRUCTURE_TYPE_UNKNOWN
Returns
TRUE if resolution found or valid structure type found

This routine attempts to obtain resolution and R-factor information out of a PDB file. It returns TRUE or FALSE to indicate whether valid information was found. Resolution-not-applicable structures then have the resolution set to zero.

  • 12.12.11 Original By: ACRM New implementation for remediated PDB files. The old version is available as GetExptlOld() which handles old format files. NOTE If multiple methods specified in EXPDTA record, only the first is used If multiple R-factors are provided in different sections, then the first one is returned.
  • 07.07.14 Use bl prefix for functions By: CTP
  • 02.03.15 Moved the actual work into ReadData() By: ACRM Renamed from blGetExptl()

Definition at line 289 of file ResolPDB.c.

BOOL blGetExptlWholePDB ( WHOLEPDB wpdb,
REAL resolution,
REAL RFactor,
REAL FreeR,
int *  StrucType 
)
Parameters
[in]*wpdbWHOLEPDB structure pointer
[out]*resolutionThe resolution (0.0 if not applicable)
[out]*RFactorThe R-factor (0.0 if not found)
[out]*FreeRThe Free R-factor (0.0 if not found)
[out]*StrucTypeStructure type: STRUCTURE_TYPE_XTAL STRUCTURE_TYPE_NMR STRUCTURE_TYPE_MODEL STRUCTURE_TYPE_UNKNOWN
Returns
TRUE if resolution found or valid structure type found

This routine attempts to obtain resolution and R-factor information out of a PDB file. It returns TRUE or FALSE to indicate whether valid information was found. Resolution-not-applicable structures then have the resolution set to zero.

Definition at line 350 of file ResolPDB.c.

BOOL blGetHeaderWholePDB ( WHOLEPDB wpdb,
char *  header,
int  maxheader,
char *  date,
int  maxdate,
char *  pdbcode,
int  maxcode 
)
Parameters
[in]*wpdbWHOLEPDB structure pointer
[out]*headerString containing header text
[in]maxheaderMax length for storing header
[out]*dateDate string
[in]maxdateMax length for storing date
[out]*pdbcodePDB code
[in]maxcodeMax length for storing PDB code
Returns
TRUE: Found HEADER FALSE: Didn't find HEADER

Obtains information from the PDB HEADER record

  • 26.03.15 Original By: ACRM

Definition at line 182 of file PDBHeaderInfo.c.

MODRES* blGetModresWholePDB ( WHOLEPDB wpdb)
Parameters
[in]

Definition at line 882 of file PDBHeaderInfo.c.

PDB* blGetPDBByN ( PDB pdb,
int  n 
)
Parameters
[in]*pdbPDB linked list
[in]nOffset into linked list
Returns
Pointer to n'th item in linked list

Gets a pointer to a pdb item by taking a PDB linked list and an integer. The pointer returned is the n'th item in the list

  • 13.05.92 Original
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 106 of file GetPDBByN.c.

PDB* blGetPDBChainAsCopy ( PDB pdbin,
char *  chain 
)
Parameters
[in]*pdbinPDB linked list
[in]*chainChain label
Returns
PDB linked list for requested chain

Extracts a specified chain from a PDB linked list allocating a new list containing only that chain. The original list is unchanged.

  • 26.03.15 Original By: ACRM
  • 19.04.15 Added call to blCopyConect()

Definition at line 95 of file GetPDBChainAsCopy.c.

char** blGetPDBChainLabels ( PDB pdb,
int *  nChains 
)
Parameters
[in]*pdbPDB linked list
[out]nChainsNumber of chains found.
Returns
Allocated array of strings containing chain labels. NULL if unable to allocate memory.

Scans a PDB linked list for chain names. Allocates memory for an array of strings containing these labels which is returned together with the number of chains found.

N.B. You must free the allocated memory for both the array of chains and for each individual chain label when you've finished with it!

  • 25.03.14 Original based on GetPDBChainLabels(). By: CTP
  • 26.03.15 No longer assumes chain labels do not appear again later (i.e. chains L,H,Y,L only returns L,H,Y) By: ACRM

Definition at line 118 of file GetPDBChainLabels.c.

int blGetPDBCoor ( PDB pdb,
COOR **  coor 
)
Parameters
[in]*pdbPDB linked list
[out]**coorArray of coordinate structure pointers
Returns
Number of coordinates copied

Get the coordinates out of a PDB linked list into an array of type COOR The COOR array is allocated for you

  • 17.06.93 Original By: ACRM
  • 22.06.93 Corrected return value
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 104 of file GetPDBCoor.c.

BOOL blGetResolPDB ( FILE *  fp,
REAL resolution,
REAL RFactor,
int *  StrucType 
)
Parameters
[in]*fpPDB file pointer
[out]*resolutionThe resolution (0.0 if not applicable)
[out]*RFactorThe R-factor (0.0 if not found)
[out]*StrucTypeStructure type: STRUCTURE_TYPE_XTAL STRUCTURE_TYPE_NMR STRUCTURE_TYPE_MODEL STRUCTURE_TYPE_UNKNOWN
Returns
TRUE if resolution found (even if not applicable)

This routine attempts to obtain resolution and R-factor information out of a PDB file. It returns TRUE or FALSE to indicate whether valid information was found. Resolution-not-applicable structures then have the resolution set to zero.

N.B. The resolution information returned by the routine is reliable; the R-factor information is stored in so many forms that it is difficult to read without some form of natural language parsing, but we manage to handle most situations. The routine assumes the R-factor to be the first number after the words `R-value' (or one of the other keys - see the case statement in the code for the valid keywords). Thus we cannot handle records of the form: THE R-VALUE FOR 7142 REFLECTIONS BETWEEN 10.0 AND 1.97 ANGSTROMS REFINEMENT CYCLE 73 IS 0.254. as appears in entries such as 1LZT. Here, the first number is the number of reflections. There is thus a kludge which sets the R-factor to zero if it was read as greater than 0.5 to avoid this situation. In these cases, we lose the R-factor information. This occurs in approx 3.5% of the 1XXX PDB entries.

  • 25.02.94 Original By: ACRM
  • 28.02.94 Added " R = " and check that VALUE wasn't B-VALUE
  • 17.07.96 Added check for EXPERIMENT TYPE : THEORETICAL MODEL Also fixed bug in searching REMARK record
  • 27.06.97 Added handing of RESOLUTION records which point you to another record for the experiment type. Fixed some calls to FindNextNumber() which were checking an 80 character width Fixed EXPERIMENT TYPE to look for NMR as well Looks for EXPDTA NMR record
  • 23.03.98 Added check that RESOLUTION record is in a REMARK 2
  • 08.02.99 Now a wrapper to GetExptl() which also returns FreeR
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 193 of file ResolPDB.c.

BOOL blGetResolWholePDB ( WHOLEPDB wpdb,
REAL resolution,
REAL RFactor,
int *  StrucType 
)
Parameters
[in]*wpdbWHOLEPDB structure pointer
[out]*resolutionThe resolution (0.0 if not applicable)
[out]*RFactorThe R-factor (0.0 if not found)
[out]*StrucTypeStructure type: STRUCTURE_TYPE_XTAL STRUCTURE_TYPE_NMR STRUCTURE_TYPE_MODEL STRUCTURE_TYPE_UNKNOWN
Returns
TRUE if resolution found or valid structure type found

This routine attempts to obtain resolution and R-factor information out of a WHOLEPDB structure. It returns TRUE or FALSE to indicate whether valid information was found. Resolution-not-applicable structures then have the resolution set to zero.

N.B. The resolution information returned by the routine is reliable; the R-factor information is stored in so many forms that it is difficult to read without some form of natural language parsing, but we manage to handle most situations. The routine assumes the R-factor to be the first number after the words `R-value' (or one of the other keys - see the case statement in the code for the valid keywords). Thus we cannot handle records of the form: THE R-VALUE FOR 7142 REFLECTIONS BETWEEN 10.0 AND 1.97 ANGSTROMS REFINEMENT CYCLE 73 IS 0.254. as appears in entries such as 1LZT. Here, the first number is the number of reflections. There is thus a kludge which sets the R-factor to zero if it was read as greater than 0.5 to avoid this situation. In these cases, we lose the R-factor information. This occurs in approx 3.5% of the 1XXX PDB entries.

  • 02.03.15 Original By: ACRM

Definition at line 244 of file ResolPDB.c.

char* blGetSeqresAsStringWholePDB ( WHOLEPDB wpdb,
char **  chains,
MODRES modres,
BOOL  doNucleic 
)
Parameters
[in]*wpdbPointer to whole PDB structure
[out]**chainsChain labels for the chains - may also be set to NULL if you don't want to record chain labels
[in]*modresLinked list of MODRES information. May be NULL if you don't want to translate non-standard amino acids.
[in]doNucleicRead sequence for nucleic acid chains
Returns
malloc()'d Sequence from SEQRES, chains separated by a *

Reads sequence from SEQRES records into a character string in 1-letter code. Chains are terminated by * characters.

  • 21.08.97 Original by: ACRM
  • 22.08.97 Added chains parameter
  • 26.08.97 No longer reads DNA/RNA
  • 07.03.07 Added code to check for modified amino acids Now reads from wpdb rather than from the file
  • 07.11.14 Initialize lastchain
  • 11.06.15 Moved to bioplib - doNucleic is now a paramater instead of a global; chains is now an array of strings
  • 12.06.15 Frees memory and returns NULL if no SEQRES found

Definition at line 759 of file PDBHeaderInfo.c.

HASHTABLE* blGetSeqresByChainWholePDB ( WHOLEPDB wpdb,
MODRES modres,
BOOL  doNucleic 
)
Parameters
[in]*wpdbPointer to whole PDB structure
[in]*modresLinked list of MODRES information. May be NULL if you don't want to translate non-standard amino acids.
[in]doNucleicRead sequence for nucleic acid chains
Returns
A hash of 1-letter code sequences indexed by chain label

Reads sequence from SEQRES records in 1-letter code, storing the results in a hash indexed by chain label.

  • 25.11.15 Original by: ACRM

Definition at line 1300 of file PDBHeaderInfo.c.

BOOL blGetSpeciesWholePDBChain ( WHOLEPDB wpdb,
char *  chain,
PDBSOURCE source 
)
Parameters
[in]*wpdbWHOLEPDB structure
[in]*chainChain label
[out]*sourceSOURCE information for chain
Returns
Success (chain found?)

Extracts the SOURCE data for a specified chain

  • 26.03.15 Original By: ACRM
  • 13.05.15 Fixes...

Definition at line 534 of file PDBHeaderInfo.c.

BOOL blGetSpeciesWholePDBMolID ( WHOLEPDB wpdb,
int  molid,
PDBSOURCE source 
)
Parameters
[in]*wpdbWHOLEPDB structure
[in]molidMOL_ID from PDB-format SOURCE record.
[out]*sourceSOURCE information for chain
Returns
Success (chain found?)

Extracts the SOURCE data for a specified MOL_ID. Returns FALSE if not found.

Definition at line 679 of file PDBHeaderInfo.c.

char* blGetTitleWholePDB ( WHOLEPDB wpdb)
Parameters
[in]*wpdbWHOLEPDB structure
Returns
Tit;le from PDB file (malloc()'d)

Extracts the title from a PDB file malloc()ing a string in which to store the data. This must be freed by user code

  • 28.04.15 Original By: ACRM
  • 11.05.15 Return NULL if TITLE line absent. By: CTP
  • 09.06.15 Add columns 11 to 80 to title string for both start and continuation lines. By: CTP

Definition at line 228 of file PDBHeaderInfo.c.

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.

PDB** blIndexAtomNumbersPDB ( PDB pdb,
int *  indexSize 
)
Parameters
[in]*pdbPDB linked list
[out]*indexSizeIndex size
Returns
malloc'd array of PDB pointers indexed by atom number

Creates an array of pointers to PDB from a linked list. This is used to allow array style access to items in the linked list by atom number: e.g. (indx[23])->x will give the x coordinate of atom number 23

  • 19.04.15 Original By: ACRM

Definition at line 156 of file IndexPDB.c.

PDB** blIndexPDB ( PDB pdb,
int *  natom 
)
Parameters
[in]*pdbPointer to the start of a PDB linked list.
[out]*natomNumber of atoms in the PDB linked list.
Returns
An array of pointers to the PDB records. NULL if unable to allocate memory.

Creates an array of pointers to PDB from a linked list. This is used to allow array style access to items in the linked list: e.g. (indx[23])->x will give the x coordinate of the 23rd item

  • 19.07.90 Original
  • 01.06.92 ANSIed and documented.
  • 24.02.94 Re-written. Now allocates and returns the index.
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 117 of file IndexPDB.c.

BOOL blInPDBZone ( PDB p,
char *  chain,
int  resnum1,
char *  insert1,
int  resnum2,
char *  insert2 
)
Parameters
[in]*pPointer to a PDB record
[in]*chainChain name
[in]resnum1First residue
[in]*insert1First insert code
[in]resnum2Second residue
[in]*insert2Second insert code
Returns
Is p in the range specified?

Checks that atom stored in PDB pointer p is within the specified residue range.

N.B. This assumes ASCII coding.

  • 24.02.14 Based on InPDBZone() but takes chain and inserts as stings instead of chars. By: CTP
  • 02.03.14 Use strcmp to compare inserts. Fixed bug handling insert residues where start and finish of zone have same residue number. By: CTP
  • 07.07.14 Renamed to blInPDBZone(). Use bl prefix for functions By: CTP

Definition at line 115 of file InPDBZone.c.

BOOL blInPDBZoneSpec ( PDB p,
char *  resspec1,
char *  resspec2 
)
Parameters
[in]*pPointer to a PDB record
[in]*resspec1Res spec for first residue
[in]*resspec2Res spec for last residue
Returns
Is p in the range specified?

Determines whether a PDB pointer is within a residue range specified using standard format: [c]nnn[i]

Also handles the residue spec of c* (i.e. chain name and a * to indicate all residues in a given chain). This must be given as resspec1 (resspec2 is then ignored).

Calls InPDBZone() to do the actual work

  • 19.09.96 Original By: ACRM
  • 24.02.14 Uses string for chain and insert instead of char. Wildcard match for multi-letter chain id. Now calls BiopInPDBZone(). By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 111 of file InPDBZoneSpec.c.

BOOL blIsBonded ( PDB p,
PDB q,
REAL  tol 
)
Parameters
[in]*pFirst PDB atom
[in]*qSecond PDB atom
[in]tolTelerance for separation between atoms
Returns
Bonded?

Test whether two atoms are bonded

  • 19.02.15 Original By: ACRM
  • 26.02.15 Added tol parameter. Changed to used squared distances

Definition at line 326 of file BuildConect.c.

BOOL blIsConected ( PDB p,
PDB q 
)
Parameters
[in]*pFirst atom
[in]*qSecond atom
Returns
Connected?

Tests whether there is a link between the specified atoms in the CONECT list

  • 07.06.99 Original By: ACRM

Definition at line 629 of file BuildConect.c.

PDB* blKillPDB ( PDB pdb,
PDB prev 
)
Parameters
[in]*pdbPointer to item in PDB linked list to be removed
[in]*prevPointer to previous item in linked list
Returns
Next item in PDB linked list

Kill an item in the PDB linked list and re-link correctly. Returns the next item in the list, so will be NULL when the last item in the list is killed.

  • 12.05.92 Original
  • 11.03.94 Now handles prev==NULL to delete first item in a list
  • 07.07.14 Use bl prefix for functions By: CTP
  • 16.03.15 Checks and removes any CONECT data By: ACRM

Definition at line 214 of file KillPDB.c.

BOOL blKillSidechain ( PDB ResStart,
PDB NextRes,
BOOL  doCB 
)
Parameters
[in]*ResStartStart of a residue in linked list
[in]*NextResStart of next residue
[in]doCBFlag to kill CB as part of s/c
Returns
Success?

Kills sidechains by calls to KillPDB() for residues between ResStart and NextRes. If doCB is set, will kill the CB.

N.B. At least 1 backbone atom must occur in the linked list before the sidechain.

  • 12.05.92 Original
  • 05.10.94 doCB is now a BOOL as is the return

Definition at line 111 of file KillSidechain.c.

BOOL blLegalAtomSpec ( char *  spec)

Partner routine for AtomNameMatch(). Checks whether a wildcard specfication is legal (i.e. will not return an error when used with AtomNameMatch()).

The only thing which is not legal is characters following a *

  • 23.07.96 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 106 of file LegalAtomSpec.c.

BOOL blMovePDB ( PDB move,
PDB **  from,
PDB **  to 
)
Parameters
[in]*movePDB record to be moved
[in,out]**fromStart of PDB linked list containing record
[in,out]**toStart of output linked list
Returns
Success?

Moves a PDB record from one linked list to another. from and to should point to the start of the 2 lists. If the to list hasn't been started, to should be NULL. Returns TRUE if moved, FALSE otherwise.

  • 13.05.92 Original
  • 19.06.92 Changed p=*to, etc. for crappy compilers
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 100 of file MovePDB.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.

void blOriginPDB ( PDB pdb)
Parameters
[in,out]*pdbPDB linked list to move

Moves a PDB linked list to the origin, ignoring NULL coordinates.

  • 01.10.92 Original
  • 22.02.94 Changed NULL check to any coordinate not 9999.0
  • 11.03.94 Changed NULL check to >9998.0 Added cast to REAL
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 96 of file OriginPDB.c.

BOOL blParseResSpec ( char *  spec,
char *  chain,
int *  resnum,
char *  insert 
)
Parameters
[in]*specResidue specification
[out]*chainChain label
[out]*resnumResidue number
[out]*insertInsert label
Returns
Success?

Note that chain and insert must be arrays of at least 2 characters, not character pointers

Splits up a residue specification of the form [c][.]num[i] into chain, resnum and insert. Chain and insert are optional and will be set to spaces if not specified. Converts the resiude specification to upper case before processing.

Moved the code that was here to a new function, DoParseResSpec() and made this function just call that new function. See DoParseResSpec()'s comments for notes on previous changes. This move is to allow the underlying function to have an extra parameter to specify whether or not the residue specification should be upper cased (without affecting code that calls this function).

  • 29.09.05 Original By: TL
  • 05.01.12 Now behaves the same as ParseResSpecNoUpper(). There are now too many PDB files with lower case chain names (e.g. 1gav, 3n9r, etc.) for the old default behaviour or up-casing everything. By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 158 of file ParseRes.c.

void blPrintResSpecHelp ( FILE *  fp)

Definition at line 330 of file ParseRes.c.

DISULPHIDE* blReadDisulphidesPDB ( FILE *  fp,
BOOL error 
)
Parameters
[in]*fpPDB file pointer
[out]*errorSuccess
Returns
Linked list of disulphide information. NULL if none found or error (Check flag)

Searches a PDB file for SSBOND records and constructs a linked list of information from these records. Returns NULL if no disulphide information found. If memory allocation fails, the DISULPHIDE linked list formed thus far is returned and the error flag is set to TRUE

  • 14.10.93 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 114 of file RdSSPDB.c.

DISULPHIDE* blReadDisulphidesWholePDB ( WHOLEPDB wpdb,
BOOL error 
)
Parameters
[in]*wpdbWhole PDB structure
[out]*errorSuccess
Returns
Linked list of disulphide information. NULL if none found or error (Check flag)

Searches the headers in a WHOLEPDB structure for SSBOND records and constructs a linked list of information from these records. Returns NULL if no disulphide information found. If memory allocation fails, the DISULPHIDE linked list formed thus far is returned and the error flag is set to TRUE

Definition at line 174 of file RdSSPDB.c.

PDB* blReadPDB ( FILE *  fp,
int *  natom 
)
Parameters
[in]*fpA pointer to type FILE in which the .PDB file is stored.
[out]*natomNumber of atoms read. -1 if error.
Returns
A pointer to the first allocated item of the PDB linked list

Reads a PDB file into a PDB linked list

  • 08.07.93 Written as entry for doReadPDB()
  • 09.07.93 Modified to return pointer to PDB
  • 17.03.94 Modified to handle OccRank
  • 06.03.95 Added value for NMR model to read (1 = first)
  • 25.01.06 Added call to RemoveAlternates() - this deals with odd cases where alternate atom positions don't appear where they should!
  • 25.01.06 Added call to RemoveAlternates(). This deals with odd uses of multiple occupancies like 3pga and the instance where the alternates are all grouped at the end of the file.
  • 07.07.14 Renamed to blReadPDB() By: CTP
  • 03.04.15 Initialize pdb to NULL avoiding returning uninitialized value if blDoReadPDB() fails. By: CTP

Definition at line 419 of file ReadPDB.c.

PDB* blReadPDBAll ( FILE *  fp,
int *  natom 
)
Parameters
[in]*fpA pointer to type FILE in which the .PDB file is stored.
[out]*natomNumber of atoms read. -1 if error.
Returns
A pointer to the first allocated item of the PDB linked list

Reads a PDB file into a PDB linked list. Reads all partial occupancy atoms. Reads both ATOM and HETATM records.

  • 04.10.94 Original By: ACRM
  • 06.03.95 Added value for NMR model to read (0 = all)
  • 07.07.14 Renamed to blReadPDBAll() By: CTP
  • 03.04.15 Initialize pdb to NULL avoiding returning uninitialized value if blDoReadPDB() fails. By: CTP

Definition at line 460 of file ReadPDB.c.

PDB* blReadPDBAtoms ( FILE *  fp,
int *  natom 
)
Parameters
[in]*fpA pointer to type FILE in which the .PDB file is stored.
[out]*natomNumber of atoms read. -1 if error.
Returns
A pointer to the first allocated item of the PDB linked list

Reads a PDB file into a PDB linked list. Atoms only (no HETATM cards).

  • 08.07.93 Written as entry for doReadPDB()
  • 09.07.93 Modified to return pointer to PDB
  • 17.03.94 Modified to handle OccRank
  • 06.03.95 Added value for NMR model to read (1 = first)
  • 25.01.06 Added call to RemoveAlternates(). This deals with odd uses of multiple occupancies like 3pga and the instance where the alternates are all grouped at the end of the file.
  • 07.07.14 Renamed to blReadPDBAtoms() By: CTP
  • 03.04.15 Initialize pdb to NULL avoiding returning uninitialized value if blDoReadPDB() fails. By: CTP

Definition at line 503 of file ReadPDB.c.

PDB* blReadPDBAtomsOccRank ( FILE *  fp,
int *  natom,
int  OccRank 
)
Parameters
[in]*fpA pointer to type FILE in which the .PDB file is stored.
[in]OccRankOccupancy ranking (>=1)
[out]*natomNumber of atoms read. -1 if error.
Returns
A pointer to the first allocated item of the PDB linked list

Reads a PDB file into a PDB linked list ignoring HETATM records and selecting the OccRank'th highest occupancy atoms

  • 17.03.94 Original By: ACRM
  • 06.03.95 Added value for NMR model to read (1 = first)
  • 07.07.14 Renamed to blReadPDBAtomsOccRank() By: CTP
  • 03.04.15 Initialize pdb to NULL avoiding returning uninitialized value if blDoReadPDB() fails. By: CTP

Definition at line 586 of file ReadPDB.c.

PDB* blReadPDBOccRank ( FILE *  fp,
int *  natom,
int  OccRank 
)
Parameters
[in]*fpA pointer to type FILE in which the .PDB file is stored.
[in]OccRankOccupancy ranking (>=1)
[out]*natomNumber of atoms read. -1 if error.
Returns
A pointer to the first allocated item of the PDB linked list

Reads a PDB file into a PDB linked list selecting the OccRank'th highest occupancy atoms

  • 17.03.94 Original By: ACRM
  • 06.03.95 Added value for NMR model to read (1 = first)
  • 07.07.14 Renamed to blDoReadPDB() By: CTP
  • 03.04.15 Initialize pdb to NULL avoiding returning uninitialized value if blDoReadPDB() fails. By: CTP

Definition at line 545 of file ReadPDB.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.

SECSTRUC* blReadSecPDB ( FILE *  fp,
int *  nsec 
)
Parameters
[in]*fpPointer to PDB file
[out]*nsecNumber of sec struc regions identified
Returns
Linked list of type SECSTRUC

Reads secondary structure information from the header of a PDB file. Returns a pointer to a linked list of type SECSTRUC.

On return, the variable nsec, or the value returned by the routine should be checked to ensure some secondary structure was returned. The secondary structure is stored together with ranges of residues to which it applies. The form of the structure should be checked in pdb.h

  • 22.03.90 Original
  • 20.06.90 Would crash if no secondary structure found—fixed.
  • 09.07.93 Changed allocation scheme. Returns pointer to SECSTRUC. No need to initialise this before calling. Uses fsscanf()
  • 18.08.98 Changed SEC to SECSTRUC 'cos of conflict in SunOS
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 141 of file RdSecPDB.c.

SECSTRUC* blReadSecWholePDB ( WHOLEPDB wpdb,
int *  nsec 
)
Parameters
[in]*wpdbWHOLEPDB structure
[out]*nsecNumber of sec struc regions identified
Returns
Linked list of type SECSTRUC

Reads secondary structure information from the header of a PDB file stored in a WHOLEPDB structure. Returns a pointer to a linked list of type SECSTRUC.

On return, the variable nsec, or the value returned by the routine should be checked to ensure some secondary structure was returned. The secondary structure is stored together with ranges of residues to which it applies. The form of the structure should be checked in pdb.h

Definition at line 256 of file RdSecPDB.c.

char** blReadSeqresPDB ( FILE *  fp,
int *  nchains 
)
Parameters
[in]*fpPDB file pointer
[out]*nchainsNumber of chains found
Returns
Array of sequence strings

Reads the sequence from the SEQRES records of a PDB file. Creates an array of malloc()'d character arrays in which the sequence is stored. Can therefore cope with any size of sequence information from the PDB file.

This is not normally recommended to get the sequence for a PDB file this way, but is useful to detect discrepancies compared with the sequence described by the ATOM records.

  • 14.10.96 Original By: ACRM
  • 25.03.14 Added CHAINMATCH. Chain IDs handled as strings. By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 113 of file RdSeqPDB.c.

char** blReadSeqresWholePDB ( WHOLEPDB wpdb,
int *  nchains 
)
Parameters
[in]wpdbWHOLEPDB structure
[out]*nchainsNumber of chains found
Returns
Array of sequence strings

Reads the sequence from the SEQRES records from the PDB header stored in a WHOLEPDB structure. Creates an array of malloc()'d character arrays in which the sequence is stored. Can therefore cope with any size of sequence information from the PDB file.

This is not normally recommended to get the sequence for a PDB file this way, but is useful to detect discrepancies compared with the sequence described by the ATOM records.

Definition at line 228 of file RdSeqPDB.c.

WHOLEPDB* blReadWholePDB ( FILE *  fpin)
Parameters
[in]*fpinFile pointer
Returns
Whole PDB structure containing linked list to PDB coordinate data

Reads a PDB file, storing the header and trailer information as well as the coordinate data. Can read gzipped files as well as uncompressed files.

Coordinate data is accessed as linked list of type PDB as follows:

WHOLEPDB *wpdb; PDB *p; wpdb = ReadWholePDB(fp); for(p=wpdb->pdb; p!=NULL; p=p->next) { ... Do something with p ... }

  • 07.03.07 Made into a wrapper to doReadWholePDB()
  • 07.07.14 Use blDoReadWholePDB() Renamed to blReadWholePDB() By: CTP

Definition at line 2328 of file ReadPDB.c.

WHOLEPDB* blReadWholePDBAtoms ( FILE *  fpin)
Parameters
[in]*fpinFile pointer
Returns
Whole PDB structure containing linked list to PDB coordinate data

Reads a PDB file, storing the header and trailer information as well as the coordinate data. Can read gzipped files as well as uncompressed files.

Coordinate data is accessed as linked list of type PDB as follows:

WHOLEPDB *wpdb; PDB *p; wpdb = ReadWholePDB(fp); for(p=wpdb->pdb; p!=NULL; p=p->next) { ... Do something with p ... }

  • 07.03.07 Made into a wrapper to doReadWholePDB()
  • 07.07.14 Use blDoReadWholePDB() Renamed to blReadWholePDBAtoms() By: CTP

Definition at line 2363 of file ReadPDB.c.

PDB* blRemoveAlternates ( PDB pdb)
Parameters
[in,out]*pdbPDB
Returns
Ammended linked list (in case start has changed)

Remove alternate atoms - we keep only the highest occupancy or the first if there are more than one the same.

  • 25.01.05 Original based on code written for Inpharmatica By: ACRM
  • 04.02.14 Use CHAINMATCH macro. By: CTP
  • 07.07.14 Renamed to blRemoveAlternates() Use blWritePDBRecord() Use bl prefix for functions By: CTP

Definition at line 1362 of file ReadPDB.c.

void blRenumAtomsPDB ( PDB pdb,
int  offset 
)
Parameters
[in,out]*pdbPDB linked list to renumber
[in]offsetNumber for the first atom

Renumber the atoms throughout a PDB linked list

  • 01.08.93 Original
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.02.15 More intelligent version that allows for TER records which are also numbered. Added offset parameter.
  • 29.04.15 Increment atom number at start of HETATM records. By: CTP

Definition at line 100 of file RenumAtomsPDB.c.

BOOL blRepOneSChain ( PDB pdb,
char *  ResSpec,
char  aa,
char *  ChiTable,
char *  RefCoords 
)
Parameters
[in,out]*pdbPDB linked list to modify
[in]*ResSpecResidue spec for residue to replace in the format [c]nnn[i]
[in]aaThe 1-letter code for the new sidechain
[in]*ChiTableThe equivalent Chi table
[in]*RefCoordsThe reference coordinates file
Returns
Success?

Replace a single sidechain. Takes a PDB linked list, a residues specfication (in the form [c]nnn[i] where [c] is an optional chain name, nnn is a residue number and [i] is an optional insert code) and a 1-letter code of the required sidechain and does a simple maximum overlap replacement of the sidechain. Also requires filenames of the two datafiles.

  • 12.08.96 Original based on RepSChain()
  • 15.08.96 Removed unused variables
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.02.15 Modified for new blRenumAtomsPDB() which takes an offset
  • 29.09.15 Now just a wrapper to doRepOneSChain()

Definition at line 319 of file rsc.c.

BOOL blRepOneSChainForce ( PDB pdb,
char *  ResSpec,
char  aa,
char *  ChiTable,
char *  RefCoords 
)
Parameters
[in,out]*pdbPDB linked list to modify
[in]*ResSpecResidue spec for residue to replace in the format [c]nnn[i]
[in]aaThe 1-letter code for the new sidechain
[in]*ChiTableThe equivalent Chi table
[in]*RefCoordsThe reference coordinates file
Returns
Success?

Replace a single sidechain. Takes a PDB linked list, a residues specfication (in the form [c]nnn[i] where [c] is an optional chain name, nnn is a residue number and [i] is an optional insert code) and a 1-letter code of the required sidechain and does a simple maximum overlap replacement of the sidechain. Also requires filenames of the two datafiles.

Replaces even if the sidechain was coorect already

  • 29.09.15 Original - wrapper to doRepOneSChain()

Definition at line 350 of file rsc.c.

char* blReportStructureType ( int  StrucType)
Parameters
[in]StrucTypeStucture type returned by ResolPDB()
Returns
Stucture type description.

Returns structure description.

  STRUCTURE_TYPE_UNKNOWN     Unknown
  STRUCTURE_TYPE_XTAL        X-ray crystal structure
  STRUCTURE_TYPE_NMR         NMR
  STRUCTURE_TYPE_MODEL       Model
  STRUCTURE_TYPE_ELECTDIFF   Electron Diffraction
  STRUCTURE_TYPE_FIBER       Fiber Diffraction
  STRUCTURE_TYPE_SSNMR       Solid State NMR
  STRUCTURE_TYPE_NEUTRON     Neutron Scattering
  STRUCTURE_TYPE_EM          Electron Miscroscopy
  STRUCTURE_TYPE_SOLSCAT     Solution Scattering
  STRUCTURE_TYPE_IR          Infra-red Spectroscopy
  STRUCTURE_TYPE_POWDER      Powder Diffraction
  STRUCTURE_TYPE_FRET        Fluorescence Transfer
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 410 of file ResolPDB.c.

BOOL blRepSChain ( PDB pdb,
char *  sequence,
char *  ChiTable,
char *  RefCoords 
)
Parameters
[in,out]*pdbPDB linked list to modify
[in]*sequenceThe 1-letter code required for the structure
[in]*ChiTableThe equivalent Chi table
[in]*RefCoordsThe reference coordinates file
Returns
Success?

Replace sidechains. Takes a PDB linked list and a 1-letter code sequence and replaces the sidechains. Also requires filenames of the two datafiles. DEL residues in the pdb linked list will be skipped as will -'s in the sequence

  • 12.05.92 Original
  • 14.05.92 Corrected handling of matching DEL and -
  • 21.06.93 Changed to allocate chitab using Array2D
  • 14.03.94 Changed logic of return value. Now places error messages in gRSCError.
  • 09.11.94 Uses OpenFile() to look in /home/bsm/martin/data is the file wasn't found as specified.
  • 12.08.96 Made static variables external to this routine as they are shared by RepOneSChain(). sChiTab was being allocated on every call instead of just the first one.
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.02.15 Modified for new blRenumAtomsPDB() which takes an offset

Definition at line 193 of file rsc.c.

void blRotatePDB ( PDB pdb,
REAL  matrix[3][3] 
)
Parameters
[in,out]*pdbPDB linked list to rotate
[in]matrixRotation matrix

Rotates a PDB linked list using ApplyMatrixPDB() which ignores coordinates of 9999.0. The structure is moved to the origin, the matrix is applied and the structure is moved back.

  • 30.09.92 Original
  • 01.10.92 Added check on NULL coordinates
  • 22.07.93 Moves to origin first; calls ApplyMatrixPDB() to do the work
  • 07.07.14 Renamed to blRotatePDB(). Use bl prefix for functions. By: CTP

Definition at line 101 of file RotPDB.c.

PDB* blSelectAtomsPDBAsCopy ( PDB pdbin,
int  nsel,
char **  sel,
int *  natom 
)
Parameters
[in]*pdbinInput list
[in]nselNumber of atom types to keep
[in]**selList of atom types to keep
[out]*natomNumber of atoms kept
Returns
Output list

Take a PDB linked list and returns a list containing only those atom types specified in the sel array.

To set up the list of atoms to keep, define an array of pointers to char: e.g. char *sel[10] Then define the atoms in the list thus:

        SELECT(sel[0],"N   ");
        SELECT(sel[1],"CA  ");
        SELECT(sel[2],"C   ");
        SELECT(sel[3],"O   ");

Ensure the spaces are used!!

N.B. The routine is non-destructive; i.e. the original PDB linked list is intact after the selection process

  • 01.03.90 Original By: ACRM
  • 28.03.90 Modified to match new version of pdb.h
  • 24.05.90 Fixed so the variables passed in as sel[] don't have* to be 4 chars.
  • 17.05.93 Modified for book. Returns BOOL.
  • 09.07.93 Modified to return PDB pointer. Changed allocation scheme. Changed back to sel[] variables must be 4 chars.
  • 04.02.09 Initialize q for fussy compliers
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Renamed function to blSelectAtomsPDBAsCopy(). By: CTP

Definition at line 173 of file SelAtPDB.c.

PDB* blSelectCaPDB ( PDB pdb)
Parameters
[in]*pdbA PDB linked list
[out]*The linked list reduced to CA atoms only

Reduce a PDB linked list to CA atoms only. Returns the reduced PDB linked list. Note that the input linked list is modified (storage for non-CA atoms is freed) and that the pointer input to the routine is likely to become invalid since the first atom is generally no a CA and the first record will therefore be freed.

Normally you would call this routine with something like:

pdb = SelectCaPDB(pdb);

i.e. the same variable name is used for the input and the return.

This is used in place of the normal SelectAtomsPDB() since it is simpler and faster to call for this rather common requirement.

N.B. Unlike SelectAtomsPDB(), the routine is destructive; i.e. the original PDB linked list is NOT intact after the selection process.

  • 15.10.96 Original By: ACRM
  • 11.01.02 Added check on pdb!=NULL in case there are no CAs (DNA etc)
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 124 of file SelectCaPDB.c.

void blSetChi ( PDB pdb,
PDB next,
REAL  chi,
int  type 
)
Parameters
[in,out]*pdbPDB linked list to change
[in]*nextIf NULL, move all atoms in the linked list from the last atom in the torsion. Otherwise move atoms up to (but not including) next. Normally this would be the start of the next residue.
[in]chiSidechain chi angle to set
[in]typeTorsion angle to set (as defined below)

Sets a sidechain torsion angle in a pdb linked list. The routine assumes standard atom ordering: N,CA,C,O,s/c with standard order in the s/c.

The type input parameter is defined as follows:

     type     Atom names        Sequential atom numbers
     --------------------------------------------------
     0        N,  CA, CB, XG    (0 - 1 - 4 - 5)
     1        CA, CB, XG, XD    (1 - 4 - 5 - 6)
     2        CB, XG, XD, XE    (4 - 5 - 6 - 7)
     3        XG, XD, XE, XZ    (5 - 6 - 7 - 8)
  • 13.05.92 Original
  • 27.02.98 Removed unreachable break from switch()
  • 07.07.14 Use bl prefix for functions By: CTP
  • 26.08.14 Removed unused 'one' variable

Definition at line 119 of file SetChi.c.

void blSetElementSymbolFromAtomName ( char *  element,
char *  atom_name 
)
Parameters
[out]*elementElement symbol
[in]*atom_nameAtom name

Set the element symbol (columns 77-78 of a pdb file) based on the atom name (columns 13-16 of a pdb file).

The atom name is stored in the PDB data stucture as atnam_raw.

  • 17.07.14 Original. By: CTP

Definition at line 1433 of file WritePDB.c.

STRINGLIST* blSetPDBAtomTypes ( PDB pdb)
Parameters
[in,out]*pdbPDB linked list
Returns
STRINGLIST of any warning messages NULL if all OK
  • 21.07.15 Original By: ACRM

Definition at line 95 of file atomtype.c.

void blSetResnam ( PDB ResStart,
PDB NextRes,
char *  resnam,
int  resnum,
char *  insert,
char *  chain 
)
Parameters
[in,out]*ResStartPointer to start of residue (linked list)
[in]*NextResPointer to start of next residue
[in]*resnamResidue name to set
[in]resnumResidue number to set
[in]*insertInsert label to set
[in]*chainChain label to set

Change the residue name, number, insert and chain for an amino acid.

  • 12.05.92 Original
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 101 of file SetResnam.c.

PDB* blShuffleBB ( PDB pdb)
Parameters
[in]*pdbInput PDB linked list
Returns
Start of shuffled PDB linked list

Shuffles the PDB list to match the standard of N,CA,C,O,CB,other. Basically designed to be used with backbones only since the sidechain order is not modified. Returns the start of the shuffled PDB linked list.

  • 13.05.92 Original
  • 22.06.08 Fixed to use FindNextResidue(). It was continuing to search out of the current residue, so if the same residue number in a different chain was of the same type, it ended up changing that instead!
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 389 of file OrderPDB.c.

PDB* blShuffleResPDB ( PDB start,
PDB end,
BOOL  Pad 
)
Parameters
[in]*startStart of residue to be shuffled
[in]*endStart of next residue in linked list (NULL for last residue)
[in]PadTRUE: Create dummy records for missing atoms
Returns
Pointer to new start of linked list

Shuffle atoms within a residue into the standard order. Returns a pointer to the new first atom in the residue. Atoms not in the known list are discarded. If we fail to allocate memory for extra atom records, no action is taken.

  • 08.07.93 Original By: ACRM
  • 09.03.94 Correctly handles residues not found in the standard list (i.e. returns them unmodified)
  • 17.03.94 If no atoms are found, then we return start. This is the case when partial occupancy atoms are named as "N A", "N B", etc.
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 228 of file OrderPDB.c.

PDB* blStripGlyCB ( PDB pdb)
Parameters
[in,out]*pdbThe PDB linked list
Returns
The modified linked list

Removes all Glycine CB pseudo-atoms added by AddGlyCB() The linked list is modified in-place, but the return value should be used in case the very first item in the linked list is a Gly-CB which will be removed by the code.

  • 04.01.06 Original By: ACRM
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 271 of file GlyCB.c.

PDB* blStripHPDBAsCopy ( PDB pdbin,
int *  natom 
)
Parameters
[in]*pdbinInput list
[out]*natomNumber of atoms kept
Returns
Output list

Take a PDB linked list and returns the PDB list minus hydrogens

N.B. The routine is non-destructive; i.e. the original PDB linked list is intact after the selection process

  • 01.11.94 Original based on SelAtomsPDB() By: ACRM
  • 26.07.95 Removed unused variables
  • 07.07.14 Use bl prefix for functions By: CTP
  • 19.08.14 Renamed function to blStripHPDBAsCopy() By: CTP
  • 19.04.15 Added call to blCopyConect() By: ACRM

Definition at line 115 of file StripHPDB.c.

PDB* blStripWatersPDBAsCopy ( PDB pdbin,
int *  natom 
)
Parameters
[in]*pdbinInput list
[out]*natomNumber of atoms kept
Returns
Output list

Take a PDB linked list and returns the PDB list minus waters

  • 30.04.08 Original based on StripHPDB() By: ACRM
  • 19.08.14 Renamed function to blStripWatersPDBAsCopy() By: CTP
  • 12.04.15 Added rebuild of CONECT data

Definition at line 99 of file StripWatersPDB.c.

PDB* blTermPDB ( PDB pdb,
int  length 
)
Parameters
[in]*pdbPDB linked list
[in]lengthNumber of residues after which to terminate
Returns
Pointer to next residue after terminated list. NULL if not enough residues in linked list.

Terminate a PDB linked list after length residues, returning a pointer to the next residue.

Note that the number of residues may cross chain boundaries.

  • 06.07.95 Original By: ACRM
  • 26.09.95 Corrected update of resnum etc to use p-> not pdb-> (!!)
  • 04.02.14 Use CHAINMATCH macro. By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 112 of file TermPDB.c.

void blTranslatePDB ( PDB pdb,
VEC3F  tvect 
)
Parameters
[in,out]*pdbPDB linked list to move
[in]tvectTranslation vector

Translates a PDB linked list, ignoring null (9999.0) coordinates.

  • 01.10.92 Original
  • 11.03.94 Changed check on 9999.0 to >9998.0 and cast to REAL
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 95 of file TranslatePDB.c.

void blWriteCrystPDB ( FILE *  fp,
VEC3F  UnitCell,
VEC3F  CellAngles,
char *  spacegroup,
REAL  OrigMatrix[3][4],
REAL  ScaleMatrix[3][4] 
)
Parameters
[in]*fpOutput file pointet
[in]UnitCellThe unit cell dimensions
[in]CellAnglesThe unit cell angles
[in]*spacegroupThe crystal's space group
[in]OrigMatrixThe origin matrix
[in]ScaleMatrixThe scale matrix

Write crystal parameters (unit cell, space group, origin and scale matrices) to a PDB file.

  • 12.10.95 Original By: ACRM
  • 17.10.95 Corrected lf to f in fprintf()s
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 102 of file WriteCrystPDB.c.

void blWriteGromosPDB ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list to write

Write a PDB linked list by calls to WritePDBRecord()

  • 08.03.89 Original
  • 01.06.92 ANSIed and autodoc'd
  • 10.06.93 Uses NEXT macro; void type
  • 08.07.93 Added insertion of TER cards
  • 22.02.94 And a TER card at the end of the file
  • 15.02.01 This is the old WritePDB()
  • 04.02.14 Use CHAINMATCH macro. By: CTP
  • 07.07.14 Use bl prefix for functions By: CTP
  • 23.02.15 Proper TER card support By: ACRM
  • 24.02.15 Now just uses blWritePDBAsPDBorGromos()

Definition at line 1491 of file WritePDB.c.

void blWriteGromosPDBRecord ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list record to write

Write a PDB record

  • 08.03.89 Original
  • 28.03.90 Changed to match ReadPDB() V1.2 for column widths
  • 01.06.92 ANSIed and autodoc'd
  • 10.06.93 void type
  • 22.06.93 Changed to lf. Ljust strings
  • 11.03.94 lf back to f (!)
  • 12.02.01 This is the old WritePDBRecord()
  • 07.07.14 Use bl prefix for functions By: CTP

Definition at line 1517 of file WritePDB.c.

int blWritePDB ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list to write
Returns
int Number of TER cards written (0 indicates error)

Write a PDB linked list...

  • 21.06.14 Original By: CTP
  • 18.08.14 Added XML_SUPPORT option. Return error if attempting to write PDBML format. By: CTP
  • 23.02.15 Now returns an int
  • 24.02.15 Changed to call blWritePDBAsPDBorGromos() and blWritePDBAsPDBML()

Definition at line 223 of file WritePDB.c.

BOOL blWritePDBAsPDBML ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list to write
Returns
Success

Write a PDB linked list in PDBML format.

  • 02.06.14 Original. By: CTP
  • 21.06.14 Renamed blWriteAsPDBML() and updated symbol handling. By: CTP
  • 17.07.14 Use blSetElementSymbolFromAtomName() By: CTP
  • 16.08.14 Use element and charge data. By: CTP
  • 17.02.15 Added segid support By: ACRM
  • 24.02.15 Changed name to blWritePDBAsPDBML()
  • 25.02.15 Changed to type BOOL and checks all memory allocations
  • 29.04.15 Updated to write CONECT records. By: CTP
  • 11.05.15 Made function into wrapper for blDoWritePDBAsPDBML(). By: CTP
  • 10.07.15 Added return value for no XML_SUPPORT By: ACRM

Definition at line 525 of file WritePDB.c.

int blWritePDBAsPDBorGromos ( FILE *  fp,
PDB pdb,
BOOL  doGromos 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list to write
Returns
Number of TER cards written (0=error)

Write a PDB linked list by calls to WritePDBRecord()

  • 08.03.89 Original
  • 01.06.92 ANSIed and autodoc'd
  • 10.06.93 Uses NEXT macro; void type
  • 08.07.93 Added insertion of TER cards
  • 22.02.94 And a TER card at the end of the file
  • 04.02.14 Use CHAINMATCH macro. By: CTP
  • 17.06.14 Renamed to blWriteAsPDB() By: CTP
  • 07.07.14 Use blWritePDBRecord() By: CTP
  • 23.02.15 Write correct format TER cards. Now returns int By: ACRM
  • 24.02.15 Renamed to blWritePDBAsPDBorGromos() and added doGromos flag

Definition at line 308 of file WritePDB.c.

void blWritePDBRecord ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list record to write

Write a PDB record

  • 08.03.89 Original
  • 28.03.90 Changed to match ReadPDB() V1.2 for column widths
  • 01.06.92 ANSIed and autodoc'd
  • 10.06.93 void type
  • 22.06.93 Changed to lf. Ljust strings
  • 11.03.94 lf back to f (!)
  • 15.02.01 Modified to use atnam_raw
  • 03.06.05 Modified to use altpos
  • 07.07.14 Renamed to blWritePDBRecord() By: CTP
  • 16.08.14 Write element and formal charge. By: CTP
  • 17.02.15 Added segid support By: ACRM

Definition at line 415 of file WritePDB.c.

void blWritePDBRecordAtnam ( FILE *  fp,
PDB pdb 
)
Parameters
[in]*fpPDB file pointer to be written
[in]*pdbPDB linked list record to write

Write a PDB record using the data in atnam rather than atnam_raw

  • 08.03.89 Original
  • 28.03.90 Changed to match ReadPDB() V1.2 for column widths
  • 01.06.92 ANSIed and autodoc'd
  • 10.06.93 void type
  • 22.06.93 Changed to lf. Ljust strings
  • 11.03.94 lf back to f (!)
  • 15.02.01 Modified to use atnam_raw
  • 03.06.05 Modified to use altpos
  • 22.09.05 This is like the old version which used atnam rather than atnam_raw
  • 07.07.14 Renamed to blWritePDBRecordAtnam() By: CTP
  • 17.02.15 Added element, formalcharge and segid support By: ACRM

Definition at line 471 of file WritePDB.c.

void blWriteTerCard ( FILE *  fp,
PDB p 
)
Parameters
[in]*fpFile pointer
[in]*pPDB record pointer

Prints a TER card in the new PDB format - i.e. with the residue information for the previous ATOM/HETATM, rather than just printing TER

  • 23.02.15 Original By: ACRM
  • 02.03.15 Added space padding

Definition at line 382 of file WritePDB.c.

BOOL blWriteWholePDB ( FILE *  fp,
WHOLEPDB wpdb 
)
Parameters
[in]*fpFile pointer
[in]*wpdbWhole PDB structure pointer

Writes a PDB file including header and trailer information. Output in PDBML-format if flags set.

  • 21.06.14 Original By: CTP
  • 18.08.14 Added XML_SUPPORT option. Return error if attempting to write PDBML format. By: CTP
  • 12.02.15 Now a wrapper to blDoWriteWhilePDB()
  • 24.02.15 blWriteAsPDBML() changed to blWritePDBAsPDBML() blWriteAsPDB() changed to blWritePDBAsPDBorGromos()
  • 25.02.15 No longer a wrapper
  • 04.03.15 Added check on wpdb and wpdb->pdb being non-NULL
  • 11.05.15 Updated to use blDoWritePDBAsPDBML(). By: CTP

Definition at line 1557 of file WritePDB.c.

void blWriteWholePDBHeader ( FILE *  fp,
WHOLEPDB wpdb 
)
Parameters
[in]*fpFile pointer
[in]*wpdbWhole PDB structure pointer

Writes the header of a PDB file

  • 30.05.02 Original By: ACRM
  • 21.06.14 Renamed to blWriteWholePDBHeader() By: CTP
  • 12.02.15 Added XML check By: ACRM
  • 06.08.15 Updated XML check. By: CTP

Definition at line 1608 of file WritePDB.c.

void blWriteWholePDBHeaderNoRes ( FILE *  fp,
WHOLEPDB wpdb 
)
Parameters
[in]*fpFile pointer
[in]*wpdbWhole PDB structure pointer

Writes the header of a PDB file, but skips any records that include residue numbers for cases where these may have changed.

Skips: REMARK 500 DBREF HELIX SHEET SSBOND CISPEP SEQADV MODRES HET SITE REMARK 465 REMARK 470 REMARK 475 REMARK 480 REMARK 525 REMARK 610 REMARK 615 REMARK 620 REMARK 630 REMARK 3

  • 02.03.15 Original By: ACRM
  • 09.03.15 Additionally skips SEQADV, MODRES, HET, SITE
  • 10.03.15 Additionally skips REMARK 3,465,470,475,480,525,610,615,620,630
  • 06.08.15 Updated XML check. By: CTP

Definition at line 1809 of file WritePDB.c.

BOOL blWriteWholePDBNoConect ( FILE *  fp,
WHOLEPDB wpdb 
)
void blWriteWholePDBTrailer ( FILE *  fp,
WHOLEPDB wpdb,
int  numTer 
)
Parameters
[in]*fpFile pointer
[in]*wpdbWhole PDB structure pointer
[in]numTerNumber of TER cards

Writes the trailer of a PDB file

  • 30.05.02 Original By: ACRM
  • 21.06.14 Renamed to blWriteWholePDBTrailer() By: CTP
  • 12.02.15 Added XML check By: ACRM
  • 18.02.15 Complete rewrite to use the parsed CONECT data rather than simply rewriting what was read in
  • 23.02.15 Added numTer parameter
  • 02.03.15 Padded END and CONECT
  • 06.08.15 Updated XML check. By: CTP

Definition at line 1643 of file WritePDB.c.

Variable Documentation

BOOL gPDBModelNotFound
int gPDBMultiNMR
BOOL gPDBPartialOcc
BOOL gPDBXML
int gPDBXMLForce
char gRSCError[80]