2
* ===========================================================================
5
* National Center for Biotechnology Information
7
* This software/database is a "United States Government Work" under the
8
* terms of the United States Copyright Act. It was written as part of
9
* the author's official duties as a United States Government employee and
10
* thus cannot be copyrighted. This software/database is freely available
11
* to the loclic for use. The National Library of Medicine and the U.S.
12
* Government have not placed any restriction on its use or reproduction.
14
* Although all reasonable efforts have been taken to ensure the accuracy
15
* and reliability of the software and data, the NLM and the U.S.
16
* Government do not and cannot warrant the performance or results that
17
* may be obtained by using this software or data. The NLM and the U.S.
18
* Government disclaim all warranties, express or implied, including
19
* warranties of performance, merchantability or fitness for any particular
22
* Please cite the author in any work or product based on this material.
24
* ===========================================================================
28
* Author: James Ostell
30
* Version Creation Date: 4/1/91
34
* File Description: Object manager interface for module NCBI-Seqloc
37
* --------------------------------------------------------------------------
38
* Date Name Description of modification
39
* ------- ---------- -----------------------------------------------------
43
* Revision 6.3 2001/08/06 20:07:26 ostell
44
* added SEQID_TPG, TPE, TPD types
46
* Revision 6.2 2001/01/31 15:24:20 kans
47
* PatentSeqId.seqid is now an Int4 (JO)
49
* Revision 6.1 2000/04/05 18:11:41 dondosha
50
* Moved SeqIdSetDup from mblast.h
52
* Revision 6.0 1997/08/25 18:50:07 madden
53
* Revision changed to 6.0
55
* Revision 4.1 1997/06/19 18:41:32 vakatov
56
* [WIN32,MSVC++] Adopted for the "NCBIOBJ.LIB" DLL'ization
58
* Revision 4.0 1995/07/26 13:48:06 ostell
59
* force revision to 4.0
61
* Revision 3.3 1995/05/09 18:04:44 ostell
62
* added NUM_SEGID to define how many SeqId classes there are
66
* ==========================================================================
75
#ifndef _NCBI_General_
82
typedef ValNode SeqId, FAR *SeqIdPtr;
83
typedef ValNode SeqLoc, FAR *SeqLocPtr;
85
#ifndef _NCBI_Seqfeat_
86
#include <objfeat.h> /* after Seqloc to avoid cycles */
91
#define NLM_EXTERN NLM_IMPORT
93
#define NLM_EXTERN extern
100
/*****************************************************************************
104
*****************************************************************************/
105
NLM_EXTERN Boolean LIBCALL SeqLocAsnLoad PROTO((void));
107
/*****************************************************************************
109
* internal structures for NCBI-Seqloc objects
111
*****************************************************************************/
113
/*****************************************************************************
115
* SeqId is a choice using an ValNode, most types in data.ptrvalue
116
* except integers, in data.intvalue
119
1 = local Object-id , -- local use
120
2 = gibbsq INTEGER , -- Geninfo backbone seqid
121
3 = gibbmt INTEGER , -- Geninfo backbone moltype
122
4 = giim Giimport-id , -- Geninfo import id
123
5 = genbank Textseq-id ,
124
6 = embl Textseq-id ,
126
8 = swissprot Textseq-id ,
127
9 = patent Patent-seq-id ,
128
10 = other Textseq-id , -- catch all
129
11 = general Dbtag -- for other databases
130
12 = gi INTEGER -- GenInfo Integrated Database
132
14 = prf Textseq-id , -- PRF SEQDB
133
15 = pdb PDB-seq-id -- PDB sequence
134
16 = tpg Textseq-id , -- Third Party Annot/Seq Genbank
135
17 = tpe Textseq-id , -- Third Party Annot/Seq EMBL
136
18 = tpd Textseq-id } -- Third Party Annot/Seq DDBJ
139
WARNING: Some routines in sequtil.c (e.g. SeqIdPrint, SeqIdParse)
141
arrays of size NUM_SEQID to set certain behaviors. They should be changed
142
when SeqIds are added or changed.
144
*****************************************************************************/
146
#define NUM_SEQID 19 /* total number of SeqId types */
148
#define SEQID_NOT_SET ( (Uint1)0)
149
#define SEQID_LOCAL ( (Uint1)1)
150
#define SEQID_GIBBSQ ( (Uint1)2)
151
#define SEQID_GIBBMT ( (Uint1)3)
152
#define SEQID_GIIM ( (Uint1)4)
154
#define SEQID_GENBANK ( (Uint1)5)
155
#define SEQID_EMBL ( (Uint1)6)
156
#define SEQID_PIR ( (Uint1)7)
157
#define SEQID_SWISSPROT ( (Uint1)8)
160
#define SEQID_PATENT ( (Uint1)9)
161
#define SEQID_OTHER ( (Uint1)10)
162
#define SEQID_GENERAL ( (Uint1)11)
163
#define SEQID_GI ( (Uint1)12)
164
#define SEQID_DDBJ ((Uint1)13)
165
#define SEQID_PRF ((Uint1)14)
166
#define SEQID_PDB ((Uint1)15)
168
#define SEQID_TPG ((Uint1)16)
169
#define SEQID_TPE ((Uint1)17)
170
#define SEQID_TPD ((Uint1)18)
172
NLM_EXTERN Boolean LIBCALL SeqIdAsnWrite PROTO((SeqIdPtr anp, AsnIoPtr aip, AsnTypePtr atp));
173
NLM_EXTERN SeqIdPtr LIBCALL SeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
174
NLM_EXTERN SeqIdPtr LIBCALL SeqIdFree PROTO((SeqIdPtr anp));
175
NLM_EXTERN SeqIdPtr LIBCALL SeqIdDup PROTO((SeqIdPtr oldid));
176
NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetDup PROTO((SeqIdPtr seqid));
177
NLM_EXTERN Int2 LIBCALL SeqIdLabel PROTO(( SeqIdPtr sip, CharPtr buffer, Int2 buflen, Uint1 content));
179
/*****************************************************************************
181
* These routines process sets or sequences of SeqId's
183
*****************************************************************************/
184
NLM_EXTERN Boolean LIBCALL SeqIdSetAsnWrite PROTO((SeqIdPtr anp, AsnIoPtr aip, AsnTypePtr settype, AsnTypePtr elementtype));
185
NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetAsnRead PROTO((AsnIoPtr aip, AsnTypePtr settype, AsnTypePtr elementtype));
186
NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetFree PROTO((SeqIdPtr anp));
189
/*****************************************************************************
193
*****************************************************************************/
194
typedef struct patentseqid {
197
} PatentSeqId, PNTR PatentSeqIdPtr;
199
NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdNew PROTO((void));
200
NLM_EXTERN Boolean LIBCALL PatentSeqIdAsnWrite PROTO((PatentSeqIdPtr psip, AsnIoPtr aip, AsnTypePtr atp));
201
NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
202
NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdFree PROTO((PatentSeqIdPtr psip));
204
/*****************************************************************************
208
*****************************************************************************/
209
typedef struct textseqid {
213
Int2 version; /* INT2_MIN (ncbilcl.h) = not set */
214
} TextSeqId, PNTR TextSeqIdPtr;
216
NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdNew PROTO((void));
217
NLM_EXTERN Boolean LIBCALL TextSeqIdAsnWrite PROTO((TextSeqIdPtr tsip, AsnIoPtr aip, AsnTypePtr atp));
218
NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
219
NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdFree PROTO((TextSeqIdPtr tsip));
221
/*****************************************************************************
225
*****************************************************************************/
226
typedef struct giim {
230
} Giim, PNTR GiimPtr;
232
NLM_EXTERN GiimPtr LIBCALL GiimNew PROTO((void));
233
NLM_EXTERN Boolean LIBCALL GiimAsnWrite PROTO((GiimPtr gip, AsnIoPtr aip, AsnTypePtr atp));
234
NLM_EXTERN GiimPtr LIBCALL GiimAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
235
NLM_EXTERN GiimPtr LIBCALL GiimFree PROTO((GiimPtr gip));
238
/*****************************************************************************
242
*****************************************************************************/
243
typedef struct pdbseqid {
245
Uint1 chain; /* 0 = no chain set. default = 32 */
247
} PDBSeqId, PNTR PDBSeqIdPtr;
249
NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdNew PROTO((void));
250
NLM_EXTERN Boolean LIBCALL PDBSeqIdAsnWrite PROTO((PDBSeqIdPtr tsip, AsnIoPtr aip, AsnTypePtr atp));
251
NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
252
NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdFree PROTO((PDBSeqIdPtr tsip));
254
/*****************************************************************************
257
* SeqLoc is a choice using an ValNode, most types in data.ptrvalue
258
* except integers, in data.intvalue
260
1 = null NULL , -- not placed
261
2 = empty Seq-id , -- to NULL one Seq-id in a collection
262
3 = whole Seq-id , -- whole sequence
263
4 = int Seq-interval , -- from to
264
5 = packed-int Packed-seqint ,
266
7 = packed-pnt Packed-seqpnt ,
267
8 = mix SEQUENCE OF Seq-loc ,
268
9 = equiv SET OF Seq-loc , -- equivalent sets of locations
270
11 = feat Feat-id -- indirect through a feature
272
*****************************************************************************/
273
#define SEQLOC_NULL ( (Uint1)1)
274
#define SEQLOC_EMPTY ( (Uint1)2)
275
#define SEQLOC_WHOLE ( (Uint1)3)
276
#define SEQLOC_INT ( (Uint1)4)
277
#define SEQLOC_PACKED_INT ( (Uint1)5)
278
#define SEQLOC_PNT ( (Uint1)6)
279
#define SEQLOC_PACKED_PNT ( (Uint1)7)
280
#define SEQLOC_MIX ( (Uint1)8)
281
#define SEQLOC_EQUIV ( (Uint1)9)
282
#define SEQLOC_BOND ( (Uint1)10)
283
#define SEQLOC_FEAT ( (Uint1)11)
285
NLM_EXTERN Boolean LIBCALL SeqLocAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
286
NLM_EXTERN SeqLocPtr LIBCALL SeqLocAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
287
NLM_EXTERN SeqLocPtr LIBCALL SeqLocFree PROTO((SeqLocPtr anp));
288
NLM_EXTERN Int2 LIBCALL SeqLocLabel PROTO((SeqLocPtr slp, CharPtr buffer, Int2 buflen, Uint1 content));
290
/*****************************************************************************
292
* these routines work on set/seq of SeqLoc
294
*****************************************************************************/
295
NLM_EXTERN Boolean LIBCALL SeqLocSetAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr set, AsnTypePtr element));
296
NLM_EXTERN SeqLocPtr LIBCALL SeqLocSetAsnRead PROTO((AsnIoPtr aip, AsnTypePtr orig, AsnTypePtr element));
297
NLM_EXTERN SeqLocPtr LIBCALL SeqLocSetFree PROTO((SeqLocPtr anp));
299
/*****************************************************************************
303
*****************************************************************************/
304
typedef struct seqint {
308
SeqIdPtr id; /* seq-id */
311
} SeqInt, PNTR SeqIntPtr;
313
NLM_EXTERN SeqIntPtr LIBCALL SeqIntNew PROTO((void));
314
NLM_EXTERN Boolean LIBCALL SeqIntAsnWrite PROTO((SeqIntPtr sip, AsnIoPtr aip, AsnTypePtr atp));
315
NLM_EXTERN SeqIntPtr LIBCALL SeqIntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
316
NLM_EXTERN SeqIntPtr LIBCALL SeqIntFree PROTO((SeqIntPtr sip));
318
/*****************************************************************************
322
*****************************************************************************/
324
NLM_EXTERN Boolean LIBCALL PackSeqIntAsnWrite PROTO((SeqLocPtr sip, AsnIoPtr aip, AsnTypePtr atp));
325
NLM_EXTERN SeqLocPtr LIBCALL PackSeqIntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
327
/*****************************************************************************
331
*****************************************************************************/
333
NLM_EXTERN Boolean LIBCALL SeqLocMixAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
334
NLM_EXTERN SeqLocPtr LIBCALL SeqLocMixAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
336
/*****************************************************************************
340
*****************************************************************************/
342
NLM_EXTERN Boolean LIBCALL SeqLocEquivAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
343
NLM_EXTERN SeqLocPtr LIBCALL SeqLocEquivAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
345
/*****************************************************************************
349
*****************************************************************************/
350
typedef struct seqpoint {
353
SeqIdPtr id; /* seq-id */
355
} SeqPnt, PNTR SeqPntPtr;
357
NLM_EXTERN SeqPntPtr LIBCALL SeqPntNew PROTO((void));
358
NLM_EXTERN Boolean LIBCALL SeqPntAsnWrite PROTO((SeqPntPtr spp, AsnIoPtr aip, AsnTypePtr atp));
359
NLM_EXTERN SeqPntPtr LIBCALL SeqPntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
360
NLM_EXTERN SeqPntPtr LIBCALL SeqPntFree PROTO((SeqPntPtr spp));
362
/*****************************************************************************
366
*****************************************************************************/
367
#define PACK_PNT_NUM 100 /* number of points per block */
369
typedef struct packseqpnt {
370
SeqIdPtr id; /* seq-id */
373
used; /* number of pnts used */
374
Int4 pnts[PACK_PNT_NUM];
375
struct packseqpnt PNTR next; /* builds up chain of points */
376
} PackSeqPnt, PNTR PackSeqPntPtr;
378
NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntNew PROTO((void));
379
NLM_EXTERN Boolean LIBCALL PackSeqPntAsnWrite PROTO((PackSeqPntPtr pspp, AsnIoPtr aip, AsnTypePtr atp));
380
NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
381
NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntFree PROTO((PackSeqPntPtr pspp));
382
NLM_EXTERN Int4 LIBCALL PackSeqPntGet PROTO((PackSeqPntPtr pspp, Int4 index));
383
NLM_EXTERN Boolean LIBCALL PackSeqPntPut PROTO((PackSeqPntPtr pspp, Int4 point));
384
NLM_EXTERN Int4 LIBCALL PackSeqPntNum PROTO((PackSeqPntPtr pspp));
386
/*****************************************************************************
390
*****************************************************************************/
391
typedef struct seqbond {
394
} SeqBond, PNTR SeqBondPtr;
396
NLM_EXTERN SeqBondPtr LIBCALL SeqBondNew PROTO((void));
397
NLM_EXTERN Boolean LIBCALL SeqBondAsnWrite PROTO((SeqBondPtr sbp, AsnIoPtr aip, AsnTypePtr atp));
398
NLM_EXTERN SeqBondPtr LIBCALL SeqBondAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
399
NLM_EXTERN SeqBondPtr LIBCALL SeqBondFree PROTO((SeqBondPtr sbp));
402
/*****************************************************************************
406
*****************************************************************************/
407
#define Seq_strand_unknown 0
408
#define Seq_strand_plus 1
409
#define Seq_strand_minus 2
410
#define Seq_strand_both 3
411
#define Seq_strand_both_rev 4
412
#define Seq_strand_other 255
420
#define NLM_EXTERN NLM_EXPORT