The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
Functions
ParseRes.c File Reference

Parse a residue specification. More...

#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "macros.h"
#include "SysDefs.h"
#include "pdb.h"

Go to the source code of this file.

Functions

BOOL blParseResSpec (char *spec, char *chain, int *resnum, char *insert)
 
BOOL blDoParseResSpec (char *inSpec, char *chain, int *resnum, char *insert, BOOL uppercaseresspec)
 
void blPrintResSpecHelp (FILE *fp)
 
void blBuildResSpec (PDB *p, char *resspec)
 

Detailed Description

Parse a residue specification.

Version
V1.15
Date
11.08.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:

Revision History:

Definition in file ParseRes.c.

Function Documentation

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.

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.

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.