Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
FindResidueSpec.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file FindResidueSpec.c
5 
6  \version V1.10
7  \date 07.07.14
8  \brief Parse a residue specification
9 
10  \copyright (c) UCL / Dr. Andrew C. R. Martin 1993-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 01.03.94 Original
50 - V1.1 07.07.95 Now non-destructive
51 - V1.2 17.07.95 Now checks that a number was specified as part of the
52  spec. and returns a BOOL
53 - V1.3 23.10.95 Moved FindResidueSpec() from PDBList.c
54 - V1.4 08.02.96 Added FindResidue() and changed FindResidueSpec() to
55  use it
56 - V1.5 23.07.96 Added AtomNameMatch() and LegalAtomSpec()
57 - V1.6 18.03.98 Added option to include a . to separate chain and
58  residue number so numeric chain names can be used
59 - V1.7 11.10.99 Allow a . to be used to start a number (such that the
60  default blank chain name is used). Allows negative
61  residue numbers
62 - V1.8 15.08.13 FindResidueSpec() modified as chain and insert now need
63  to be arrays
64 - V1.9 24.02.14 Now calls BiopFindResidue() By: CTP
65 - V1.10 07.07.14 Use bl prefix for functions By: CTP
66 
67 *************************************************************************/
68 /* Doxygen
69  -------
70  #GROUP Handling PDB Data
71  #SUBGROUP Searching the PDB linked list
72  #FUNCTION blFindResidueSpec()
73  Search a PDB linked list for a specified residue (given as
74  [chain][.]num[insert])
75 */
76 /************************************************************************/
77 /* Includes
78 */
79 #include <ctype.h>
80 #include <stdio.h>
81 #include <string.h>
82 
83 #include "macros.h"
84 #include "SysDefs.h"
85 #include "pdb.h"
86 
87 /************************************************************************/
88 /* Defines and macros
89 */
90 
91 /************************************************************************/
92 /* Globals
93 */
94 
95 /************************************************************************/
96 /* Prototypes
97 */
98 
99 /************************************************************************/
100 /*>PDB *blFindResidueSpec(PDB *pdb, char *resspec)
101  -----------------------------------------------
102 *//**
103 
104  \param[in] *pdb PDB linked list
105  \param[in] *resspec Residue specification
106  \return Pointer to first atom of specified residue
107  (NULL if not found).
108 
109  Search a PDB linked list for a specified residue (given as
110  [chain][.]num[insert])
111 
112 - 08.08.95 Original By: ACRM
113 - 08.02.96 Now calls FindResidue() to do the actual work
114 - 15.08.13 chain[] and insert[] are now arrays because of changes to
115  ParseResSpec()
116 - 24.02.14 Now calls BiopFindResidue() By: CTP
117 - 07.07.14 Now calls blFindResidue() Use bl prefix for functions By: CTP
118 */
119 PDB *blFindResidueSpec(PDB *pdb, char *resspec)
120 {
121  char chain[8],
122  insert[8];
123  int resnum;
124 
125  if(blParseResSpec(resspec, chain, &resnum, insert))
126  return(blFindResidue(pdb, chain, resnum, insert));
127 
128  return(NULL);
129 }
130 
131 
Include file for PDB routines.
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
Useful macros.
PDB * blFindResidueSpec(PDB *pdb, char *resspec)
PDB * blFindResidue(PDB *pdb, char *chain, int resnum, char *insert)
Definition: FindResidue.c:117
System-type variable type definitions.
BOOL blParseResSpec(char *spec, char *chain, int *resnum, char *insert)
Definition: ParseRes.c:158