|
NCBI Home IEB Home C Toolkit docs C++ Toolkit source browser C Toolkit source browser (2) |
NCBI C Toolkit Cross ReferenceC/object/objloc.h |
source navigation diff markup identifier search freetext search file search |
1 /* objloc.h
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
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.
13 *
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
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * File Name: objloc.h
27 *
28 * Author: James Ostell
29 *
30 * Version Creation Date: 4/1/91
31 *
32 * $Revision: 6.7 $
33 *
34 * File Description: Object manager interface for module NCBI-Seqloc
35 *
36 * Modifications:
37 * --------------------------------------------------------------------------
38 * Date Name Description of modification
39 * ------- ---------- -----------------------------------------------------
40 *
41 *
42 * $Log: objloc.h,v $
43 * Revision 6.7 2008/09/23 18:40:13 kans
44 * increased NUM_SEQID
45 *
46 * Revision 6.6 2008/09/15 18:44:37 kans
47 * added support for SEQID_NAMED_ANNOT_TRACK
48 *
49 * Revision 6.5 2005/04/26 21:33:00 kans
50 * added SEQID_GPIPE
51 *
52 * Revision 6.4 2005/03/10 17:18:43 kans
53 * added SeqLocCopy as a convenience function in ncbiobj library
54 *
55 * Revision 6.3 2001/08/06 20:07:26 ostell
56 * added SEQID_TPG, TPE, TPD types
57 *
58 * Revision 6.2 2001/01/31 15:24:20 kans
59 * PatentSeqId.seqid is now an Int4 (JO)
60 *
61 * Revision 6.1 2000/04/05 18:11:41 dondosha
62 * Moved SeqIdSetDup from mblast.h
63 *
64 * Revision 6.0 1997/08/25 18:50:07 madden
65 * Revision changed to 6.0
66 *
67 * Revision 4.1 1997/06/19 18:41:32 vakatov
68 * [WIN32,MSVC++] Adopted for the "NCBIOBJ.LIB" DLL'ization
69 *
70 * Revision 4.0 1995/07/26 13:48:06 ostell
71 * force revision to 4.0
72 *
73 * Revision 3.3 1995/05/09 18:04:44 ostell
74 * added NUM_SEGID to define how many SeqId classes there are
75 *
76 *
77 *
78 * ==========================================================================
79 */
80
81 #ifndef _NCBI_Seqloc_
82 #define _NCBI_Seqloc_
83
84 #ifndef _ASNTOOL_
85 #include <asn.h>
86 #endif
87 #ifndef _NCBI_General_
88 #include <objgen.h>
89 #endif
90 #ifndef _NCBI_Biblio_
91 #include <objbibli.h>
92 #endif
93
94 typedef ValNode SeqId, FAR *SeqIdPtr;
95 typedef ValNode SeqLoc, FAR *SeqLocPtr;
96
97 #ifndef _NCBI_Seqfeat_
98 #include <objfeat.h> /* after Seqloc to avoid cycles */
99 #endif
100
101 #undef NLM_EXTERN
102 #ifdef NLM_IMPORT
103 #define NLM_EXTERN NLM_IMPORT
104 #else
105 #define NLM_EXTERN extern
106 #endif
107
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111
112 /*****************************************************************************
113 *
114 * Seqloc loader
115 *
116 *****************************************************************************/
117 NLM_EXTERN Boolean LIBCALL SeqLocAsnLoad PROTO((void));
118
119 /*****************************************************************************
120 *
121 * internal structures for NCBI-Seqloc objects
122 *
123 *****************************************************************************/
124
125 /*****************************************************************************
126 *
127 * SeqId is a choice using an ValNode, most types in data.ptrvalue
128 * except integers, in data.intvalue
129 * choice:
130 * 0 = not set
131 1 = local Object-id , -- local use
132 2 = gibbsq INTEGER , -- Geninfo backbone seqid
133 3 = gibbmt INTEGER , -- Geninfo backbone moltype
134 4 = giim Giimport-id , -- Geninfo import id
135 5 = genbank Textseq-id ,
136 6 = embl Textseq-id ,
137 7 = pir Textseq-id ,
138 8 = swissprot Textseq-id ,
139 9 = patent Patent-seq-id ,
140 10 = other Textseq-id , -- catch all
141 11 = general Dbtag } -- for other databases
142 12 = gi INTEGER -- GenInfo Integrated Database
143 13 = ddbj Textseq-id -- ddbj
144 14 = prf Textseq-id , -- PRF SEQDB
145 15 = pdb PDB-seq-id -- PDB sequence
146 16 = tpg Textseq-id , -- Third Party Annot/Seq Genbank
147 17 = tpe Textseq-id , -- Third Party Annot/Seq EMBL
148 18 = tpd Textseq-id , -- Third Party Annot/Seq DDBJ
149 19 = gpipe Textseq-id , -- Internal NCBI genome pipeline processing ID }
150 20 = named-annot-track Textseq-id -- Internal named annotation tracking ID
151
152 WARNING: Some routines in sequtil.c (e.g. SeqIdPrint, SeqIdParse)
153 and tofasta.c use
154 arrays of size NUM_SEQID to set certain behaviors. They should be changed
155 when SeqIds are added or changed.
156 *
157 *****************************************************************************/
158
159 #define NUM_SEQID 21 /* total number of SeqId types */
160
161 #define SEQID_NOT_SET ( (Uint1)0)
162 #define SEQID_LOCAL ( (Uint1)1)
163 #define SEQID_GIBBSQ ( (Uint1)2)
164 #define SEQID_GIBBMT ( (Uint1)3)
165 #define SEQID_GIIM ( (Uint1)4)
166
167 #define SEQID_GENBANK ( (Uint1)5)
168 #define SEQID_EMBL ( (Uint1)6)
169 #define SEQID_PIR ( (Uint1)7)
170 #define SEQID_SWISSPROT ( (Uint1)8)
171
172
173 #define SEQID_PATENT ( (Uint1)9)
174 #define SEQID_OTHER ( (Uint1)10)
175 #define SEQID_GENERAL ( (Uint1)11)
176 #define SEQID_GI ( (Uint1)12)
177 #define SEQID_DDBJ ((Uint1)13)
178 #define SEQID_PRF ((Uint1)14)
179 #define SEQID_PDB ((Uint1)15)
180
181 #define SEQID_TPG ((Uint1)16)
182 #define SEQID_TPE ((Uint1)17)
183 #define SEQID_TPD ((Uint1)18)
184
185 #define SEQID_GPIPE ((Uint1)19)
186 #define SEQID_NAMED_ANNOT_TRACK ((Uint1)20)
187
188 NLM_EXTERN Boolean LIBCALL SeqIdAsnWrite PROTO((SeqIdPtr anp, AsnIoPtr aip, AsnTypePtr atp));
189 NLM_EXTERN SeqIdPtr LIBCALL SeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
190 NLM_EXTERN SeqIdPtr LIBCALL SeqIdFree PROTO((SeqIdPtr anp));
191 NLM_EXTERN SeqIdPtr LIBCALL SeqIdDup PROTO((SeqIdPtr oldid));
192 NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetDup PROTO((SeqIdPtr seqid));
193 NLM_EXTERN Int2 LIBCALL SeqIdLabel PROTO(( SeqIdPtr sip, CharPtr buffer, Int2 buflen, Uint1 content));
194
195 /*****************************************************************************
196 *
197 * These routines process sets or sequences of SeqId's
198 *
199 *****************************************************************************/
200 NLM_EXTERN Boolean LIBCALL SeqIdSetAsnWrite PROTO((SeqIdPtr anp, AsnIoPtr aip, AsnTypePtr settype, AsnTypePtr elementtype));
201 NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetAsnRead PROTO((AsnIoPtr aip, AsnTypePtr settype, AsnTypePtr elementtype));
202 NLM_EXTERN SeqIdPtr LIBCALL SeqIdSetFree PROTO((SeqIdPtr anp));
203
204
205 /*****************************************************************************
206 *
207 * PatentSeqId
208 *
209 *****************************************************************************/
210 typedef struct patentseqid {
211 Int4 seqid;
212 IdPatPtr cit;
213 } PatentSeqId, PNTR PatentSeqIdPtr;
214
215 NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdNew PROTO((void));
216 NLM_EXTERN Boolean LIBCALL PatentSeqIdAsnWrite PROTO((PatentSeqIdPtr psip, AsnIoPtr aip, AsnTypePtr atp));
217 NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
218 NLM_EXTERN PatentSeqIdPtr LIBCALL PatentSeqIdFree PROTO((PatentSeqIdPtr psip));
219
220 /*****************************************************************************
221 *
222 * TextSeqId
223 *
224 *****************************************************************************/
225 typedef struct textseqid {
226 CharPtr name,
227 accession,
228 release;
229 Int2 version; /* INT2_MIN (ncbilcl.h) = not set */
230 } TextSeqId, PNTR TextSeqIdPtr;
231
232 NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdNew PROTO((void));
233 NLM_EXTERN Boolean LIBCALL TextSeqIdAsnWrite PROTO((TextSeqIdPtr tsip, AsnIoPtr aip, AsnTypePtr atp));
234 NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
235 NLM_EXTERN TextSeqIdPtr LIBCALL TextSeqIdFree PROTO((TextSeqIdPtr tsip));
236
237 /*****************************************************************************
238 *
239 * Giim
240 *
241 *****************************************************************************/
242 typedef struct giim {
243 Int4 id;
244 CharPtr db,
245 release;
246 } Giim, PNTR GiimPtr;
247
248 NLM_EXTERN GiimPtr LIBCALL GiimNew PROTO((void));
249 NLM_EXTERN Boolean LIBCALL GiimAsnWrite PROTO((GiimPtr gip, AsnIoPtr aip, AsnTypePtr atp));
250 NLM_EXTERN GiimPtr LIBCALL GiimAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
251 NLM_EXTERN GiimPtr LIBCALL GiimFree PROTO((GiimPtr gip));
252
253
254 /*****************************************************************************
255 *
256 * PDBSeqId
257 *
258 *****************************************************************************/
259 typedef struct pdbseqid {
260 CharPtr mol;
261 Uint1 chain; /* 0 = no chain set. default = 32 */
262 DatePtr rel;
263 } PDBSeqId, PNTR PDBSeqIdPtr;
264
265 NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdNew PROTO((void));
266 NLM_EXTERN Boolean LIBCALL PDBSeqIdAsnWrite PROTO((PDBSeqIdPtr tsip, AsnIoPtr aip, AsnTypePtr atp));
267 NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
268 NLM_EXTERN PDBSeqIdPtr LIBCALL PDBSeqIdFree PROTO((PDBSeqIdPtr tsip));
269
270 /*****************************************************************************
271 *
272 * SeqLoc
273 * SeqLoc is a choice using an ValNode, most types in data.ptrvalue
274 * except integers, in data.intvalue
275 * choice:
276 1 = null NULL , -- not placed
277 2 = empty Seq-id , -- to NULL one Seq-id in a collection
278 3 = whole Seq-id , -- whole sequence
279 4 = int Seq-interval , -- from to
280 5 = packed-int Packed-seqint ,
281 6 = pnt Seq-point ,
282 7 = packed-pnt Packed-seqpnt ,
283 8 = mix SEQUENCE OF Seq-loc ,
284 9 = equiv SET OF Seq-loc , -- equivalent sets of locations
285 10 = bond Seq-bond
286 11 = feat Feat-id -- indirect through a feature
287 *
288 *****************************************************************************/
289 #define SEQLOC_NULL ( (Uint1)1)
290 #define SEQLOC_EMPTY ( (Uint1)2)
291 #define SEQLOC_WHOLE ( (Uint1)3)
292 #define SEQLOC_INT ( (Uint1)4)
293 #define SEQLOC_PACKED_INT ( (Uint1)5)
294 #define SEQLOC_PNT ( (Uint1)6)
295 #define SEQLOC_PACKED_PNT ( (Uint1)7)
296 #define SEQLOC_MIX ( (Uint1)8)
297 #define SEQLOC_EQUIV ( (Uint1)9)
298 #define SEQLOC_BOND ( (Uint1)10)
299 #define SEQLOC_FEAT ( (Uint1)11)
300
301 NLM_EXTERN Boolean LIBCALL SeqLocAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
302 NLM_EXTERN SeqLocPtr LIBCALL SeqLocAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
303 NLM_EXTERN SeqLocPtr LIBCALL SeqLocFree PROTO((SeqLocPtr anp));
304 NLM_EXTERN SeqLocPtr LIBCALL SeqLocCopy PROTO((SeqLocPtr anp));
305 NLM_EXTERN Int2 LIBCALL SeqLocLabel PROTO((SeqLocPtr slp, CharPtr buffer, Int2 buflen, Uint1 content));
306
307 /*****************************************************************************
308 *
309 * these routines work on set/seq of SeqLoc
310 *
311 *****************************************************************************/
312 NLM_EXTERN Boolean LIBCALL SeqLocSetAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr set, AsnTypePtr element));
313 NLM_EXTERN SeqLocPtr LIBCALL SeqLocSetAsnRead PROTO((AsnIoPtr aip, AsnTypePtr orig, AsnTypePtr element));
314 NLM_EXTERN SeqLocPtr LIBCALL SeqLocSetFree PROTO((SeqLocPtr anp));
315
316 /*****************************************************************************
317 *
318 * SeqInt
319 *
320 *****************************************************************************/
321 typedef struct seqint {
322 Int4 from,
323 to;
324 Uint1 strand;
325 SeqIdPtr id; /* seq-id */
326 IntFuzzPtr if_from,
327 if_to;
328 } SeqInt, PNTR SeqIntPtr;
329
330 NLM_EXTERN SeqIntPtr LIBCALL SeqIntNew PROTO((void));
331 NLM_EXTERN Boolean LIBCALL SeqIntAsnWrite PROTO((SeqIntPtr sip, AsnIoPtr aip, AsnTypePtr atp));
332 NLM_EXTERN SeqIntPtr LIBCALL SeqIntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
333 NLM_EXTERN SeqIntPtr LIBCALL SeqIntFree PROTO((SeqIntPtr sip));
334
335 /*****************************************************************************
336 *
337 * Packed-int
338 *
339 *****************************************************************************/
340
341 NLM_EXTERN Boolean LIBCALL PackSeqIntAsnWrite PROTO((SeqLocPtr sip, AsnIoPtr aip, AsnTypePtr atp));
342 NLM_EXTERN SeqLocPtr LIBCALL PackSeqIntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
343
344 /*****************************************************************************
345 *
346 * SeqLocMix
347 *
348 *****************************************************************************/
349
350 NLM_EXTERN Boolean LIBCALL SeqLocMixAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
351 NLM_EXTERN SeqLocPtr LIBCALL SeqLocMixAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
352
353 /*****************************************************************************
354 *
355 * SeqLocEquiv
356 *
357 *****************************************************************************/
358
359 NLM_EXTERN Boolean LIBCALL SeqLocEquivAsnWrite PROTO((SeqLocPtr anp, AsnIoPtr aip, AsnTypePtr atp));
360 NLM_EXTERN SeqLocPtr LIBCALL SeqLocEquivAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
361
362 /*****************************************************************************
363 *
364 * SeqPnt
365 *
366 *****************************************************************************/
367 typedef struct seqpoint {
368 Int4 point;
369 Uint1 strand;
370 SeqIdPtr id; /* seq-id */
371 IntFuzzPtr fuzz;
372 } SeqPnt, PNTR SeqPntPtr;
373
374 NLM_EXTERN SeqPntPtr LIBCALL SeqPntNew PROTO((void));
375 NLM_EXTERN Boolean LIBCALL SeqPntAsnWrite PROTO((SeqPntPtr spp, AsnIoPtr aip, AsnTypePtr atp));
376 NLM_EXTERN SeqPntPtr LIBCALL SeqPntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
377 NLM_EXTERN SeqPntPtr LIBCALL SeqPntFree PROTO((SeqPntPtr spp));
378
379 /*****************************************************************************
380 *
381 * PackSeqPnt
382 *
383 *****************************************************************************/
384 #define PACK_PNT_NUM 100 /* number of points per block */
385
386 typedef struct packseqpnt {
387 SeqIdPtr id; /* seq-id */
388 IntFuzzPtr fuzz;
389 Uint1 strand,
390 used; /* number of pnts used */
391 Int4 pnts[PACK_PNT_NUM];
392 struct packseqpnt PNTR next; /* builds up chain of points */
393 } PackSeqPnt, PNTR PackSeqPntPtr;
394
395 NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntNew PROTO((void));
396 NLM_EXTERN Boolean LIBCALL PackSeqPntAsnWrite PROTO((PackSeqPntPtr pspp, AsnIoPtr aip, AsnTypePtr atp));
397 NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
398 NLM_EXTERN PackSeqPntPtr LIBCALL PackSeqPntFree PROTO((PackSeqPntPtr pspp));
399 NLM_EXTERN Int4 LIBCALL PackSeqPntGet PROTO((PackSeqPntPtr pspp, Int4 index));
400 NLM_EXTERN Boolean LIBCALL PackSeqPntPut PROTO((PackSeqPntPtr pspp, Int4 point));
401 NLM_EXTERN Int4 LIBCALL PackSeqPntNum PROTO((PackSeqPntPtr pspp));
402
403 /*****************************************************************************
404 *
405 * SeqBond
406 *
407 *****************************************************************************/
408 typedef struct seqbond {
409 SeqPntPtr a,
410 b;
411 } SeqBond, PNTR SeqBondPtr;
412
413 NLM_EXTERN SeqBondPtr LIBCALL SeqBondNew PROTO((void));
414 NLM_EXTERN Boolean LIBCALL SeqBondAsnWrite PROTO((SeqBondPtr sbp, AsnIoPtr aip, AsnTypePtr atp));
415 NLM_EXTERN SeqBondPtr LIBCALL SeqBondAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp));
416 NLM_EXTERN SeqBondPtr LIBCALL SeqBondFree PROTO((SeqBondPtr sbp));
417
418
419 /*****************************************************************************
420 *
421 * strand types
422 *
423 *****************************************************************************/
424 #define Seq_strand_unknown 0
425 #define Seq_strand_plus 1
426 #define Seq_strand_minus 2
427 #define Seq_strand_both 3
428 #define Seq_strand_both_rev 4
429 #define Seq_strand_other 255
430
431 #ifdef __cplusplus
432 }
433 #endif
434
435 #undef NLM_EXTERN
436 #ifdef NLM_EXPORT
437 #define NLM_EXTERN NLM_EXPORT
438 #else
439 #define NLM_EXTERN
440 #endif
441
442 #endif
443 |
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more information. |