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

Get misc header info from PDB header. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "pdb.h"
#include "seq.h"
#include "macros.h"
#include "fsscanf.h"
#include "general.h"
#include "hash.h"

Go to the source code of this file.

Macros

#define MAXWORD   8
 
#define MAXBUFF   160
 
#define ALLOCSIZE   80
 
#define CLEAR_BIOMOL(b)
 

Functions

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)
 
MODRESblGetModresWholePDB (WHOLEPDB *wpdb)
 
void blFindOriginalResType (char *modAA, char *stdAA, MODRES *modres)
 
BIOMOLECULEblGetBiomoleculeWholePDB (WHOLEPDB *wpdb)
 
void blFreeBiomolecule (BIOMOLECULE *biomolecule)
 
HASHTABLEblGetSeqresByChainWholePDB (WHOLEPDB *wpdb, MODRES *modres, BOOL doNucleic)
 

Detailed Description

Get misc header info from PDB header.

Version
V1.8
Date
03.10.16
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:

See documentation for details

Revision History:

Definition in file PDBHeaderInfo.c.

Macro Definition Documentation

#define ALLOCSIZE   80

Definition at line 137 of file PDBHeaderInfo.c.

#define CLEAR_BIOMOL (   b)
Value:
do{ \
(b)->details = NULL; \
(b)->numBiomolecules = 0; \
(b)->biomolNumber = 0; \
(b)->authorUnit[0] = '\0'; \
(b)->softwareUnit[0] = '\0'; \
(b)->chains = NULL; \
(b)->biomt = NULL; \
} while(0)
#define NULL
Definition: array2.c:99

Definition at line 139 of file PDBHeaderInfo.c.

#define MAXBUFF   160

Definition at line 136 of file PDBHeaderInfo.c.

#define MAXWORD   8

Definition at line 135 of file PDBHeaderInfo.c.

Function Documentation

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.

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.

void blFreeBiomolecule ( BIOMOLECULE biomolecule)

Definition at line 1252 of file PDBHeaderInfo.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.

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.

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.

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.