Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
TrueSeqLen.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file TrueSeqLen.c
5 
6  \version V1.11
7  \date 07.07.14
8 
9  \copyright (c) UCL / Dr. Andrew C. R. Martin 1993-2014
10  \author Dr. Andrew C. R. Martin
11  \par
12  Institute of Structural & Molecular Biology,
13  University College London,
14  Gower Street,
15  London.
16  WC1E 6BT.
17  \par
18  andrew@bioinf.org.uk
19  andrew.martin@ucl.ac.uk
20 
21 **************************************************************************
22 
23  This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
24  according to the conditions laid out in the accompanying file
25  COPYING.DOC.
26 
27  The code may be modified as required, but any modifications must be
28  documented so that the person responsible can be identified.
29 
30  The code may not be sold commercially or included as part of a
31  commercial product except as described in the file COPYING.DOC.
32 
33 **************************************************************************
34 
35  Description:
36  ============
37 
38 
39 **************************************************************************
40 
41  Usage:
42  ======
43 
44 **************************************************************************
45 
46  Revision History:
47  =================
48 - V1.0 29.09.92 Original
49 - V1.1 07.06.93 Corrected allocation
50 - V1.2 18.06.93 Handles multi-chains and skips NTER and CTER residues.
51  Added SplitSeq()
52 - V1.3 09.07.93 SplitSeq() cleans up properly if allocation failed
53 - V1.4 11.05.94 Added TrueSeqLen()
54 - V1.5 13.05.94 Fixed bug in PDB2Seq().
55  Added KnownSeqLen().
56 - V1.6 07.09.94 Fixed allocation bug in SplitSeq()
57 - V1.7 19.07.95 Added check for ATOM records
58 - V1.8 24.01.96 Fixed bug when no ATOM records in linked list
59  Returns a blank string
60 - V1.9 26.08.97 Renamed DoPDB2Seq() with handling of Asx/Glx and
61  protein-only. Added macros to recreate the
62  old PDB2Seq() interface and similar new calls
63 - V1.10 02.10.00 Added NoX option
64 - V1.11 07.07.14 Use bl prefix for functions By: CTP
65 
66 *************************************************************************/
67 /* Doxygen
68  -------
69  #GROUP Handling Sequence Data
70  #SUBGROUP Obtaining information
71  #FUNCTION blTrueSeqLen()
72  Scans a 1-letter code sequence and calculate the length without
73  `-' or ` ' residues
74 */
75 /************************************************************************/
76 /* Includes
77 */
78 
79 /************************************************************************/
80 /* Defines and macros
81 */
82 
83 /************************************************************************/
84 /* Globals
85 */
86 
87 /************************************************************************/
88 /* Prototypes
89 */
90 
91 /************************************************************************/
92 /*>int blTrueSeqLen(char *sequence)
93  --------------------------------
94 *//**
95 
96  \param[in] *sequence A sequence containing deletions
97  \return Length without deletions
98 
99  Scans a 1-letter code sequence and calculate the length without
100  `-' or ` ' residues
101 
102 - 14.04.94 Original By: ACRM
103 - 07.07.14 Use bl prefix for functions By: CTP
104 
105 */
106 int blTrueSeqLen(char *sequence)
107 {
108  int length = 0,
109  i = 0;
110 
111  for(i=0; sequence[i]; i++)
112  {
113  if(sequence[i] != '-' && sequence[i] != ' ')
114  length++;
115  }
116 
117  return(length);
118 }
119 
int length
Definition: safemem.c:117
int blTrueSeqLen(char *sequence)
Definition: TrueSeqLen.c:106