Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
FindHetatmResidueSpec.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file FindHetatmResidueSpec.c
5 
6  \version V1.3
7  \date 07.07.14
8  \brief Parse a residue specification
9 
10  \copyright (c) 2011-2014
11  \author Dr. Andrew C. R. Martin
12  \par
13  Institute of Structural & Molecular Biology,
14  University College London,
15  Gower Street,
16  London.
17  WC1E 6BT.
18  \par
19  andrew@bioinf.org.uk
20  andrew.martin@ucl.ac.uk
21 
22 **************************************************************************
23 
24  This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
25  according to the conditions laid out in the accompanying file
26  COPYING.DOC.
27 
28  The code may be modified as required, but any modifications must be
29  documented so that the person responsible can be identified.
30 
31  The code may not be sold commercially or included as part of a
32  commercial product except as described in the file COPYING.DOC.
33 
34 **************************************************************************
35 
36  Description:
37  ============
38 
39 
40 **************************************************************************
41 
42  Usage:
43  ======
44 
45 **************************************************************************
46 
47  Revision History:
48  =================
49 - V1.0 26.10.11 Original based on FindResidueSpec.c
50 - V1.1 28.08.13 Mofified for new ParseResSpec that terminates strings
51 - V1.2 24.02.14 Now calls BiopFindResidue(). By: CTP
52 - V1.3 07.07.14 Use bl prefix for functions By: CTP
53 
54 *************************************************************************/
55 /* Doxygen
56  -------
57  #GROUP Handling PDB Data
58  #SUBGROUP Searching the PDB linked list
59  #FUNCTION blFindHetatmResidueSpec()
60  Search a PDB linked list for a specified residue (given as
61  [chain[.]]num[[.]insert]) but limits search to HETATM residues
62 */
63 /************************************************************************/
64 /* Includes
65 */
66 #include <ctype.h>
67 #include <stdio.h>
68 #include <string.h>
69 
70 #include "pdb.h"
71 #include "SysDefs.h"
72 #include "MathType.h"
73 #include "macros.h"
74 
75 
76 /************************************************************************/
77 /* Defines and macros
78 */
79 
80 /************************************************************************/
81 /* Globals
82 */
83 
84 /************************************************************************/
85 /* Prototypes
86 */
87 /************************************************************************/
88 /*>PDB *blFindHetatmResidueSpec(PDB *pdb, char *resspec)
89  -----------------------------------------------------
90 *//**
91 
92  \param[in] *pdb PDB linked list
93  \param[in] *resspec Residue specification
94  \return Pointer to first atom of specified residue
95  (NULL if not found).
96 
97  Search a PDB linked list for a specified residue (given as
98  [chain]num[insert]) but limits search to HETATM residues
99 
100 - 26.10.11 Original By: ACRM
101 - 28.08.13 Mofified for new ParseResSpec that terminates strings
102 - 24.02.14 Now calls BiopFindResidue(). By: CTP
103 - 07.07.14 Use bl prefix for functions By: CTP
104 */
105 PDB *blFindHetatmResidueSpec(PDB *pdb, char *resspec)
106 {
107  char chain[8],
108  insert[8];
109  int resnum;
110 
111  if(blParseResSpec(resspec, chain, &resnum, insert))
112  return(blFindHetatmResidue(pdb, chain, resnum, insert));
113 
114  return(NULL);
115 }
116 
Include file for PDB routines.
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
Useful macros.
PDB * blFindHetatmResidue(PDB *pdb, char *chain, int resnum, char *insert)
System-type variable type definitions.
PDB * blFindHetatmResidueSpec(PDB *pdb, char *resspec)
Type definitions for maths.
BOOL blParseResSpec(char *spec, char *chain, int *resnum, char *insert)
Definition: ParseRes.c:158