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

Go to the SVN repository for this file.

1 /* $Id: Seq_annot.hpp 96338 2022-03-16 11:46:33Z grichenk $
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: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the data definition file
34  * 'seq.asn'.
35  */
36 
37 #ifndef OBJECTS_SEQ_SEQ_ANNOT_HPP
38 #define OBJECTS_SEQ_SEQ_ANNOT_HPP
39 
40 
41 // generated includes
43 
44 // generated classes
45 
47 
48 class CTime;
49 
50 
51 BEGIN_objects_SCOPE // namespace ncbi::objects::
52 
53 class CUser_object;
54 class CDate;
55 
56 
58 {
60 public:
61  // constructor
62  CSeq_annot(void);
63  // destructor
64  ~CSeq_annot(void);
65 
66  // Removes any existing CAnnotdesc(s) of type name and adds
67  // new CAnnotdesc of type name
68  NCBI_DEPRECATED void AddName(const string &name);
69  void SetNameDesc(const string &name);
70 
71  // Adds a CAnnotdesc of type title. This will replace any previous
72  // title fields.
73  void SetTitleDesc(const string &title);
74  NCBI_DEPRECATED void AddTitle(const string &title);
75 
76  // SetTitle() is deprecated; use AddTitle() instead
77  // @deprecated
78  NCBI_DEPRECATED void SetTitle(const string &title);
79 
80  // Adds a CAnnotdesc of type comment
81  void AddComment(const string &comment);
82 
83  // Add/Set the create-date field
84  void SetCreateDate(const CTime& dt);
85  void SetCreateDate(CDate& dt);
86 
87  // Add/Set the create-date field
88  void SetUpdateDate(const CTime& dt);
89  void SetUpdateDate(CDate& dt);
90 
91  // add a user-object descriptor
92  void AddUserObject(CUser_object& obj);
93 
94  // check annot type
95  bool IsFtable(void) const;
96  bool IsAlign(void) const;
97  bool IsGraph(void) const;
98  bool IsIds(void) const;
99  bool IsLocs(void) const;
100  bool IsSeq_table(void) const;
101 
102  /// Extract optional zoom level suffix from named annotation string.
103  /// returns true if zoom level explicitly defined in the full_name argument.
104  /// The accession string without zoom level will be written
105  /// by acc_ptr pointer if it's not null.
106  /// Zoom level will be written by zoom_level_ptr pointer if it's not null.
107  /// Absent zoom level will be represented by value 0.
108  /// Wildcard zoom level will be represented by value -1.
109  static bool ExtractZoomLevel(const string& full_name,
110  string* acc_ptr, int* zoom_level_ptr);
111 
112  /// Combine accession string and zoom level into a string with separator.
113  /// If the argument string already contains zoom level verify it's the same
114  /// as the zoom_level argument.
115  /// Zoom level value of -1 can be used to add wildcard @@*.
116  static string CombineWithZoomLevel(const string& acc, int zoom_level);
117  static void AddZoomLevel(string& acc, int zoom_level);
118 
119 private:
120  // Prohibit copy constructor and assignment operator
123 
124 };
125 
126 
128 {
129 public:
130  enum EErrCode {
131  eZoom, //< Bad zoom level
132  eOther //< Other errors
133  };
134 
135  virtual const char* GetErrCodeString(void) const override;
136 
138 };
139 
140 
141 /// Named annotations zoom level can be encoded in the accession string
142 /// with @@ suffix, for example: NA000000001.1@@1000
143 /// zoom level is the number of bases covered by single value in a annotation
144 /// density graph.
145 
146 #define NCBI_ANNOT_TRACK_ZOOM_LEVEL_SUFFIX "@@"
147 
148 
149 /////////////////// CSeq_annot inline methods
150 
151 // constructor
152 inline
154 {
155 }
156 
157 
158 /////////////////// end of CSeq_annot inline methods
159 
160 
161 END_objects_SCOPE // namespace ncbi::objects::
162 
164 
165 #endif // OBJECTS_SEQ_SEQ_ANNOT_HPP
166 /* Original file checksum: lines: 93, chars: 2396, CRC32: bdd8950d */
Data storage class.
Definition: Date.hpp:53
NCBI_EXCEPTION_DEFAULT(CSeqAnnotException, CException)
features in table form
Definition: Seq_annot_.hpp:86
CSeq_annot_Base Tparent
Definition: Seq_annot.hpp:59
CSeq_annot & operator=(const CSeq_annot &value)
CSeq_annot(void)
Definition: Seq_annot.hpp:153
CSeq_annot(const CSeq_annot &value)
CTime –.
Definition: ncbitime.hpp:296
bool SetUpdateDate(CCdCore *cd)
Definition: cuCD.cpp:234
EErrCode
Error types that an application can generate.
Definition: ncbiexpt.hpp:884
string CombineWithZoomLevel(const string &acc, int zoom_level)
Combine accession string and zoom level into a string with separator.
void AddZoomLevel(string &acc, int zoom_level)
bool ExtractZoomLevel(const string &full_name, string *acc_ptr, int *zoom_level_ptr)
Extract optional zoom level suffix from named annotation string.
#define NCBI_DEPRECATED
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_SEQ_EXPORT
Definition: ncbi_export.h:825
void AddComment(CSeq_feat &feat, const string &comment)
Definition: utils.cpp:44
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
static void AddTitle(CRef< CSeq_entry > entry, string defline)
static void SetTitle(CRef< CSeq_entry > entry, string title)
Modified on Wed Apr 17 13:10:40 2024 by modify_doxy.py rev. 669887