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

Go to the SVN repository for this file.

1 #ifndef PKG_SEQUENCE___COLUMNAR_VCF_LOAD_MANAGER__HPP
2 #define PKG_SEQUENCE___COLUMNAR_VCF_LOAD_MANAGER__HPP
3 
4 /* $Id: columnar_vcf_load_manager.hpp 46175 2021-01-28 15:47:23Z evgeniev $
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: Vladislav Evgeniev
30 *
31 * File Description:
32 *
33 */
34 
35 #include <corelib/ncbistl.hpp>
36 #include <corelib/ncbiobj.hpp>
37 
39 
43 
44 #include <gui/utils/extension.hpp>
45 
49 
51 
52 
53 /** @addtogroup GUI_PKG_SEQUENCE
54 *
55 * @{
56 */
57 
62 
63 ///////////////////////////////////////////////////////////////////////////////
64 /// CColumnarVCFLoaderManager
66  public CObject,
68  public IFileLoadPanelClient,
69  public IToolWizard,
70  public IExtension,
71  public IRegSettings
72 {
73 public:
75 
76  /// @name IFileLoadPanelClient interface implementation
77  /// @{
78  virtual string GetLabel() const;
79  virtual wxString GetFormatWildcard() const;
80  virtual string GetFileLoaderId() const { return Id(); }
81  /// @}
82 
83  /// @name IUILoadManager interface implementation
84  /// @{
85  virtual void SetServiceLocator(IServiceLocator* srv_locator);
86  virtual void SetParentWindow(wxWindow* parent);
87  virtual const IUIObject& GetDescriptor() const;
88  virtual void InitUI();
89  virtual void CleanUI();
90  virtual wxPanel* GetCurrentPanel();
91  virtual bool CanDo(EAction action);
92  virtual bool IsFinalState();
93  virtual bool IsCompletedState();
94  virtual bool DoTransition(EAction action);
95  virtual IAppTask* GetTask();
96  virtual IExecuteUnit* GetExecuteUnit();
97  virtual IWizardPage* GetFirstPage() { return nullptr; }
98  virtual IWizardPage* GetOptionsPage() { return nullptr; }
99  virtual void SetPrevPage(IWizardPage* prevPage) {}
100  /// @}
101 
102  /// @{ IFileFormatLoaderManager - additional members
103  /// @{
104  virtual wxString GetFormatWildcard();
105  virtual bool ValidateFilenames(const vector<wxString>& filenames);
106  virtual void SetFilenames(const vector<wxString>& filenames);
107  virtual void GetFilenames(vector<wxString>& filenames) const;
108  virtual bool IsInitialState();
109  virtual bool RecognizeFormat(const wxString& filename);
110  virtual bool RecognizeFormat(CFormatGuess::EFormat fmt);
111  /// @}
112 
113  /// @name IExtension interface implementation
114  /// @{
115  virtual string GetExtensionIdentifier() const;
116  virtual string GetExtensionLabel() const;
117  /// @}
118 
119  /// @name IRegSettings interface implementation
120  /// @{
121  virtual void SetRegistryPath(const string& path);
122  virtual void LoadSettings();
123  virtual void SaveSettings() const;
124  /// @}
125 
126  static string Id() { return "file_loader_vcf"; }
127  static string Label() { return "Variant Call Format"; }
128 
129 protected:
130  enum EState {
131  eInvalid = -1,
136  eCompleted
137  };
138 
139  void x_GetRefSeqs();
140 
141 protected:
143 
145  wxWindow* m_ParentWindow{ nullptr };
147  string m_RegPath;
148 
149  vector<wxString> m_FileNames;
150 
151  string m_AssmAcc; // assembly accession received from GenColl
153  vector<CConstRef<objects::CSeq_id>> m_RefSeqIds;
155  size_t m_TopLevelSeqCount = 0;
156 
161 
163 };
164 
165 /* @} */
166 
168 
169 
170 #endif // PKG_SEQUENCE___COLUMNAR_VCF_LOAD_MANAGER__HPP
User-defined methods of the data storage class.
CColumnarVCFLoaderManager.
Class responsible to read VCF files.
EFormat
The formats are checked in the same order as declared here.
CObject –.
Definition: ncbiobj.hpp:180
CUIObject - default mix-in implementation of IUIObject.
Definition: ui_object.hpp:81
IAppTask.
Definition: app_task.hpp:83
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
IFileFormatLoaderManager.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
IUIObject - object that provides basic properties often required in a UI object.
Definition: ui_object.hpp:63
Definition: map.hpp:338
virtual wxPanel * GetCurrentPanel()
Return the panel corresponding to the current state of Tool Manager.
virtual string GetExtensionLabel() const
returns a displayable label for this extension ( please capitalize the key words - "My Extension" )
virtual void SetPrevPage(IWizardPage *prevPage)
Sets a wizard page which should show before the first page of the tool.
virtual bool ValidateFilenames(const vector< wxString > &filenames)
checks given filenames and returns true if the manager can handle them, otherwise - shows an error me...
virtual void InitUI()
Initializes the Manager before using it in UI.
virtual void SetFilenames(const vector< wxString > &filenames)
initilize the manager with the given filenames
virtual bool DoTransition(EAction action)
Performs transition if possible and returns true, otherwise the function shall warn the user about th...
virtual bool IsInitialState()
return true if the current state of the loader UI is the first valid state (first step in a wizard-li...
virtual void SetServiceLocator(IServiceLocator *srv_locator)
Sets / unsets Service Locator.
virtual void CleanUI()
CleanUI() is called after the host finished using the manager.
virtual bool IsFinalState()
True if Tool Manager has reached its final state, i.e.
CVcfAssemblySelectionPanel * m_AssemblyPanel
virtual bool IsCompletedState()
Manager goes into "Complete" state when "Finish" button is pressed and all input data is gatherred an...
virtual void SetParentWindow(wxWindow *parent)
virtual bool RecognizeFormat(const wxString &filename)
return true if the given file format is supported by this manager
virtual void GetFilenames(vector< wxString > &filenames) const
get actual filenames that will be opened
virtual IAppTask * GetTask()
Once parameters are gathered and validated this function is called to produce the final Task object t...
vector< CConstRef< objects::CSeq_id > > m_RefSeqIds
CRef< objects::CGC_Assembly > m_GenCollAssm
CVcfSampleSelectionPanel * m_SamplesPanel
virtual IWizardPage * GetFirstPage()
Returns first options page (if any) of the tool to be shown in wizard dialog.
map< string, set< string > > m_MappedSeqIds
CVcfRefSequencesPanel * m_RefSequencesPanel
virtual string GetFileLoaderId() const
virtual bool CanDo(EAction action)
Indicates whether given transition is possible in the current state.
virtual IExecuteUnit * GetExecuteUnit()
CVcfColumnSelectionPanel * m_ColumnsPanel
virtual wxString GetFormatWildcard() const
return file wildcard for the format (example - "*.txt;*.tab" )
CColumnarVCFLoaderManager()
CColumnarVCFLoaderManager.
virtual const IUIObject & GetDescriptor() const
Returns the object describing this tool (UI meta data).
virtual string GetExtensionIdentifier() const
returns the unique human-readable identifier for the extension the id should use lowercase letters se...
virtual void SetRegistryPath(const string &path)
virtual IWizardPage * GetOptionsPage()
Returns page for tool options (long wizard path via "Options" button)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
The NCBI C++/STL use hints.
static int filenames
Definition: pcregrep.c:172
Modified on Sat May 25 14:22:45 2024 by modify_doxy.py rev. 669887