NCBI C++ ToolKit
seq_macros.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef OBJECTS_SEQ___SEQ_MACROS__HPP
2 #define OBJECTS_SEQ___SEQ_MACROS__HPP
3 
4 /* $Id: seq_macros.hpp 59539 2013-09-03 19:16:46Z kornbluh $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Jonathan Kans, Michael Kornbluh, Colleen Bollin
30  *
31  */
32 
33 /// @file seq_macros.hpp
34 /// Utility macros and typedefs for exploring NCBI objects from seq.asn.
35 
36 
38 #include <objects/seq/seq__.hpp>
39 
40 
41 /// @NAME Convenience macros for NCBI objects
42 /// @{
43 
44 
47 
48 /////////////////////////////////////////////////////////////////////////////
49 /// Macros and typedefs for object subtypes
50 /////////////////////////////////////////////////////////////////////////////
51 
52 
53 /// CSeq_inst definitions
54 
55 #define NCBI_SEQREPR(Type) CSeq_inst::eRepr_##Type
57 
58 // virtual raw seg const ref
59 // consen map delta other
60 
61 #define NCBI_SEQMOL(Type) CSeq_inst::eMol_##Type
63 
64 // dna rna aa na other
65 
66 #define NCBI_SEQTOPOLOGY(Type) CSeq_inst::eTopology_##Type
68 
69 // linear circular tandem other
70 
71 #define NCBI_SEQSTRAND(Type) CSeq_inst::eStrand_##Type
73 
74 // ss ds mixed other
75 
76 
77 /// CSeq_annot definitions
78 
79 #define NCBI_SEQANNOT(Type) CSeq_annot::TData::e_##Type
81 
82 // Ftable Align Graph Ids Locs Seq_table
83 
84 
85 /// CAnnotdesc definitions
86 
87 #define NCBI_ANNOTDESC(Type) CAnnotdesc::e_##Type
89 
90 // Name Title Comment Pub
91 // User Create_date Update_date
92 // Src Align Region
93 
94 
95 /// CSeqdesc definitions
96 
97 #define NCBI_SEQDESC(Type) CSeqdesc::e_##Type
99 
100 // Mol_type Modif Method Name
101 // Title Org Comment Num
102 // Maploc Pir Genbank Pub
103 // Region User Sp Dbxref
104 // Embl Create_date Update_date Prf
105 // Pdb Het Source Molinfo
106 
107 
108 /// CMolInfo definitions
109 
110 #define NCBI_BIOMOL(Type) CMolInfo::eBiomol_##Type
112 
113 // genomic pre_RNA mRNA rRNA
114 // tRNA snRNA scRNA peptide
115 // other_genetic genomic_mRNA cRNA snoRNA
116 // transcribed_RNA ncRNA tmRNA other
117 
118 #define NCBI_TECH(Type) CMolInfo::eTech_##Type
120 
121 // standard est sts
122 // survey genemap physmap
123 // derived concept_trans seq_pept
124 // both seq_pept_overlap seq_pept_homol
125 // concept_trans_a htgs_1 htgs_2
126 // htgs_3 fli_cdna htgs_0
127 // htc wgs barcode
128 // composite_wgs_htgs tsa other
129 
130 #define NCBI_COMPLETENESS(Type) CMolInfo::eCompleteness_##Type
132 
133 // complete partial no_left no_right
134 // no_ends has_left has_right other
135 
136 
137 
138 /////////////////////////////////////////////////////////////////////////////
139 /// Macros for obtaining closest specific CSeqdesc applying to a CBioseq
140 /////////////////////////////////////////////////////////////////////////////
141 
142 
143 /// IF_EXISTS_CLOSEST base macro calls GetClosestDescriptor with generated components
144 // If Lvl is not NULL, it must be a pointer to an int
145 
146 #define IF_EXISTS_CLOSEST(Cref, Var, Lvl, Chs) \
147 if (CConstRef<CSeqdesc> Cref = (Var).GetClosestDescriptor (Chs, Lvl))
148 
149 
150 /// IF_EXISTS_CLOSEST_MOLINFO
151 // CBioseq& as input, dereference with const CMolInfo& molinf = (*cref).GetMolinfo();
152 
153 #define IF_EXISTS_CLOSEST_MOLINFO(Cref, Var, Lvl) \
154 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Molinfo))
155 
156 /// IF_EXISTS_CLOSEST_BIOSOURCE
157 // CBioseq& as input, dereference with const CBioSource& source = (*cref).GetSource();
158 
159 #define IF_EXISTS_CLOSEST_BIOSOURCE(Cref, Var, Lvl) \
160 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Source))
161 
162 /// IF_EXISTS_CLOSEST_TITLE
163 // CBioseq& as input, dereference with const string& title = (*cref).GetTitle();
164 
165 #define IF_EXISTS_CLOSEST_TITLE(Cref, Var, Lvl) \
166 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Title))
167 
168 /// IF_EXISTS_CLOSEST_GENBANKBLOCK
169 // CBioseq& as input, dereference with const CGB_block& gbk = (*cref).GetGenbank();
170 
171 #define IF_EXISTS_CLOSEST_GENBANKBLOCK(Cref, Var, Lvl) \
172 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Genbank))
173 
174 /// IF_EXISTS_CLOSEST_EMBLBLOCK
175 // CBioseq& as input, dereference with const CEMBL_block& ebk = (*cref).GetEmbl();
176 
177 #define IF_EXISTS_CLOSEST_EMBLBLOCK(Cref, Var, Lvl) \
178 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Embl))
179 
180 /// IF_EXISTS_CLOSEST_PDBBLOCK
181 // CBioseq& as input, dereference with const CPDB_block& pbk = (*cref).GetPdb();
182 
183 #define IF_EXISTS_CLOSEST_PDBBLOCK(Cref, Var, Lvl) \
184 IF_EXISTS_CLOSEST (Cref, Var, Lvl, NCBI_SEQDESC(Pdb))
185 
186 
187 
188 // "FOR_EACH_XXX_ON_YYY" does a linear const traversal of STL containers
189 // "EDIT_EACH_XXX_ON_YYY" does a linear non-const traversal of STL containers
190 
191 // "SWITCH_ON_XXX_CHOICE" switches on the item subtype
192 
193 // "ADD_XXX_TO_YYY" adds an element to a specified object
194 // "ERASE_XXX_ON_YYY" deletes a specified object within an iterator
195 
196 // Miscellaneous macros for testing objects include
197 // "XXX_IS_YYY" or "XXX_HAS_YYY"
198 // "XXX_CHOICE_IS"
199 ///
200 /// CBioseq macros
201 
202 /// SEQDESC_ON_BIOSEQ macros
203 
204 #define SEQDESC_ON_BIOSEQ_Type CBioseq::TDescr::Tdata
205 #define SEQDESC_ON_BIOSEQ_Test(Var) (Var).IsSetDescr()
206 #define SEQDESC_ON_BIOSEQ_Get(Var) (Var).GetDescr().Get()
207 #define SEQDESC_ON_BIOSEQ_Set(Var) (Var).SetDescr().Set()
208 
209 /// BIOSEQ_HAS_SEQDESC
210 
211 #define BIOSEQ_HAS_SEQDESC(Var) \
212 ITEM_HAS (SEQDESC_ON_BIOSEQ, Var)
213 
214 /// FOR_EACH_SEQDESC_ON_BIOSEQ
215 /// EDIT_EACH_SEQDESC_ON_BIOSEQ
216 // CBioseq& as input, dereference with [const] CSeqdesc& desc = **itr
217 
218 #define FOR_EACH_SEQDESC_ON_BIOSEQ(Itr, Var) \
219 FOR_EACH (SEQDESC_ON_BIOSEQ, Itr, Var)
220 
221 #define EDIT_EACH_SEQDESC_ON_BIOSEQ(Itr, Var) \
222 EDIT_EACH (SEQDESC_ON_BIOSEQ, Itr, Var)
223 
224 /// ADD_SEQDESC_TO_BIOSEQ
225 
226 #define ADD_SEQDESC_TO_BIOSEQ(Var, Ref) \
227 ADD_ITEM (SEQDESC_ON_BIOSEQ, Var, Ref)
228 
229 /// ERASE_SEQDESC_ON_BIOSEQ
230 
231 #define ERASE_SEQDESC_ON_BIOSEQ(Itr, Var) \
232 LIST_ERASE_ITEM (SEQDESC_ON_BIOSEQ, Itr, Var)
233 
234 /// BIOSEQ_HAS_DESCRIPTOR
235 /// FOR_EACH_DESCRIPTOR_ON_BIOSEQ
236 /// EDIT_EACH_DESCRIPTOR_ON_BIOSEQ
237 /// ADD_DESCRIPTOR_TO_BIOSEQ
238 /// ERASE_DESCRIPTOR_ON_BIOSEQ
239 
240 #define BIOSEQ_HAS_DESCRIPTOR BIOSEQ_HAS_SEQDESC
241 #define FOR_EACH_DESCRIPTOR_ON_BIOSEQ FOR_EACH_SEQDESC_ON_BIOSEQ
242 #define EDIT_EACH_DESCRIPTOR_ON_BIOSEQ EDIT_EACH_SEQDESC_ON_BIOSEQ
243 #define ADD_DESCRIPTOR_TO_BIOSEQ ADD_SEQDESC_TO_BIOSEQ
244 #define ERASE_DESCRIPTOR_ON_BIOSEQ ERASE_SEQDESC_ON_BIOSEQ
245 
246 
247 /// SEQANNOT_ON_BIOSEQ macros
248 
249 #define SEQANNOT_ON_BIOSEQ_Type CBioseq::TAnnot
250 #define SEQANNOT_ON_BIOSEQ_Test(Var) (Var).IsSetAnnot()
251 #define SEQANNOT_ON_BIOSEQ_Get(Var) (Var).GetAnnot()
252 #define SEQANNOT_ON_BIOSEQ_Set(Var) (Var).SetAnnot()
253 
254 /// BIOSEQ_HAS_SEQANNOT
255 
256 #define BIOSEQ_HAS_SEQANNOT(Var) \
257 ITEM_HAS (SEQANNOT_ON_BIOSEQ, Var)
258 
259 /// FOR_EACH_SEQANNOT_ON_BIOSEQ
260 /// EDIT_EACH_SEQANNOT_ON_BIOSEQ
261 // CBioseq& as input, dereference with [const] CSeq_annot& annot = **itr;
262 
263 #define FOR_EACH_SEQANNOT_ON_BIOSEQ(Itr, Var) \
264 FOR_EACH (SEQANNOT_ON_BIOSEQ, Itr, Var)
265 
266 #define EDIT_EACH_SEQANNOT_ON_BIOSEQ(Itr, Var) \
267 EDIT_EACH (SEQANNOT_ON_BIOSEQ, Itr, Var)
268 
269 /// ADD_SEQANNOT_TO_BIOSEQ
270 
271 #define ADD_SEQANNOT_TO_BIOSEQ(Var, Ref) \
272 ADD_ITEM (SEQANNOT_ON_BIOSEQ, Var, Ref)
273 
274 /// ERASE_SEQANNOT_ON_BIOSEQ
275 
276 #define ERASE_SEQANNOT_ON_BIOSEQ(Itr, Var) \
277 LIST_ERASE_ITEM (SEQANNOT_ON_BIOSEQ, Itr, Var)
278 
279 /// BIOSEQ_HAS_ANNOT
280 /// FOR_EACH_ANNOT_ON_BIOSEQ
281 /// EDIT_EACH_ANNOT_ON_BIOSEQ
282 /// ADD_ANNOT_TO_BIOSEQ
283 /// ERASE_ANNOT_ON_BIOSEQ
284 
285 #define BIOSEQ_HAS_ANNOT BIOSEQ_HAS_SEQANNOT
286 #define FOR_EACH_ANNOT_ON_BIOSEQ FOR_EACH_SEQANNOT_ON_BIOSEQ
287 #define EDIT_EACH_ANNOT_ON_BIOSEQ EDIT_EACH_SEQANNOT_ON_BIOSEQ
288 #define ADD_ANNOT_TO_BIOSEQ ADD_SEQANNOT_TO_BIOSEQ
289 #define ERASE_ANNOT_ON_BIOSEQ ERASE_SEQANNOT_ON_BIOSEQ
290 
291 
292 /// SEQID_ON_BIOSEQ macros
293 
294 #define SEQID_ON_BIOSEQ_Type CBioseq::TId
295 #define SEQID_ON_BIOSEQ_Test(Var) (Var).IsSetId()
296 #define SEQID_ON_BIOSEQ_Get(Var) (Var).GetId()
297 #define SEQID_ON_BIOSEQ_Set(Var) (Var).SetId()
298 
299 /// BIOSEQ_HAS_SEQID
300 
301 #define BIOSEQ_HAS_SEQID(Var) \
302 ITEM_HAS (SEQID_ON_BIOSEQ, Var)
303 
304 /// FOR_EACH_SEQID_ON_BIOSEQ
305 /// EDIT_EACH_SEQID_ON_BIOSEQ
306 // CBioseq& as input, dereference with [const] CSeq_id& sid = **itr;
307 
308 #define FOR_EACH_SEQID_ON_BIOSEQ(Itr, Var) \
309 FOR_EACH (SEQID_ON_BIOSEQ, Itr, Var)
310 
311 #define EDIT_EACH_SEQID_ON_BIOSEQ(Itr, Var) \
312 EDIT_EACH (SEQID_ON_BIOSEQ, Itr, Var)
313 
314 /// ADD_SEQID_TO_BIOSEQ
315 
316 #define ADD_SEQID_TO_BIOSEQ(Var, Ref) \
317 ADD_ITEM (SEQID_ON_BIOSEQ, Var, Ref)
318 
319 /// ERASE_SEQID_ON_BIOSEQ
320 
321 #define ERASE_SEQID_ON_BIOSEQ(Itr, Var) \
322 LIST_ERASE_ITEM (SEQID_ON_BIOSEQ, Itr, Var)
323 
324 /// SEQID_ON_BIOSEQ_IS_SORTED
325 
326 #define SEQID_ON_BIOSEQ_IS_SORTED(Var, Func) \
327 IS_SORTED (SEQID_ON_BIOSEQ, Var, Func)
328 
329 /// SORT_SEQID_ON_BIOSEQ
330 
331 #define SORT_SEQID_ON_BIOSEQ(Var, Func) \
332 DO_LIST_SORT (SEQID_ON_BIOSEQ, Var, Func)
333 
334 /// SEQID_ON_BIOSEQ_IS_UNIQUE
335 
336 #define SEQID_ON_BIOSEQ_IS_UNIQUE(Var, Func) \
337 IS_UNIQUE (SEQID_ON_BIOSEQ, Var, Func)
338 
339 /// UNIQUE_SEQID_ON_BIOSEQ
340 
341 #define UNIQUE_SEQID_ON_BIOSEQ(Var, Func) \
342 DO_UNIQUE (SEQID_ON_BIOSEQ, Var, Func)
343 
344 
345 ///
346 /// CSeq_annot macros
347 
348 /// SEQANNOT_CHOICE macros
349 
350 #define SEQANNOT_CHOICE_Test(Var) (Var).IsSetData()
351 #define SEQANNOT_CHOICE_Chs(Var) (Var).GetData().Which()
352 
353 /// SEQANNOT_CHOICE_IS
354 
355 #define SEQANNOT_CHOICE_IS(Var, Chs) \
356 CHOICE_IS (SEQANNOT_CHOICE, Var, Chs)
357 
358 /// SEQANNOT_IS_FTABLE
359 
360 #define SEQANNOT_IS_FTABLE(Var) \
361 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Ftable))
362 
363 /// SEQANNOT_IS_ALIGN
364 
365 #define SEQANNOT_IS_ALIGN(Var) \
366 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Align))
367 
368 /// SEQANNOT_IS_GRAPH
369 
370 #define SEQANNOT_IS_GRAPH(Var) \
371 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Graph))
372 
373 /// SEQANNOT_IS_IDS
374 
375 #define SEQANNOT_IS_IDS(Var) \
376 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Ids))
377 
378 /// SEQANNOT_IS_LOCS
379 
380 #define SEQANNOT_IS_LOCS(Var) \
381 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Locs))
382 
383 /// SEQANNOT_IS_SEQ_TABLE
384 
385 #define SEQANNOT_IS_SEQ_TABLE(Var) \
386 SEQANNOT_CHOICE_IS (Var, NCBI_SEQANNOT(Seq_table))
387 
388 /// SWITCH_ON_SEQANNOT_CHOICE
389 
390 #define SWITCH_ON_SEQANNOT_CHOICE(Var) \
391 SWITCH_ON (SEQANNOT_CHOICE, Var)
392 
393 
394 /// SEQFEAT_ON_SEQANNOT macros
395 
396 #define SEQFEAT_ON_SEQANNOT_Type CSeq_annot::TData::TFtable
397 #define SEQFEAT_ON_SEQANNOT_Test(Var) (Var).IsFtable()
398 #define SEQFEAT_ON_SEQANNOT_Get(Var) (Var).GetData().GetFtable()
399 #define SEQFEAT_ON_SEQANNOT_Set(Var) (Var).SetData().SetFtable()
400 
401 /// SEQANNOT_IS_SEQFEAT
402 
403 #define SEQANNOT_IS_SEQFEAT(Var) \
404 ITEM_HAS (SEQFEAT_ON_SEQANNOT, Var)
405 
406 /// FOR_EACH_SEQFEAT_ON_SEQANNOT
407 /// EDIT_EACH_SEQFEAT_ON_SEQANNOT
408 // CSeq_annot& as input, dereference with [const] CSeq_feat& feat = **itr;
409 
410 #define FOR_EACH_SEQFEAT_ON_SEQANNOT(Itr, Var) \
411 FOR_EACH (SEQFEAT_ON_SEQANNOT, Itr, Var)
412 
413 #define EDIT_EACH_SEQFEAT_ON_SEQANNOT(Itr, Var) \
414 EDIT_EACH (SEQFEAT_ON_SEQANNOT, Itr, Var)
415 
416 /// ADD_SEQFEAT_TO_SEQANNOT
417 
418 #define ADD_SEQFEAT_TO_SEQANNOT(Var, Ref) \
419 ADD_ITEM (SEQFEAT_ON_SEQANNOT, Var, Ref)
420 
421 /// ERASE_SEQFEAT_ON_SEQANNOT
422 
423 #define ERASE_SEQFEAT_ON_SEQANNOT(Itr, Var) \
424 LIST_ERASE_ITEM (SEQFEAT_ON_SEQANNOT, Itr, Var)
425 
426 /// ANNOT_IS_FEATURE
427 /// FOR_EACH_FEATURE_ON_ANNOT
428 /// EDIT_EACH_FEATURE_ON_ANNOT
429 /// ADD_FEATURE_TO_ANNOT
430 /// ERASE_FEATURE_ON_ANNOT
431 
432 #define ANNOT_IS_FEATURE SEQANNOT_IS_SEQFEAT
433 #define FOR_EACH_FEATURE_ON_ANNOT FOR_EACH_SEQFEAT_ON_SEQANNOT
434 #define EDIT_EACH_FEATURE_ON_ANNOT EDIT_EACH_SEQFEAT_ON_SEQANNOT
435 #define ADD_FEATURE_TO_ANNOT ADD_SEQFEAT_TO_SEQANNOT
436 #define ERASE_FEATURE_ON_ANNOT ERASE_SEQFEAT_ON_SEQANNOT
437 
438 
439 /// SEQALIGN_ON_SEQANNOT macros
440 
441 #define SEQALIGN_ON_SEQANNOT_Type CSeq_annot::TData::TAlign
442 #define SEQALIGN_ON_SEQANNOT_Test(Var) (Var).IsAlign()
443 #define SEQALIGN_ON_SEQANNOT_Get(Var) (Var).GetData().GetAlign()
444 #define SEQALIGN_ON_SEQANNOT_Set(Var) (Var).SetData().SetAlign()
445 
446 /// SEQANNOT_IS_SEQALIGN
447 
448 #define SEQANNOT_IS_SEQALIGN(Var) \
449 ITEM_HAS (SEQALIGN_ON_SEQANNOT, Var)
450 
451 /// FOR_EACH_SEQALIGN_ON_SEQANNOT
452 /// EDIT_EACH_SEQALIGN_ON_SEQANNOT
453 // CSeq_annot& as input, dereference with [const] CSeq_align& align = **itr;
454 
455 #define FOR_EACH_SEQALIGN_ON_SEQANNOT(Itr, Var) \
456 FOR_EACH (SEQALIGN_ON_SEQANNOT, Itr, Var)
457 
458 #define EDIT_EACH_SEQALIGN_ON_SEQANNOT(Itr, Var) \
459 EDIT_EACH (SEQALIGN_ON_SEQANNOT, Itr, Var)
460 
461 /// ADD_SEQALIGN_TO_SEQANNOT
462 
463 #define ADD_SEQALIGN_TO_SEQANNOT(Var, Ref) \
464 ADD_ITEM (SEQALIGN_ON_SEQANNOT, Var, Ref)
465 
466 /// ERASE_SEQALIGN_ON_SEQANNOT
467 
468 #define ERASE_SEQALIGN_ON_SEQANNOT(Itr, Var) \
469 LIST_ERASE_ITEM (SEQALIGN_ON_SEQANNOT, Itr, Var)
470 
471 /// ANNOT_IS_ALIGN
472 /// FOR_EACH_ALIGN_ON_ANNOT
473 /// EDIT_EACH_ALIGN_ON_ANNOT
474 /// ADD_ALIGN_TO_ANNOT
475 /// ERASE_ALIGN_ON_ANNOT
476 
477 #define ANNOT_IS_ALIGN SEQANNOT_IS_SEQALIGN
478 #define FOR_EACH_ALIGN_ON_ANNOT FOR_EACH_SEQALIGN_ON_SEQANNOT
479 #define EDIT_EACH_ALIGN_ON_ANNOT EDIT_EACH_SEQALIGN_ON_SEQANNOT
480 #define ADD_ALIGN_TO_ANNOT ADD_SEQALIGN_TO_SEQANNOT
481 #define ERASE_ALIGN_ON_ANNOT ERASE_SEQALIGN_ON_SEQANNOT
482 
483 
484 /// SEQGRAPH_ON_SEQANNOT macros
485 
486 #define SEQGRAPH_ON_SEQANNOT_Type CSeq_annot::TData::TGraph
487 #define SEQGRAPH_ON_SEQANNOT_Test(Var) (Var).IsGraph()
488 #define SEQGRAPH_ON_SEQANNOT_Get(Var) (Var).GetData().GetGraph()
489 #define SEQGRAPH_ON_SEQANNOT_Set(Var) SetData().SetGraph()
490 
491 /// SEQANNOT_IS_SEQGRAPH
492 
493 #define SEQANNOT_IS_SEQGRAPH(Var) \
494 ITEM_HAS (SEQGRAPH_ON_SEQANNOT, Var)
495 
496 /// FOR_EACH_SEQGRAPH_ON_SEQANNOT
497 /// EDIT_EACH_SEQGRAPH_ON_SEQANNOT
498 // CSeq_annot& as input, dereference with [const] CSeq_graph& graph = **itr;
499 
500 #define FOR_EACH_SEQGRAPH_ON_SEQANNOT(Itr, Var) \
501 FOR_EACH (SEQGRAPH_ON_SEQANNOT, Itr, Var)
502 
503 #define EDIT_EACH_SEQGRAPH_ON_SEQANNOT(Itr, Var) \
504 EDIT_EACH (SEQGRAPH_ON_SEQANNOT, Itr, Var)
505 
506 /// ADD_SEQGRAPH_TO_SEQANNOT
507 
508 #define ADD_SEQGRAPH_TO_SEQANNOT(Var, Ref) \
509 ADD_ITEM (SEQGRAPH_ON_SEQANNOT, Var, Ref)
510 
511 /// ERASE_SEQGRAPH_ON_SEQANNOT
512 
513 #define ERASE_SEQGRAPH_ON_SEQANNOT(Itr, Var) \
514 LIST_ERASE_ITEM (SEQGRAPH_ON_SEQANNOT, Itr, Var)
515 
516 /// ANNOT_IS_GRAPH
517 /// FOR_EACH_GRAPH_ON_ANNOT
518 /// EDIT_EACH_GRAPH_ON_ANNOT
519 /// ADD_GRAPH_TO_ANNOT
520 /// ERASE_GRAPH_ON_ANNOT
521 
522 #define ANNOT_IS_GRAPH SEQANNOT_IS_SEQGRAPH
523 #define FOR_EACH_GRAPH_ON_ANNOT FOR_EACH_SEQGRAPH_ON_SEQANNOT
524 #define EDIT_EACH_GRAPH_ON_ANNOT EDIT_EACH_SEQGRAPH_ON_SEQANNOT
525 #define ADD_GRAPH_TO_ANNOT ADD_SEQGRAPH_TO_SEQANNOT
526 #define ERASE_GRAPH_ON_ANNOT ERASE_SEQGRAPH_ON_SEQANNOT
527 
528 
529 /// SEQTABLE_ON_SEQANNOT macros
530 
531 #define SEQTABLE_ON_SEQANNOT_Type CSeq_annot::TData::TSeq_table
532 #define SEQTABLE_ON_SEQANNOT_Test(Var) (Var).IsSeq_table()
533 #define SEQTABLE_ON_SEQANNOT_Get(Var) (Var).GetData().GetSeq_table()
534 #define SEQTABLE_ON_SEQANNOT_Set(Var) SetData().SetSeq_table()
535 
536 /// SEQANNOT_IS_SEQTABLE
537 
538 #define SEQANNOT_IS_SEQTABLE(Var) \
539 ITEM_HAS (SEQTABLE_ON_SEQANNOT, Var)
540 
541 /// ANNOT_IS_TABLE
542 
543 #define ANNOT_IS_TABLE SEQANNOT_IS_SEQTABLE
544 
545 
546 /// ANNOTDESC_ON_SEQANNOT macros
547 
548 #define ANNOTDESC_ON_SEQANNOT_Type CSeq_annot::TDesc::Tdata
549 #define ANNOTDESC_ON_SEQANNOT_Test(Var) (Var).IsSetDesc() && (Var).GetDesc().IsSet()
550 #define ANNOTDESC_ON_SEQANNOT_Get(Var) (Var).GetDesc().Get()
551 #define ANNOTDESC_ON_SEQANNOT_Set(Var) (Var).SetDesc().Set()
552 
553 /// SEQANNOT_HAS_ANNOTDESC
554 
555 #define SEQANNOT_HAS_ANNOTDESC(Var) \
556 ITEM_HAS (ANNOTDESC_ON_SEQANNOT, Var)
557 
558 /// FOR_EACH_ANNOTDESC_ON_SEQANNOT
559 /// EDIT_EACH_ANNOTDESC_ON_SEQANNOT
560 // CSeq_annot& as input, dereference with [const] CAnnotdesc& desc = **itr;
561 
562 #define FOR_EACH_ANNOTDESC_ON_SEQANNOT(Itr, Var) \
563 FOR_EACH (ANNOTDESC_ON_SEQANNOT, Itr, Var)
564 
565 #define EDIT_EACH_ANNOTDESC_ON_SEQANNOT(Itr, Var) \
566 EDIT_EACH (ANNOTDESC_ON_SEQANNOT, Itr, Var)
567 
568 /// ADD_ANNOTDESC_TO_SEQANNOT
569 
570 #define ADD_ANNOTDESC_TO_SEQANNOT(Var, Ref) \
571 ADD_ITEM (ANNOTDESC_ON_SEQANNOT, Var, Ref)
572 
573 /// ERASE_ANNOTDESC_ON_SEQANNOT
574 
575 #define ERASE_ANNOTDESC_ON_SEQANNOT(Itr, Var) \
576 LIST_ERASE_ITEM (ANNOTDESC_ON_SEQANNOT, Itr, Var)
577 
578 /// ANNOT_HAS_ANNOTDESC
579 /// FOR_EACH_ANNOTDESC_ON_ANNOT
580 /// EDIT_EACH_ANNOTDESC_ON_ANNOT
581 /// ADD_ANNOTDESC_TO_ANNOT
582 /// ERASE_ANNOTDESC_ON_ANNOT
583 
584 #define ANNOT_HAS_ANNOTDESC SEQANNOT_HAS_ANNOTDESC
585 #define FOR_EACH_ANNOTDESC_ON_ANNOT FOR_EACH_ANNOTDESC_ON_SEQANNOT
586 #define EDIT_EACH_ANNOTDESC_ON_ANNOT EDIT_EACH_ANNOTDESC_ON_SEQANNOT
587 #define ADD_ANNOTDESC_TO_ANNOT ADD_ANNOTDESC_TO_SEQANNOT
588 #define ERASE_ANNOTDESC_ON_ANNOT ERASE_ANNOTDESC_ON_SEQANNOT
589 
590 ///
591 /// SEQFEAT_ON_MAPEXT macros
592 
593 #define SEQFEAT_ON_MAPEXT_Type CMap_ext::Tdata
594 #define SEQFEAT_ON_MAPEXT_Test(Var) (Var).IsSet()
595 #define SEQFEAT_ON_MAPEXT_Get(Var) (Var).Get()
596 #define SEQFEAT_ON_MAPEXT_Set(Var) (Var).Set()
597 
598 /// SEQANNOT_IS_SEQFEAT
599 
600 /// FOR_EACH_SEQFEAT_ON_MAPEXT
601 /// EDIT_EACH_SEQFEAT_ON_MAPEXT
602 
603 #define FOR_EACH_SEQFEAT_ON_MAPEXT(Itr, Var) \
604 FOR_EACH (SEQFEAT_ON_MAPEXT, Itr, Var)
605 
606 #define EDIT_EACH_SEQFEAT_ON_MAPEXT(Itr, Var) \
607 EDIT_EACH (SEQFEAT_ON_MAPEXT, Itr, Var)
608 
609 /// ADD_SEQFEAT_ON_MAPEXT
610 
611 #define ADD_SEQFEAT_TO_MAPEXT(Var, Ref) \
612 ADD_ITEM (SEQFEAT_ON_MAPEXT, Var, Ref)
613 
614 /// ERASE_SEQFEAT_ON_MAPEXT
615 
616 #define ERASE_SEQFEAT_ON_MAPEXT(Itr, Var) \
617 LIST_ERASE_ITEM (SEQFEAT_ON_MAPEXT, Itr, Var)
618 
619 ///
620 /// CAnnotdesc macros
621 
622 /// ANNOTDESC_CHOICE macros
623 
624 #define ANNOTDESC_CHOICE_Test(Var) (Var).Which() != CAnnotdesc::e_not_set
625 #define ANNOTDESC_CHOICE_Chs(Var) (Var).Which()
626 
627 /// ANNOTDESC_CHOICE_IS
628 
629 #define ANNOTDESC_CHOICE_IS(Var, Chs) \
630 CHOICE_IS (ANNOTDESC_CHOICE, Var, Chs)
631 
632 /// SWITCH_ON_ANNOTDESC_CHOICE
633 
634 #define SWITCH_ON_ANNOTDESC_CHOICE(Var) \
635 SWITCH_ON (ANNOTDESC_CHOICE, Var)
636 
637 
638 ///
639 /// CSeq_descr macros
640 
641 /// SEQDESC_ON_SEQDESCR macros
642 
643 #define SEQDESC_ON_SEQDESCR_Type CSeq_descr::Tdata
644 #define SEQDESC_ON_SEQDESCR_Test(Var) (Var).IsSet()
645 #define SEQDESC_ON_SEQDESCR_Get(Var) (Var).Get()
646 #define SEQDESC_ON_SEQDESCR_Set(Var) (Var).Set()
647 
648 /// SEQDESCR_HAS_SEQDESC
649 
650 #define SEQDESCR_HAS_SEQDESC(Var) \
651 ITEM_HAS (SEQDESC_ON_SEQDESCR, Var)
652 
653 /// FOR_EACH_SEQDESC_ON_SEQDESCR
654 /// EDIT_EACH_SEQDESC_ON_SEQDESCR
655 // CSeq_descr& as input, dereference with [const] CSeqdesc& desc = **itr;
656 
657 #define FOR_EACH_SEQDESC_ON_SEQDESCR(Itr, Var) \
658 FOR_EACH (SEQDESC_ON_SEQDESCR, Itr, Var)
659 
660 #define EDIT_EACH_SEQDESC_ON_SEQDESCR(Itr, Var) \
661 EDIT_EACH (SEQDESC_ON_SEQDESCR, Itr, Var)
662 
663 /// ADD_SEQDESC_TO_SEQDESCR
664 
665 #define ADD_SEQDESC_TO_SEQDESCR(Var, Ref) \
666 ADD_ITEM (SEQDESC_ON_SEQDESCR, Var, Ref)
667 
668 /// ERASE_SEQDESC_ON_SEQDESCR
669 
670 #define ERASE_SEQDESC_ON_SEQDESCR(Itr, Var) \
671 LIST_ERASE_ITEM (SEQDESC_ON_SEQDESCR, Itr, Var)
672 
673 /// DESCR_HAS_DESCRIPTOR
674 /// FOR_EACH_DESCRIPTOR_ON_DESCR
675 /// EDIT_EACH_DESCRIPTOR_ON_DESCR
676 /// ADD_DESCRIPTOR_TO_DESCR
677 /// ERASE_DESCRIPTOR_ON_DESCR
678 
679 #define DESCR_HAS_DESCRIPTOR SEQDESCR_HAS_SEQDESC
680 #define FOR_EACH_DESCRIPTOR_ON_DESCR FOR_EACH_SEQDESC_ON_SEQDESCR
681 #define EDIT_EACH_DESCRIPTOR_ON_DESCR EDIT_EACH_SEQDESC_ON_SEQDESCR
682 #define ERASE_DESCRIPTOR_ON_DESCR ERASE_SEQDESC_ON_SEQDESCR
683 #define ADD_DESCRIPTOR_TO_DESCR ADD_SEQDESC_TO_SEQDESCR
684 
685 
686 ///
687 /// CSeqdesc macros
688 
689 /// SEQDESC_CHOICE macros
690 
691 #define SEQDESC_CHOICE_Test(Var) (Var).Which() != CSeqdesc::e_not_set
692 #define SEQDESC_CHOICE_Chs(Var) (Var).Which()
693 
694 /// SEQDESC_CHOICE_IS
695 
696 #define SEQDESC_CHOICE_IS(Var, Chs) \
697 CHOICE_IS (SEQDESC_CHOICE, Var, Chs)
698 
699 /// SWITCH_ON_SEQDESC_CHOICE
700 
701 #define SWITCH_ON_SEQDESC_CHOICE(Var) \
702 SWITCH_ON (SEQDESC_CHOICE, Var)
703 
704 /// DESCRIPTOR_CHOICE_IS
705 /// SWITCH_ON_DESCRIPTOR_CHOICE
706 
707 #define DESCRIPTOR_CHOICE_IS SEQDESC_CHOICE_IS
708 #define SWITCH_ON_DESCRIPTOR_CHOICE SWITCH_ON_SEQDESC_CHOICE
709 
710 
711 ///
712 /// CMolInfo macros
713 
714 /// MOLINFO_BIOMOL macros
715 
716 #define MOLINFO_BIOMOL_Test(Var) (Var).IsSetBiomol()
717 #define MOLINFO_BIOMOL_Chs(Var) (Var).GetBiomol()
718 
719 /// MOLINFO_BIOMOL_IS
720 
721 #define MOLINFO_BIOMOL_IS(Var, Chs) \
722 CHOICE_IS (MOLINFO_BIOMOL, Var, Chs)
723 
724 /// SWITCH_ON_MOLINFO_BIOMOL
725 
726 #define SWITCH_ON_MOLINFO_BIOMOL(Var) \
727 SWITCH_ON (MOLINFO_BIOMOL, Var)
728 
729 
730 /// MOLINFO_TECH macros
731 
732 #define MOLINFO_TECH_Test(Var) (Var).IsSetTech()
733 #define MOLINFO_TECH_Chs(Var) (Var).GetTech()
734 
735 /// MOLINFO_TECH_IS
736 
737 #define MOLINFO_TECH_IS(Var, Chs) \
738 CHOICE_IS (MOLINFO_TECH, Var, Chs)
739 
740 /// SWITCH_ON_MOLINFO_TECH
741 
742 #define SWITCH_ON_MOLINFO_TECH(Var) \
743 SWITCH_ON (MOLINFO_TECH, Var)
744 
745 
746 /// MOLINFO_COMPLETENESS macros
747 
748 #define MOLINFO_COMPLETENESS_Test(Var) (Var).IsSetCompleteness()
749 #define MOLINFO_COMPLETENESS_Chs(Var) (Var).GetCompleteness()
750 
751 /// MOLINFO_COMPLETENESS_IS
752 
753 #define MOLINFO_COMPLETENESS_IS(Var, Chs) \
754 CHOICE_IS (MOLINFO_COMPLETENESS, Var, Chs)
755 
756 /// SWITCH_ON_MOLINFO_COMPLETENESS
757 
758 #define SWITCH_ON_MOLINFO_COMPLETENESS(Var) \
759 SWITCH_ON (MOLINFO_COMPLETENESS, Var)
760 
761 
762 ///
763 /// CDelta_ext macros
764 
765 #define DELTASEQ_IN_DELTAEXT_Type list< CRef< CDelta_seq > >
766 #define DELTASEQ_IN_DELTAEXT_Test(Var) ( (Var).IsSet() && ! (Var).Get().empty() )
767 #define DELTASEQ_IN_DELTAEXT_Get(Var) (Var).Get()
768 #define DELTASEQ_IN_DELTAEXT_Set(Var) (Var).Set()
769 #define DELTASEQ_IN_DELTAEXT_Reset(Var) (Var).Reset()
770 
771 #define FOR_EACH_DELTASEQ_IN_DELTAEXT(Itr, Var) \
772  FOR_EACH( DELTASEQ_IN_DELTAEXT, Itr, Var )
773 
774 #define EDIT_EACH_DELTASEQ_IN_DELTAEXT(Itr, Var) \
775  EDIT_EACH( DELTASEQ_IN_DELTAEXT, Itr, Var )
776 
777 #define ERASE_DELTASEQ_IN_DELTAEXT(Itr, Var) \
778  LIST_ERASE_ITEM (DELTASEQ_IN_DELTAEXT, Itr, Var)
779 
780 
783 
784 
785 /* @} */
786 
787 #endif /* OBJECTS_SEQ___SEQ_MACROS__HPP */
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
ERepr
representation class
Definition: Seq_inst_.hpp:91
E_Choice
Choice variants.
Definition: Seq_annot_.hpp:131
E_Choice
Choice variants.
Definition: Seqdesc_.hpp:109
ETopology
topology of molecule
Definition: Seq_inst_.hpp:121
EMol
molecule class in living organism
Definition: Seq_inst_.hpp:108
E_Choice
Choice variants.
Definition: Annotdesc_.hpp:95
EStrand
strandedness in living organism
Definition: Seq_inst_.hpp:133
CMolInfo::TTech TMOLINFO_TECH
Definition: seq_macros.hpp:119
CSeq_inst::TTopology TSEQ_TOPOLOGY
Definition: seq_macros.hpp:67
CSeq_inst::TMol TSEQ_MOL
Definition: seq_macros.hpp:62
CMolInfo::TCompleteness TMOLINFO_COMPLETENESS
Definition: seq_macros.hpp:131
CSeq_inst::TStrand TSEQ_STRAND
Definition: seq_macros.hpp:72
CSeq_annot::TData::E_Choice TSEQANNOT_CHOICE
Definition: seq_macros.hpp:80
CMolInfo::TBiomol TMOLINFO_BIOMOL
Definition: seq_macros.hpp:111
CSeqdesc::E_Choice TSEQDESC_CHOICE
Definition: seq_macros.hpp:98
CAnnotdesc::E_Choice TANNOTDESC_CHOICE
Definition: seq_macros.hpp:88
CSeq_inst::TRepr TSEQ_REPR
Definition: seq_macros.hpp:56
Generic utility macros and templates for exploring NCBI objects.
Modified on Thu May 23 12:32:39 2024 by modify_doxy.py rev. 669887