File: ajdmx.h

package info (click to toggle)
emboss 6.6.0%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 571,544 kB
  • sloc: ansic: 460,579; java: 29,439; perl: 13,573; sh: 12,754; makefile: 3,283; csh: 706; asm: 351; xml: 239; pascal: 237; modula3: 8
file content (345 lines) | stat: -rw-r--r-- 13,053 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
/* @include ajdmx *************************************************************
**
** AJAX objects for some of the DOMAINATRIX EMBASSY applications.
** Scophit and Scopalg objects.
**
** @author: Copyright (C) 2004 Ranjeeva Ranasinghe (rranasin@hgmp.mrc.ac.uk)
** @author: Copyright (C) 2004 Jon Ison (jison@hgmp.mrc.ac.uk)
** @version $Revision: 1.23 $
** @modified $Date: 2012/04/12 20:36:03 $ by $Author: mks $
** @@
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA  02110-1301,  USA.
**
******************************************************************************/

#ifndef AJDMX_H
#define AJDMX_H

/* ========================================================================= */
/* ============================= include files ============================= */
/* ========================================================================= */

#include "ajdefine.h"
#include "ajstr.h"
#include "ajlist.h"
#include "ajfile.h"
#include "ajpdb.h"
#include "ajdomain.h"

AJ_BEGIN_DECLS




/* ========================================================================= */
/* =============================== constants =============================== */
/* ========================================================================= */




/* ========================================================================= */
/* ============================== public data ============================== */
/* ========================================================================= */




/* @data AjPScophit ***********************************************************
**
** AJAX SCOP Hit object
**
** Holds data associated with a protein / domain sequence. Includes SCOP
** classification records.
**
** AjPScophit is implemented as a pointer to a C data structure.
**
** @alias AjSScophit
** @alias AjOScophit
**
** @attr Class [AjPStr] Class name
** @attr Architecture [AjPStr] CATH classification.
** @attr Topology [AjPStr] CATH classification.
** @attr Fold [AjPStr] Fold name
** @attr Superfamily [AjPStr] Superfamily name
** @attr Family [AjPStr] Family name
** @attr Type [AjEDomainType] AJAX Domain Type enumeration
** @attr Sunid_Family [ajuint] Domain identifier of node (e.g. family or
** superfamily) represented.
** @attr Seq [AjPStr] Sequence as string
** @attr Start [ajuint] Start of sequence or signature alignment
**       relative to full length swissprot sequence
** @attr End [ajuint] End of sequence or signature alignment relative
**       to full length swissprot sequence
** @attr Acc [AjPStr] Accession number of sequence entry
** @attr Spr [AjPStr] Swissprot code of sequence entry
** @attr Dom [AjPStr] SCOP or CATH database identifier code of entry.
** @attr Typeobj [AjPStr] Bibliographic information ... objective
** @attr Typesbj [AjPStr] Bibliographic information ... subjective
** @attr Model [AjPStr] String for model type (HMM, Gribskov etc)
** @attr Group [AjPStr] 'REDUNDANT' or 'NON_REDUNDANT'
** @attr Rank [ajuint] Rank order of hit
** @attr Score [float] Score of hit
** @attr Eval [float] E-value of hit
** @attr Pval [float] p-value of hit
** @attr Alg [AjPStr] Alignment, e.g. of a signature to the sequence
** @attr Target [AjBool] True if the Scophit is targeted for removal
**       from a list of Scophit objects
** @attr Target2 [AjBool] Also used for garbage collection
** @attr Priority [AjBool] True if the Scop hit is high priority
** @attr Padding [char[4]] Padding to alignment boundary
**
** @new    ajDmxScophitNew Default Scophit object constructor.
** @delete ajDmxScophitDel Default Scophit object destructor.
** @delete ajDmxScophitDelWrap Wrapper to destructor for Scophit object
**         for use with generic functions.
** @assign ajDmxScophitListCopy Reads a list of Scophit structures and
**         returns a pointer to a duplicate of the list.
** @use    ajDmxScophitCheckTarget Checks to see if the Target element of a
**         Scophit object == ajTrue.
** @modify ajDmxScophitTarget Sets the Target element of a Scophit object
**         to True.
** @modify ajDmxScophitTarget2 Sets the Target2 element of a Scophit object
**         to True.
** @modify ajDmxScophitTargetLowPriority Sets the Target element of a
**         Scophit object to True if its Priority is low.
** @use    ajDmxScophitCompSpr Function to sort Scophit object by Spr element.
** @use    ajDmxScophitCompStart Function to sort Scophit object by Spr
**         element.
** @use    ajDmxScophitCompEnd Function to sort Scophit object by End element.
** @use    ajDmxScophitCompClass Function to sort Scophit object by Class
**         element.
** @use    ajDmxScophitCompFold Function to sort Scophit object by Fold
**         element.
** @use    ajDmxScophitCompSfam Function to sort Scophit object by Superfamily
**         element.
** @use    ajDmxScophitCompFam Function to sort Scophit object by Family
**         element.
** @use    ajDmxScophitCompAcc Function to sort Scophit objects by Acc element.
** @use    ajDmxScophitCompSunid Function to sort Scophit objects by Sunid
**         element.
** @use    ajDmxScophitCompScore Function to sort Scophit objects by Score
**         element.
** @use    ajDmxScophitCompPval Function to sort Scophit objects by Pval
**         element.
** @use    ajDmxScopSeqFromSunid Writes a sequence corresponding to a Scop
**         domain given a Sunid for the domain. The sequence is taken from one
**         of a list of Scop objects that is provided.
** @output ajDmxScophitsWrite Write contents of a list of Scophits to an output
**         file.
** @output ajDmxScophitsWriteFasta Write contents of a list of Scophits to an
**         output file in extended FASTA format.
** @input  ajDmxScophitReadFasta Read a Scophit object from a file in
**         extended FASTA format.
** @assign ajDmxScophitCopy Copies the contents from one Scophit object to
**         another.
** @@
******************************************************************************/

typedef struct AjSScophit
{
    AjPStr Class;
    AjPStr Architecture;
    AjPStr Topology;
    AjPStr Fold;
    AjPStr Superfamily;
    AjPStr Family;
    AjEDomainType Type;
    ajuint Sunid_Family;
    AjPStr Seq;
    ajuint Start;
    ajuint End;
    AjPStr Acc;
    AjPStr Spr;
    AjPStr Dom;
    AjPStr Typeobj;
    AjPStr Typesbj;
    AjPStr Model;
    AjPStr Group;
    ajuint Rank;
    float Score;
    float Eval;
    float Pval;
    AjPStr Alg;
    AjBool Target;
    AjBool Target2;
    AjBool Priority;
    char Padding[4];
} AjOScophit, *AjXScophit;

#define AjPScophit AjOScophit*
#define AjPPScophit AjXScophit*




/* @data AjPScopalg ***********************************************************
**
** AJAX SCOP Alignment object
**
** Holds data associated with a structure alignment.
** Now adapted to hold CATH domain data also by addition of Type,
** Architecture and Topology elements.
**
** AjPScopalg is implemented as a pointer to a C data structure.
**
** @alias AjSScopalg
** @alias AjOScopalg
**
** @attr Class [AjPStr] Class name
** @attr Architecture [AjPStr] CATH classification.
** @attr Topology [AjPStr] CATH classification.
** @attr Fold [AjPStr] Fold name
** @attr Superfamily [AjPStr] Superfamily name
** @attr Family [AjPStr] Family name (SCOP only)
** @attr Sunid_Family [ajuint] SCOP sunid for family
** @attr Width [ajuint] Width (residues) of widest part of alignment
** @attr Type [AjEDomainType] AJAX Domain Type enumeration
** @attr Number [ajuint] No. of sequences in alignment
** @attr Codes [AjPStr*] Array of domain id codes of sequences
** @attr Seqs [AjPStr*] Array of sequences
** @attr Post_similar [AjPStr] Post_similar line from alignment
** @attr Positions [AjPStr] Array of integers from 'Position' line in
**                            alignment, used for manual specification of
**                            signature positions
**
**
**
** @new    ajDmxScopalgRead Read a Scopalg object from a file.
** @output ajDmxScopalgWrite Write a Scopalg object to file in clustal format
**         annotated with SCOP classification info.
** @output ajDmxScopalgWriteClustal Writes a Scopalg object to file in clustal
**         format (just the alignment without the SCOP classification
**         information).
** @output ajDmxScopalgWriteClustal2 Writes a Scopalg object to file in clustal
**         format (just the alignment without the SCOP classification
**         information).
** @output ajDmxScopalgWriteFasta Writes a Scopalg object to file in clustal
**         format (just the alignment without the SCOP classification
**         information).
** @new    ajDmxScopalgNew Scopalg object constructor.
** @delete ajDmxScopalgDel Scopalg object destructor.
** @input  ajDmxScopalgGetseqs Read a Scopalg object and writes an array of
**         AjPStr containing the sequences without gaps.
** @@
******************************************************************************/

typedef struct AjSScopalg
{
    AjPStr Class;
    AjPStr Architecture;
    AjPStr Topology;
    AjPStr Fold;
    AjPStr Superfamily;
    AjPStr Family;
    ajuint Sunid_Family;
    ajuint Width;
    AjEDomainType Type;
    ajuint Number;
    AjPStr *Codes;
    AjPStr *Seqs;
    AjPStr Post_similar;
    AjPStr Positions;
} AjOScopalg;

#define AjPScopalg AjOScopalg*




/* ========================================================================= */
/* =========================== public functions ============================ */
/* ========================================================================= */




/*
** Prototype definitions
*/

void          ajDmxDummyFunction(void);
void          ajDmxExit(void);




/* ======================================================================= */
/* ========================== Scophit object ============================= */
/* ======================================================================= */




AjPScophit    ajDmxScophitNew(void);
void          ajDmxScophitDel(AjPScophit *Pscophit);
void          ajDmxScophitDelWrap(void **Pitem);
AjPList       ajDmxScophitListCopy(const AjPList scophits);

AjBool        ajDmxScophitCheckTarget(const AjPScophit scophit);
AjBool        ajDmxScophitTarget(AjPScophit *Pscophit);
AjBool        ajDmxScophitTarget2(AjPScophit *Pscophit);
AjBool        ajDmxScophitTargetLowPriority(AjPScophit *Pscophit);

ajint         ajDmxScophitCompSpr(const void *item1, const void *item2);
ajint         ajDmxScophitCompStart(const void *item1, const void *item2);
ajint         ajDmxScophitCompEnd(const void *item1, const void *item2);
ajint         ajDmxScophitCompClass(const void *item1, const void *item2);
ajint         ajDmxScophitCompFold(const void *item1, const void *item2);
ajint         ajDmxScophitCompSfam(const void *item1, const void *item2);
ajint         ajDmxScophitCompFam(const void *item1, const void *item2);
ajint         ajDmxScophitCompAcc(const void *item1, const void *item2);
ajint         ajDmxScophitCompSunid(const void *item1, const void *item2);
ajint         ajDmxScophitCompScore(const void *item1, const void *item2);
ajint         ajDmxScophitCompPval(const void *item1, const void *item2);

AjBool        ajDmxScopSeqFromSunid(ajint identifier, AjPStr *seq,
                                    const AjPList scops);
AjBool        ajDmxScophitsWrite(AjPFile outf, const AjPList scophits);
AjBool        ajDmxScophitsWriteFasta(AjPFile outf, const AjPList scophits);
AjPScophit    ajDmxScophitReadFasta(AjPFile inf);
AjBool        ajDmxScophitCopy(AjPScophit *Pto, const AjPScophit from);




/* ======================================================================= */
/* ========================== Scopalg object ============================= */
/* ======================================================================= */




AjBool        ajDmxScopalgRead(AjPFile inf, AjPScopalg *Pscopalg);
AjBool        ajDmxScopalgWrite(const AjPScopalg scopalg, AjPFile outf);
AjBool        ajDmxScopalgWriteClustal(const AjPScopalg scopalg, AjPFile outf);
AjBool        ajDmxScopalgWriteClustal2(const AjPScopalg scopalg, AjPFile outf);
AjBool        ajDmxScopalgWriteFasta(const AjPScopalg scopalg, AjPFile outf);
AjPScopalg    ajDmxScopalgNew(ajuint n);
void          ajDmxScopalgDel(AjPScopalg *Pscopalg);
ajuint        ajDmxScopalgGetseqs(const AjPScopalg scopalg, AjPStr **array);

/*
** End of prototype definitions
*/




AJ_END_DECLS

#endif /* !AJDMX_H */