Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
KnownSeqLen.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file KnownSeqLen.c
5 
6  \version V1.11
7  \date 07.07.14
8  \brief
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 29.09.92 Original
50 - V1.1 07.06.93 Corrected allocation
51 - V1.2 18.06.93 Handles multi-chains and skips NTER and CTER residues.
52  Added SplitSeq()
53 - V1.3 09.07.93 SplitSeq() cleans up properly if allocation failed
54 - V1.4 11.05.94 Added TrueSeqLen()
55 - V1.5 13.05.94 Fixed bug in PDB2Seq().
56  Added KnownSeqLen().
57 - V1.6 07.09.94 Fixed allocation bug in SplitSeq()
58 - V1.7 19.07.95 Added check for ATOM records
59 - V1.8 24.01.96 Fixed bug when no ATOM records in linked list
60  Returns a blank string
61 - V1.9 26.08.97 Renamed DoPDB2Seq() with handling of Asx/Glx and
62  protein-only. Added macros to recreate the
63  old PDB2Seq() interface and similar new calls
64 - V1.10 02.10.00 Added NoX option
65 - V1.11 07.07.14 Use bl prefix for functions By: CTP
66 
67 *************************************************************************/
68 /* Doxygen
69  -------
70  #GROUP Handling Sequence Data
71  #SUBGROUP Obtaining information
72  #FUNCTION blKnownSeqLen()
73  Scans a 1-letter code sequence and calculate the length without
74  `-', ` ' or '?' residues
75 */
76 /************************************************************************/
77 /* Includes
78 */
79 
80 /************************************************************************/
81 /* Defines and macros
82 */
83 
84 /************************************************************************/
85 /* Globals
86 */
87 
88 /************************************************************************/
89 /* Prototypes
90 */
91 
92 
93 /************************************************************************/
94 /*>int blKnownSeqLen(char *sequence)
95  ---------------------------------
96 *//**
97 
98  \param[in] *sequence A sequence containing deletions
99  \return Length without deletions
100 
101  Scans a 1-letter code sequence and calculate the length without
102  `-', ` ' or '?' residues
103 
104 - 13.05.94 Original By: ACRM
105 - 07.07.14 Use bl prefix for functions By: CTP
106 */
107 int blKnownSeqLen(char *sequence)
108 {
109  int length = 0,
110  i = 0;
111 
112  for(i=0; sequence[i]; i++)
113  {
114  if(sequence[i] != '-' && sequence[i] != ' ' && sequence[i] != '?')
115  length++;
116  }
117 
118  return(length);
119 }
120 
int blKnownSeqLen(char *sequence)
Definition: KnownSeqLen.c:107