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

Go to the SVN repository for this file.

1 /* $Id: gff_base_columns.hpp 99481 2023-04-04 13:16:28Z stakhovv $
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 public 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  * Author: Frank Ludwig
27  *
28  * File Description:
29  * GFF3 transient data structures
30  *
31  */
32 
33 #ifndef OBJTOOLS_READERS___GFF_BASE_COLUMNS__HPP
34 #define OBJTOOLS_READERS___GFF_BASE_COLUMNS__HPP
35 
37 
39 BEGIN_objects_SCOPE
40 
41 // ============================================================================
43 // ============================================================================
44 {
45 public:
47  using TReaderFlags = long; //technical debt: duplicated in reader_base
48  using SeqIdResolver = CRef<CSeq_id> (*)(const string&, TReaderFlags, bool);
49 
51 
53  const CGffBaseColumns& rhs);
54 
55  virtual ~CGffBaseColumns();
56 
57  //
58  // accessors:
59  const string& Id() const {
60  return mSeqId;
61  };
62 
63  TSeqPos SeqStart() const {
64  return m_uSeqStart;
65  };
66 
67  TSeqPos SeqStop() const {
68  return m_uSeqStop;
69  };
70 
71  const string& Source() const {
72  return m_strSource;
73  };
74 
75  const string& Type() const {
76  return m_strType;
77  };
78 
79  const string& NormalizedType() const {
80  return m_strNormalizedType;
81  };
82 
83 
84  double Score() const {
85  return IsSetScore() ? *m_pdScore : 0.0;
86  };
87 
88  ENa_strand Strand() const {
90  };
91 
92  TFrame Phase() const {
94  };
95 
96  bool IsSetScore() const {
97  return m_pdScore != nullptr;
98  }
99 
100  bool IsSetStrand() const {
101  return m_peStrand != nullptr;
102  }
103 
104  bool IsSetPhase() const {
105  return m_pePhase != nullptr;
106  }
107 
109  TReaderFlags,
110  SeqIdResolver = nullptr ) const;
111 
113  TReaderFlags,
114  SeqIdResolver seqidresolve = nullptr) const;
115 
116  // feature initialization:
117  virtual bool InitializeFeature(
118  TReaderFlags,
120  SeqIdResolver = nullptr ) const;
121 
122  virtual void SetExtent(
123  TSeqPos seqStart,
124  TSeqPos seqStop) {
125  m_uSeqStart = seqStart;
126  m_uSeqStop = seqStop;
127  }
128 
129  virtual void SetType(
130  const string& recType) {
131  m_strType = m_strNormalizedType =recType;
133  }
134 
135  virtual bool xInitFeatureId(
136  TReaderFlags,
137  CRef<CSeq_feat> ) const;
138 
139  virtual bool xInitFeatureLocation(
140  TReaderFlags,
142  SeqIdResolver = nullptr ) const;
143 
144  virtual bool xInitFeatureData(
145  TReaderFlags,
146  CRef<CSeq_feat>) const;
147 
148  // utility:
149  static unsigned int NextId() {
150  return ++msNextId;
151  };
152 
153  static void ResetId() {
154  msNextId = 0;
155  };
156 
157 
158 protected:
159  string mSeqId;
162  string m_strSource;
163  string m_strType;
165  double* m_pdScore;
168 
169  static unsigned int msNextId;
170 };
171 
172 
173 END_objects_SCOPE
175 
176 #endif // OBJTOOLS_READERS___GFF_BASE_COLUMNS__HPP
User-defined methods of the data storage class.
#define bool
Definition: bool.h:34
static void ResetId()
ENa_strand * m_peStrand
CRef< CSeq_id > GetSeqId(TReaderFlags, SeqIdResolver=nullptr) const
virtual ~CGffBaseColumns()
TSeqPos SeqStop() const
virtual bool xInitFeatureId(TReaderFlags, CRef< CSeq_feat >) const
CRef< CSeq_loc > GetSeqLoc(TReaderFlags, SeqIdResolver seqidresolve=nullptr) const
static unsigned int msNextId
bool IsSetPhase() const
virtual bool xInitFeatureData(TReaderFlags, CRef< CSeq_feat >) const
CCdregion::EFrame TFrame
virtual bool InitializeFeature(TReaderFlags, CRef< CSeq_feat >, SeqIdResolver=nullptr) const
double Score() const
const string & Source() const
virtual void SetExtent(TSeqPos seqStart, TSeqPos seqStop)
virtual bool xInitFeatureLocation(TReaderFlags, CRef< CSeq_feat >, SeqIdResolver=nullptr) const
const string & Type() const
ENa_strand Strand() const
CRef< CSeq_id >(*)(const string &, TReaderFlags, bool) SeqIdResolver
bool IsSetScore() const
static unsigned int NextId()
TSeqPos SeqStart() const
bool IsSetStrand() const
const string & Id() const
TFrame Phase() const
virtual void SetType(const string &recType)
const string & NormalizedType() const
CRef –.
Definition: ncbiobj.hpp:618
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static string & ToLower(string &str)
Convert string to lower case – string& version.
Definition: ncbistr.cpp:405
@ eFrame_not_set
not set, code uses one
Definition: Cdregion_.hpp:95
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
Modified on Sat Dec 09 04:44:21 2023 by modify_doxy.py rev. 669887