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

Go to the SVN repository for this file.

1 #ifndef SEQANNOT_SPLICER_UTIL__HPP
2 #define SEQANNOT_SPLICER_UTIL__HPP
3 
4 /* $Id: seqannot_splicer_util.hpp 90001 2020-05-04 12:53:02Z ivanov $
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 * Author: David McElhany
30 *
31 * File Description:
32 * See main application file.
33 *
34 * ===========================================================================
35 */
36 
37 #include <list>
38 
39 #include <corelib/ncbiobj.hpp>
40 
41 
42 ///////////////////////////////////////////////////////////////////////////
43 // Typedefs
44 
45 typedef ncbi::CRef<ncbi::objects::CSeq_id> TSeqRef;
46 
47 // TIds is defined by CSeq_annot_Base::C_Data::GetData() and used here.
48 // typedef std::list<TSeqRef> TIds;
49 
50 // Record whether the context of a Seq-annot is the enclosing Bioseq or
51 // Bioseq-set.
55  eBioseq
56 };
57 
58 // Seq-annot Choice Mask Flags
59 // These flags are used to select Seq-annot choices for use in determining
60 // how Seq-annot's get spliced into Seq-entry's.
61 // The exact choice of which Seq-annot types are used depends on the splicing
62 // algorithm.
63 // By default, the 'seq-table' choice is not enabled due to an apparent bug
64 // in parsing seq-table CHOICE values.
66  fSAMF_NotSet = 0, ///< No variant selected
67  fSAMF_Ftable = (1 << 0),
68  fSAMF_Align = (1 << 1),
69  fSAMF_Graph = (1 << 2),
70  fSAMF_Ids = (1 << 3), ///< used for communication between tools
71  fSAMF_Locs = (1 << 4), ///< used for communication between tools
72  fSAMF_Seq_table = (1 << 5),
73  fSAMF_All = (1 << 6) - 1,
76 };
77 typedef unsigned int TSeqAnnotChoiceMaskFlags; ///< Binary OR of "ESeqAnnotChoiceMaskFlags"
78 
79 
80 // Seq-id Choice Mask Flags
81 // These flags are used to select Seq-id choices for use in determining
82 // how Seq-annot's get spliced into Seq-entry's.
83 // The exact choice of which Seq-id types are used depends on the splicing
84 // algorithm.
85 // By default, the 'local' choice is not enabled because local Seq-id's may
86 // not be meaningful across many Seq-entry files. On the other hand, it's
87 // quite conceivable that it might be desirable to work only with local
88 // Seq-id's.
90  fSIMF_NotSet = 0, ///< No variant selected
91  fSIMF_Local = (1 << 0), ///< local use
92  fSIMF_Gibbsq = (1 << 1), ///< Geninfo backbone seqid
93  fSIMF_Gibbmt = (1 << 2), ///< Geninfo backbone moltype
94  fSIMF_Giim = (1 << 3), ///< Geninfo import id
95  fSIMF_Genbank = (1 << 4),
96  fSIMF_Embl = (1 << 5),
97  fSIMF_Pir = (1 << 6),
98  fSIMF_Swissprot = (1 << 7),
99  fSIMF_Patent = (1 << 8),
100  fSIMF_Other = (1 << 9), ///< for historical reasons, 'other' = 'refseq'
101  fSIMF_General = (1 << 10), ///< for other databases
102  fSIMF_Gi = (1 << 11), ///< GenInfo Integrated Database
103  fSIMF_Ddbj = (1 << 12),
104  fSIMF_Prf = (1 << 13), ///< PRF SEQDB
105  fSIMF_Pdb = (1 << 14), ///< PDB sequence
106  fSIMF_Tpg = (1 << 15), ///< Third Party Annot/Seq Genbank
107  fSIMF_Tpe = (1 << 16), ///< Third Party Annot/Seq EMBL
108  fSIMF_Tpd = (1 << 17), ///< Third Party Annot/Seq DDBJ
109  fSIMF_Gpipe = (1 << 18), ///< Internal NCBI genome pipeline processing ID
110  fSIMF_Named_annot_track = (1 << 19), ///< Internal named annotation tracking ID
111  fSIMF_All = (1 << 20) - 1,
114 };
115 typedef unsigned int TSeqIdChoiceMaskFlags; ///< Binary OR of "ESeqIdChoiceMaskFlags"
116 
117 
118 ///////////////////////////////////////////////////////////////////////////
119 // Program global function declarations
120 
121 extern void AddSeqIdToCurrentContext(ncbi::CRef<ncbi::objects::CSeq_id> id);
122 
123 extern void ContextEnd(void);
124 extern void ContextStart(ncbi::CObjectIStream& in, EContextType type);
125 
126 extern void ContextEnter(void);
127 extern void ContextLeave(void);
128 
129 extern void ContextInit(void);
130 
131 extern void CurrentContextContainsSeqAnnots(void);
132 
134 
136 extern bool IsSeqAnnotChoiceSelected(const ncbi::objects::CSeq_annot* annot);
137 
139 extern bool IsSeqIdChoiceSelected(const ncbi::objects::CSeq_id* seqid);
140 
141 extern void ProcessSeqEntryAnnot(std::unique_ptr<ncbi::CObjectIStream>& sai,
142  ncbi::COStreamContainer& osc);
143 
144 extern void ResetSeqEntryProcessing(void);
145 
146 extern void SeqAnnotMapSeqId(TSeqRef seqid);
147 
148 extern void SeqAnnotSet_Pre(ncbi::CObjectIStream& in);
149 
152 
153 extern void SetSeqIdChoiceMask(const std::string& mask);
155 
156 
157 #endif /* SEQANNOT_SPLICER_UTIL__HPP */
ncbi::TMaskedQueryRegions mask
static uch flags
string
Definition: cgiapp.hpp:690
ESerialDataFormat
Data file format.
Definition: serialdef.hpp:71
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
std::istream & in(std::istream &in_, double &x_)
unsigned int TSeqAnnotChoiceMaskFlags
Binary OR of "ESeqAnnotChoiceMaskFlags".
ESeqIdChoiceMaskFlags
@ fSIMF_Gpipe
Internal NCBI genome pipeline processing ID.
@ fSIMF_General
for other databases
@ fSIMF_Prf
PRF SEQDB.
@ fSIMF_Tpg
Third Party Annot/Seq Genbank.
@ fSIMF_Swissprot
@ fSIMF_Local
local use
@ fSIMF_Giim
Geninfo import id.
@ fSIMF_NotSet
No variant selected.
@ fSIMF_Gi
GenInfo Integrated Database.
@ fSIMF_Pdb
PDB sequence.
@ fSIMF_AllButLocal
@ fSIMF_Named_annot_track
Internal named annotation tracking ID.
@ fSIMF_Tpe
Third Party Annot/Seq EMBL.
@ fSIMF_Gibbsq
Geninfo backbone seqid.
@ fSIMF_Other
for historical reasons, 'other' = 'refseq'
@ fSIMF_Tpd
Third Party Annot/Seq DDBJ.
@ fSIMF_Gibbmt
Geninfo backbone moltype.
bool IsSeqIdChoiceSelected(TSeqIdChoiceMaskFlags flags)
void SetSeqIdChoiceMask(const std::string &mask)
ncbi::CRef< ncbi::objects::CSeq_id > TSeqRef
void ContextEnter(void)
unsigned int TSeqIdChoiceMaskFlags
Binary OR of "ESeqIdChoiceMaskFlags".
void ProcessSeqEntryAnnot(std::unique_ptr< ncbi::CObjectIStream > &sai, ncbi::COStreamContainer &osc)
void CurrentContextContainsSeqAnnots(void)
void AddSeqIdToCurrentContext(ncbi::CRef< ncbi::objects::CSeq_id > id)
void ContextEnd(void)
ESeqAnnotChoiceMaskFlags
@ fSAMF_Ids
used for communication between tools
@ fSAMF_Locs
used for communication between tools
@ fSAMF_NotSet
No variant selected.
@ fSAMF_Seq_table
@ fSAMF_AllButSeq_table
void SetSeqAnnotChoiceMask(const std::string &mask)
void ResetSeqEntryProcessing(void)
void SeqAnnotSet_Pre(ncbi::CObjectIStream &in)
void ContextLeave(void)
void SeqAnnotMapSeqId(TSeqRef seqid)
void ContextStart(ncbi::CObjectIStream &in, EContextType type)
ncbi::ESerialDataFormat GetFormat(const std::string &name)
void ContextInit(void)
bool IsSeqAnnotChoiceSelected(TSeqAnnotChoiceMaskFlags flags)
Definition: type.c:6
Modified on Fri Sep 20 14:58:23 2024 by modify_doxy.py rev. 669887