Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
seq.h
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file seq.h
5 
6  \version V2.16
7  \date 30.11.15
8  \brief Header file for sequence handling
9 
10  \copyright (c) UCL / Dr. Andrew C. R. Martin 1991-2015
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 - V2.0 11.03.94 Original V2 release
50 - V2.1 11.05.94 Added DNAtoAA() & TrueSeqLen() prototypes
51 - V2.2 13.05.93 Added KnownSeqLen() prototype
52 - V2.3 28.02.95 Added ReadRawPIR()
53 - V2.4 25.07.95 Added the gBioplibSeqNucleicAcid external for throne()
54 - V2.5 11.07.96 Added CalcMDMScore()
55 - V2.6 17.09.95 Added ZeroMDM()
56 - V2.7 26.08.97 Added macro interfaces to new DoPDB2Seq()
57 - V2.8 08.03.00 Added Numeric***() alignment routines
58 - V2.9 02.10.00 Modified DoPDB2Seq()
59 - V2.10 27.02.07 Added CalcMDMScoreUC() and affinealignuc()
60 - V2.11 07.07.14 Use bl prefix for functions. Renamed PDB2Seq macros to
61  blPDB2Seq and added PDB2Seq defines to deprecated.h
62  By: CTP
63 - V2.12 31.07.14 Updated deprecation: Removed deprecated.h, added
64  prototypes for renamed functions and defines for PDB2Seq
65  macros. By: CTP
66 - V2.13 14.08.14 Moved deprecated function prototypes to deprecated.h
67  By: CTP
68 - V2.14 26.08.14 Added blSetMDMScoreWeight()
69 - V2.15 11.06.15 Added blWriteOneStringPIR()
70 - V2.16 30.11.15 Added wrapper macros for blDoPDB2SeqByChain() and
71  prototype
72 
73 *************************************************************************/
74 #ifndef _SEQ_H
75 #define _SEQ_H
76 
77 #include "MathType.h"
78 #include "SysDefs.h"
79 #include "pdb.h"
80 #include "hash.h"
81 
82 /************************************************************************/
83 /* Defines and macros
84  */
85 #define blMAXPIRLABEL 160
86 #define ALLOCSIZE 80 /* ReadPIR() uses this as a chunk size for
87  allocating memory
88  */
89 
90 typedef struct
91 {
92  BOOL fragment,
93  paren,
94  DotInParen,
95  NonExpJoin,
96  UnknownPos,
97  Incomplete,
98  Truncated,
99  Juxtapose;
100  char code[16],
101  name[160],
102  source[160];
103 } SEQINFO;
104 
106 
107 #define blPDB2Seq(x) blDoPDB2Seq((x), FALSE, FALSE, FALSE)
108 #define blPDB2SeqX(x) blDoPDB2Seq((x), TRUE, FALSE, FALSE)
109 #define blPDB2SeqNoX(x) blDoPDB2Seq((x), FALSE, FALSE, TRUE)
110 #define blPDB2SeqXNoX(x) blDoPDB2Seq((x), TRUE, FALSE, TRUE)
111 
112 #define blPDBProt2Seq(x) blDoPDB2Seq((x), FALSE, TRUE, FALSE)
113 #define blPDBProt2SeqX(x) blDoPDB2Seq((x), TRUE, TRUE, FALSE)
114 #define blPDBProt2SeqNoX(x) blDoPDB2Seq((x), FALSE, TRUE, TRUE)
115 #define blPDBProt2SeqXNoX(x) blDoPDB2Seq((x), TRUE, TRUE, TRUE)
116 
117 #define blPDB2SeqByChain(x) blDoPDB2SeqByChain((x), FALSE, FALSE, FALSE)
118 #define blPDB2SeqXByChain(x) blDoPDB2SeqByChain((x), TRUE, FALSE, FALSE)
119 #define blPDB2SeqNoXByChain(x) blDoPDB2SeqByChain((x), FALSE, FALSE, TRUE)
120 #define blPDB2SeqXNoXByChain(x) blDoPDB2SeqByChain((x), TRUE, FALSE, TRUE)
121 
122 #define blPDBProt2SeqByChain(x) blDoPDB2SeqByChain((x), FALSE, TRUE, FALSE)
123 #define blPDBProt2SeqXByChain(x) blDoPDB2SeqByChain((x), TRUE, TRUE, FALSE)
124 #define blPDBProt2SeqNoXByChain(x) blDoPDB2SeqByChain((x), FALSE, TRUE, TRUE)
125 #define blPDBProt2SeqXNoXByChain(x) blDoPDB2SeqByChain((x), TRUE, TRUE, TRUE)
126 
127 char blThrone(char *three);
128 char blThronex(char *three);
129 char *blOnethr(char one);
130 char *blDoPDB2Seq(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX);
131 HASHTABLE *blDoPDB2SeqByChain(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX);
132 int blSplitSeq(char *LinearSeq, char **seqs);
133 int blReadSimplePIR(FILE *fp, int maxres, char **seqs);
134 int blReadPIR(FILE *fp, BOOL DoInsert, char **seqs, int maxchain,
135  SEQINFO *seqinfo, BOOL *punct, BOOL *error);
136 int blReadRawPIR(FILE *fp, char **seqs, int maxchain, BOOL upcase,
137  SEQINFO *seqinfo, BOOL *error);
138 int blAlign(char *seq1, int length1, char *seq2, int length2,
139  BOOL verbose, BOOL identity, int penalty,
140  char *align1, char *align2, int *align_len);
141 int blAffinealign(char *seq1, int length1, char *seq2, int length2,
142  BOOL verbose, BOOL identity, int penalty, int penext,
143  char *align1, char *align2, int *align_len);
144 int blCalcMDMScore(char resa, char resb);
145 int blAffinealignuc(char *seq1, int length1, char *seq2, int length2,
146  BOOL verbose, BOOL identity, int penalty, int penext,
147  char *align1, char *align2, int *align_len);
148 int blCalcMDMScoreUC(char resa, char resb);
149 BOOL blReadMDM(char *mdmfile);
150 int blZeroMDM(void);
151 char blDNAtoAA(char *dna);
152 int blTrueSeqLen(char *sequence);
153 int blKnownSeqLen(char *sequence);
154 BOOL blNumericReadMDM(char *mdmfile);
155 int blNumericCalcMDMScore(int resa, int resb);
156 int blNumericAffineAlign(int *seq1, int length1, int *seq2, int length2,
157  BOOL verbose, BOOL identity, int penalty,
158  int penext, int *align1, int *align2,
159  int *align_len);
160 void blSetMDMScoreWeight(char resa, char resb, REAL weight);
161 void blWriteOneStringPIR(FILE *out, char *label, char *title,
162  char *sequence,
163  char **chains, BOOL ByChain, BOOL doFasta);
164 
165 
166 /************************************************************************/
167 /* Include deprecated functions */
168 #define _SEQ_H_DEPRECATED
169 #include "deprecated.h"
170 /************************************************************************/
171 
172 
173 #endif
void blSetMDMScoreWeight(char resa, char resb, REAL weight)
Definition: align.c:1408
Include file for PDB routines.
char blThronex(char *three)
Definition: throne.c:188
short BOOL
Definition: SysDefs.h:64
BOOL UnknownPos
Definition: seq.h:92
BOOL blReadMDM(char *mdmfile)
Definition: align.c:871
Definition: pdb.h:298
Redirect calls to deprecated functions.
char * blOnethr(char one)
Definition: throne.c:223
Defines for using hash functions.
BOOL gBioplibSeqNucleicAcid
Definition: throne.c:130
int blCalcMDMScore(char resa, char resb)
Definition: align.c:1220
char blDNAtoAA(char *dna)
Definition: DNAtoAA.c:110
int blAffinealignuc(char *seq1, int length1, char *seq2, int length2, BOOL verbose, BOOL identity, int penalty, int penext, char *align1, char *align2, int *align_len)
Definition: align.c:583
Definition: seq.h:90
int blReadPIR(FILE *fp, BOOL DoInsert, char **seqs, int maxchain, SEQINFO *seqinfo, BOOL *punct, BOOL *error)
Definition: ReadPIR.c:180
int blAffinealign(char *seq1, int length1, char *seq2, int length2, BOOL verbose, BOOL identity, int penalty, int penext, char *align1, char *align2, int *align_len)
Definition: align.c:275
double REAL
Definition: MathType.h:67
HASHTABLE * blDoPDB2SeqByChain(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX)
Definition: PDB2Seq.c:294
void blWriteOneStringPIR(FILE *out, char *label, char *title, char *sequence, char **chains, BOOL ByChain, BOOL doFasta)
Definition: WritePIR.c:116
Definition: hash.h:85
int blReadSimplePIR(FILE *fp, int maxres, char **seqs)
int blNumericCalcMDMScore(int resa, int resb)
Definition: NumericAlign.c:342
int blNumericAffineAlign(int *seq1, int length1, int *seq2, int length2, BOOL verbose, BOOL identity, int penalty, int penext, int *align1, int *align2, int *align_len)
Definition: NumericAlign.c:412
int blZeroMDM(void)
Definition: align.c:1358
int blAlign(char *seq1, int length1, char *seq2, int length2, BOOL verbose, BOOL identity, int penalty, char *align1, char *align2, int *align_len)
Definition: align.c:214
int blReadRawPIR(FILE *fp, char **seqs, int maxchain, BOOL upcase, SEQINFO *seqinfo, BOOL *error)
Definition: ReadRawPIR.c:169
char blThrone(char *three)
Definition: throne.c:153
int blSplitSeq(char *LinearSeq, char **seqs)
Definition: SplitSeq.c:115
int blTrueSeqLen(char *sequence)
Definition: TrueSeqLen.c:106
System-type variable type definitions.
int blKnownSeqLen(char *sequence)
Definition: KnownSeqLen.c:107
int blCalcMDMScoreUC(char resa, char resb)
Definition: align.c:1293
Type definitions for maths.
BOOL blNumericReadMDM(char *mdmfile)
Definition: NumericAlign.c:258
char * blDoPDB2Seq(PDB *pdb, BOOL DoAsxGlx, BOOL ProtOnly, BOOL NoX)
Definition: PDB2Seq.c:146