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

Go to the SVN repository for this file.

1 #ifndef OBJTOOLS_DATA_LOADERS_SNP___SNPLOADER__HPP
2 #define OBJTOOLS_DATA_LOADERS_SNP___SNPLOADER__HPP
3 
4 /* $Id: snploader.hpp 99748 2023-05-08 11:55:17Z grichenk $
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  * Author: Eugene Vasilchenko
30  *
31  * File Description: SNP file data loader
32  *
33  * ===========================================================================
34  */
35 
36 #include <corelib/ncbistd.hpp>
37 #include <objmgr/data_loader.hpp>
38 
41 
43 
44 //
45 // class CSNPDataLoader is used to retrieve alignments and short sequences
46 // from SNP-DB
47 //
48 
50 {
51 public:
52  typedef vector<string> TVDBFiles;
54  {
55  SLoaderParams();
56 
57  string GetLoaderName(void) const;
58 
59  string m_DirPath;
61  string m_AnnotName;
62  bool m_AddPTIS;
63  };
64 
65 
69  const SLoaderParams& params,
78  const string& vdb_file,
83  const TVDBFiles& vdb_files,
88  const string& dir_path,
89  const string& file,
94  const string& dir_path,
95  const vector<string>& files,
98 
99  static string GetLoaderNameFromArgs(void);
100  static string GetLoaderNameFromArgs(const SLoaderParams& params);
101  static string GetLoaderNameFromArgs(const string& vdb_file);
102  static string GetLoaderNameFromArgs(const TVDBFiles& vdb_files);
103  static string GetLoaderNameFromArgs(const string& dir_path,
104  const string& vdb_file);
105  static string GetLoaderNameFromArgs(const string& dir_path,
106  const TVDBFiles& vdb_files);
107 
108  virtual CObjectManager::TPriority GetDefaultPriority(void) const override;
109 
110  typedef vector<CAnnotName> TAnnotNames;
111  TAnnotNames GetPossibleAnnotNames(void) const;
112 
113  virtual TBlobId GetBlobIdFromString(const string& str) const override;
114 
115  virtual bool CanGetBlobById(void) const override;
116  virtual TTSE_Lock GetBlobById(const TBlobId& blob_id) override;
117 
118  virtual TTSE_LockSet GetRecords(const CSeq_id_Handle& idh,
119  EChoice choice) override;
121  const SAnnotSelector* sel,
122  TProcessedNAs* processed_nas) override;
123  virtual void GetChunk(TChunk chunk) override;
124  virtual void GetChunks(const TChunkSet& chunks) override;
125 
126  static bool IsUsingPTIS();
127 
128  // Global default SNP scale limit.
129  static CSeq_id::ESNPScaleLimit GetSNP_Scale_Limit(void);
130  static void SetSNP_Scale_Limit(CSeq_id::ESNPScaleLimit value);
131 
132 private:
135 
136  // default constructor
138  // parametrized constructor
139  CSNPDataLoader(const string& loader_name,
140  const SLoaderParams& params);
141  ~CSNPDataLoader(void);
142 
144 };
145 
146 
148 
149 
151 
153 
154 extern "C"
155 {
156 
161 
162 } // extern C
163 
164 
166 
167 #endif // OBJTOOLS_DATA_LOADERS_SNP___SNPLOADER__HPP
CObjectManager –.
static string GetLoaderNameFromArgs(const TVDBFiles &vdb_files)
vector< string > TVDBFiles
Definition: snploader.hpp:52
CParamLoaderMaker< CSNPDataLoader, SLoaderParams > TMaker
Definition: snploader.hpp:133
CSNPDataLoader(void)
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const TVDBFiles &vdb_files, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
vector< CAnnotName > TAnnotNames
Definition: snploader.hpp:110
static string GetLoaderNameFromArgs(const string &dir_path, const TVDBFiles &vdb_files)
SRegisterLoaderInfo< CSNPDataLoader > TRegisterLoaderInfo
Definition: snploader.hpp:66
CRef< CSNPDataLoader_Impl > m_Impl
Definition: snploader.hpp:143
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
Definition: stats.c:84
ESNPScaleLimit
SNP annotation scale limits.
Definition: Seq_id.hpp:847
virtual CObjectManager::TPriority GetDefaultPriority(void) const
virtual TTSE_LockSet GetOrphanAnnotRecordsNA(const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas)
new Get*AnnotRecords() methods
virtual TBlobId GetBlobIdFromString(const string &str) const
virtual bool CanGetBlobById(void) const
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
EIsDefault
Flag defining if the data loader is included in the "default" group.
static void RegisterInObjectManager(CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
Register the loader only if the name is not yet registered in the object manager.
Definition: data_loader.cpp:53
virtual void GetChunks(const TChunkSet &chunks)
vector< TChunk > TChunkSet
virtual void GetChunk(TChunk chunk_info)
@ kPriority_NotSet
Deprecated: use kPriority_Default instead.
list< SDriverInfo > TDriverInfoList
List of driver information.
EEntryPointRequest
Actions performed by the entry point.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_XLOADER_SNP_EXPORT
Definition: ncbi_export.h:1487
FILE * file
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
const char kDataLoader_SNP_DriverName[]
Definition: snploader.cpp:391
void DataLoaders_Register_SNP(void)
Definition: snploader.cpp:385
void NCBI_EntryPoint_xloader_snp(CPluginManager< objects::CDataLoader >::TDriverInfoList &info_list, CPluginManager< objects::CDataLoader >::EEntryPointRequest method)
Definition: snploader.cpp:423
CRef< objects::CObjectManager > om
SAnnotSelector –.
SRegisterLoaderInfo –.
Modified on Wed May 15 15:05:38 2024 by modify_doxy.py rev. 669887