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

Go to the SVN repository for this file.

1 #ifndef GUI_SERVICES___ORF_SEARCH_TOOL_HPP
2 #define GUI_SERVICES___ORF_SEARCH_TOOL_HPP
3 
4 /* $Id: orf_search_tool.hpp 39744 2017-10-31 21:12:13Z katargir $
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: Andrey Yazhuk
30  *
31  * File Description:
32  *
33  */
34 
37 
38 #include <util/xregexp/regexp.hpp>
39 #include <util/range_coll.hpp>
40 
41 #include <objmgr/seq_vector.hpp>
42 
43 
44 
45 class wxTextCtrl;
46 class wxChoice;
47 class wxSearchCtrl;
48 class wxFlexGridSizer;
49 
50 
52 
53 
54 /** @addtogroup GUI_PKG_SEQUENCE
55  *
56  * @{
57  */
58 
59 
60 ///////////////////////////////////////////////////////////////////////////////
61 /// COrfSearchTool
63 {
64 public:
66 
67  /// @name IUITool implementation
68  /// @{
69  virtual IUITool* Clone() const;
70  virtual string GetName() const;
71  virtual string GetDescription() const;
72  /// @}
73 
74  /// @name IDMSearchTool implementation
75  /// @{
79  /// @}
80 
81  /// @name IExtension implementation
82  /// @{
83  virtual string GetExtensionIdentifier() const;
84  virtual string GetExtensionLabel() const;
85  /// @}
86 
87 protected:
88  /// implementing CSearchToolBase pure virtual function
90 };
91 
92 
93 ///////////////////////////////////////////////////////////////////////////////
94 /// COrfSearchTool
96  public CSearchQueryBase
97 {
98 public:
100  const string& gc,
101  const string& so,
102  const string& mp);
103 
104  string GetGencode() { return m_Gencode; }
105  string GetStartOrf() { return m_StartOrf; }
106  string GetMinPairs() { return m_MinPairs; }
107 
108  virtual string ToString() const;
109 
110 protected:
111  string m_Gencode;
112  string m_StartOrf;
113  string m_MinPairs;
114 };
115 
116 
117 ///////////////////////////////////////////////////////////////////////////////
118 /// COrfSearchForm
119 class CComboBox;
120 
122 {
123 public:
125 
126  struct SKozakPattern {
127  SKozakPattern(const string& name, const string& regexp, int codon_pos)
128  : m_Name(name), m_Regexp(regexp), m_Codon_pos(codon_pos) {}
129  string m_Name;
130  string m_Regexp;
132  };
133 
134  typedef struct SKozakPattern TKozakPattern;
135  typedef list<TKozakPattern> TKozakList;
136 
138  ~COrfSearchForm();
139 
140  /// @name IDMSearchForm implementation
141  /// @{
142  virtual void Create();
143  virtual void Init();
144  virtual void Update();
145  /// @}
146 
148  virtual wxSizer * GetWidget(wxWindow * parent);
149 
151 protected:
152  virtual void x_LoadSettings(const CRegistryReadView& view);
153  virtual void x_SaveSettings(CRegistryWriteView view) const;
154 
155  virtual IDMSearchTool* x_GetTool();
156 
157  void x_UpdateKozak();
158 protected:
160 
161  wxChoice * m_DbCombo;
162  wxChoice * m_GencodeCombo;
163  wxChoice * m_StartorfCombo;
164  wxTextCtrl * m_BasepairsText;
165  vector<ISeqLocSearchContext*> m_SeqLocContexts;
166 
167  string m_Gencode;
168  string m_StartOrf;
169  string m_MinPairs;
170 
171 };
172 
173 
174 
175 ///////////////////////////////////////////////////////////////////////////////
176 /// COrfSearchJob
177 ///
179 {
180 public:
182 
183 protected:
187 
188  /// @name CSearchJobBase overridables
189  /// @{
190  virtual bool x_ValidateParams();
191  virtual IAppJob::EJobState x_DoSearch();
192  virtual void x_SetupColumns(CObjectList& obj_list);
193 
194  virtual CObjectListTableModel* x_GetNewOLTModel() const;
195  /// @}
196 
197  int x_DecodeGeneticCode(const string& s);
198 
199  void x_AddToResults(CObject& obj, objects::CScope& scope,
200  int start,
201  int stop,
202  const string& strand,
203  int length,
204  int p_length,
205  const string& start_cdn,
206  const string& stop_cdn,
207  const string& translated_seq,
208  const string& nucleotide_seq,
209  const string& start_context,
210  const string& ctx_name,
211  const string& kozak,
212  int k_loc,
213  int color);
214 
215 
216 protected:
220 };
221 
222 
223 /* @} */
224 
226 
227 #endif // GUI_SERVICES___ORF_SEARCH_TOOL_HPP
CObjectListTableModel.
CObjectList Data structure representing a list of CObjects with associated Scopes and other optional ...
Definition: object_list.hpp:63
CObject –.
Definition: ncbiobj.hpp:180
COrfSearchJob.
COrfSearchTool.
COrfSearchTool.
CRef –.
Definition: ncbiobj.hpp:618
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CSearchFormBase.
CSearchJobBase.
CSearchQueryBase.
vector< SScopedLoc > TScopedLocs
CSearchToolBase.
IDMSearchQuery - abstract data mining query.
IDMSearchTool interface representing a single search tool in Data Mining Service.
IDataMiningContext IDataMiningContext represents an abstract context for a Search.
IUITool represents an abstract algorithm that is bound to a UI component.
Definition: ui_tool.hpp:59
COrfSearchQuery::SScopedLoc TScopedLoc
COrfSearchJob(COrfSearchQuery &query, const COrfSearchForm::TKozakList &kozakList)
COrfSearchJob.
void x_AddToResults(CObject &obj, objects::CScope &scope, int start, int stop, const string &strand, int length, int p_length, const string &start_cdn, const string &stop_cdn, const string &translated_seq, const string &nucleotide_seq, const string &start_context, const string &ctx_name, const string &kozak, int k_loc, int color)
virtual IUITool * Clone() const
SKozakPattern(const string &name, const string &regexp, int codon_pos)
virtual void Update()
virtual CIRef< IDMSearchForm > CreateSearchForm()
factory method for creating a form representing the tool
COrfSearchQuery::TScopedLocs TScopedLocs
vector< ISeqLocSearchContext * > m_SeqLocContexts
COrfSearchForm::TKozakList m_KozakList
int x_DecodeGeneticCode(const string &s)
virtual bool x_ValidateParams()
returns true if Job params are correct, implement in derived classes
COrfSearchTool()
COrfSearchTool.
virtual void Init()
CRangeCollection< TSeqPos > TRangeCollection
virtual CRef< CSearchJobBase > x_CreateJob(IDMSearchQuery &query)
implementing CSearchToolBase pure virtual function
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
virtual void Create()
virtual void x_LoadSettings(const CRegistryReadView &view)
virtual wxSizer * GetWidget(wxWindow *parent)
return a widget associated with the form; the form controls the lifetime of the widget (do not delete...
wxChoice * m_DbCombo
virtual IDMSearchTool * x_GetTool()
virtual IAppJob::EJobState x_DoSearch()
performs searching, assuming that params are correct; Implement in derived classes
COrfSearchQuery::TScopedLocs TScopedLocs
list< TKozakPattern > TKozakList
CRef< COrfSearchQuery > m_Query
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
COrfSearchQuery(TScopedLocs &locs, const string &gc, const string &so, const string &mp)
COrfSearchQuery.
virtual string ToString() const
Prepare a string representation of a query (for logging and debugging)
virtual string GetDescription() const
returns a detailed description of the method that is used in UI
COrfSearchForm(COrfSearchTool &tool)
COrfSearchForm.
wxChoice * m_GencodeCombo
virtual void x_SetupColumns(CObjectList &obj_list)
add custom columns if needed
virtual IDMSearchTool::TUIToolFlags GetFlags(void)
special flags
virtual void x_SaveSettings(CRegistryWriteView view) const
virtual CIRef< IDMSearchQuery > ConstructQuery()
static TKozakList m_Kozak
wxTextCtrl * m_BasepairsText
virtual CObjectListTableModel * x_GetNewOLTModel() const
factory method creating new column handler for CObjectListWidget
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
CRef< COrfSearchTool > m_Tool
virtual bool IsCompatible(IDataMiningContext *context)
retuns true if the tool is compatible with the provided Search Context
wxChoice * m_StartorfCombo
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
n background color
static string query
C++ wrappers for the Perl-compatible regular expression (PCRE) library.
static CS_CONTEXT * context
Definition: will_convert.c:21
Modified on Fri May 24 14:56:55 2024 by modify_doxy.py rev. 669887