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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_DS__HPP
2 #define GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_DS__HPP
3 
4 /* $Id: seqgraphic_graph_ds.hpp 41371 2018-07-18 15:24:05Z shkeda $
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: Liangshou Wu
30  *
31  * File Description:
32  *
33  */
34 
37 #include <gui/utils/extension.hpp>
38 
39 
41 
42 
43 ///////////////////////////////////////////////////////////////////////////////
44 /// CSGGraphDS
45 ///
47 {
48 public:
49 
51  CSGGraphDS(objects::CScope& scope, const objects::CSeq_id& id);
52 
53  void SetSeqTable(bool f);
54  bool IsSeqTable() const;
55 
56  void LoadSeqGraphs(
57  const string& annotName,
58  objects::SAnnotSelector& sel,
60  bool fixed_scale,
61  const TAxisLimits& y_limits,
63 
64  void GetAnnotNames(objects::SAnnotSelector& sel,
66  bool seq_table = false) const;
67 
68  void GetSeqtableAnnots(objects::SAnnotSelector& sel,
69  const TSeqRange& range,
70  TAnnotNameTitleMap& names) const;
71 
72  void SetGraphCacheKey(const string& graph_cache_key);
73 
74 private:
75  bool m_SeqTable; ///< create graph from seq-table
77 
78 };
79 
80 
81 ///////////////////////////////////////////////////////////////////////////////
82 /// CSGGraphDSType
83 ///
85  public CObject,
86  public ISGDataSourceType,
87  public IExtension
88 {
89 public:
90  /// create an instance of the layout track type using default settings.
91  virtual ISGDataSource* CreateDS(SConstScopedObject& object) const;
92 
93  /// @name IExtension interface implementation
94  /// @{
95  virtual string GetExtensionIdentifier() const;
96  virtual string GetExtensionLabel() const;
97  /// @}
98 
99  /// check if the data source can be shared.
100  virtual bool IsSharable() const;
101 };
102 
103 
104 ///////////////////////////////////////////////////////////////////////////////
105 /// CSGSeqGraphJob
106 ///
107 
109 {
110 public:
111 
112  CSGSeqGraphJob(const string& desc,
113  objects::CBioseq_Handle handle,
114  const string& annotName,
115  const objects::SAnnotSelector& sel, const TSeqRange& range,
116  TModelUnit window, bool fixed_scale, const TAxisLimits& y_limits,
118  bool seq_table = false)
119  : CSGAnnotJob(desc, handle, sel, range)
120  , m_AnnotName(annotName)
121  , m_Window(window)
122  , m_FixedScale(fixed_scale)
123  , m_YLimits(y_limits)
124  , m_Config(config)
125  , m_SeqTable(seq_table)
126  {}
127 
128  static void GetAnnotNames(const objects::CBioseq_Handle& handle,
129  const TSeqRange& range, objects::SAnnotSelector& sel,
130  TAnnotNameTitleMap& names, bool seq_table = false);
131 
132  static void GetSeqtableAnnots(const objects::CBioseq_Handle& handle,
133  const TSeqRange& range, objects::SAnnotSelector& sel,
135 
136  void SetGraphCacheKey(const string& graph_cache_key);
137 
138 protected:
139  virtual EJobState x_Execute();
140 
141 private:
143 
145 
147 
148 private:
149  string m_AnnotName;
150  TModelUnit m_Window; ///< current window for smear bars
151  bool m_FixedScale; ///< use global scale or dynamic scale
154  bool m_SeqTable; ///< create graph from seq-table
156 
157 };
158 
159 
160 
161 ///////////////////////////////////////////////////////////////////////////////
162 /// inline methods
163 inline
165 {
166  m_SeqTable = f;
167 }
168 
169 inline
171 {
172  return m_SeqTable;
173 }
174 
175 inline
176 void CSGGraphDS::SetGraphCacheKey(const string& graph_cache_key)
177 {
178  m_GraphCacheKey = graph_cache_key;
179 }
180 
181 inline
182 void CSGSeqGraphJob::SetGraphCacheKey(const string& graph_cache_key)
183 {
184  m_GraphCacheKey = graph_cache_key;
185 }
186 
188 
189 #endif // GUI_WIDGETS_SEQ_GRAPHIC___GRAPH_DS__HPP
CObject –.
Definition: ncbiobj.hpp:180
CRenderingContext offers the basic context and utility methods for rendering layout objects in featur...
CSGGraphDSType.
void SetSeqTable(bool f)
inline methods
bool IsSeqTable() const
void SetGraphCacheKey(const string &graph_cache_key)
bool m_SeqTable
create graph from seq-table
CSGAnnotJob::TAxisLimits TAxisLimits
CConstRef< CSeqGraphicConfig > m_Config
bool m_FixedScale
use global scale or dynamic scale
void SetGraphCacheKey(const string &graph_cache_key)
IAppJob::EJobState x_LoadGraph()
bool m_SeqTable
create graph from seq-table
IAppJob::EJobState x_LoadSeqTable()
TModelUnit m_Window
current window for smear bars
static void GetAnnotNames(const objects::CBioseq_Handle &handle, const TSeqRange &range, objects::SAnnotSelector &sel, TAnnotNameTitleMap &names, bool seq_table=false)
CSGSeqGraphJob.
CSGSeqGraphJob(const string &desc, objects::CBioseq_Handle handle, const string &annotName, const objects::SAnnotSelector &sel, const TSeqRange &range, TModelUnit window, bool fixed_scale, const TAxisLimits &y_limits, CConstRef< CSeqGraphicConfig > config, bool seq_table=false)
IAppJob::EJobState x_LoadGraphFromCoverageGraph()
virtual EJobState x_Execute()
method truly doing the job.
static void GetSeqtableAnnots(const objects::CBioseq_Handle &handle, const TSeqRange &range, objects::SAnnotSelector &sel, TAnnotNameTitleMap &names)
map< string, string > TAnnotNameTitleMap
List of annotations with the corresponding titles.
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
ISGDataSourceFactory.
File Description:
CS_CONTEXT * ctx
Definition: t0006.c:12
static const struct name_t names[]
GLdouble TModelUnit
Definition: gltypes.hpp:48
EJobState
Job states (describe FSM)
Definition: app_job.hpp:86
#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_GUIWIDGETS_SEQGRAPHIC_EXPORT
Definition: gui_export.h:536
range(_Ty, _Ty) -> range< _Ty >
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
Modified on Mon Feb 26 04:01:08 2024 by modify_doxy.py rev. 669887