NCBI C++ ToolKit
gbloader.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: gbloader.cpp 101496 2023-12-20 15:23:25Z vasilche $
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: Michael Kimelman, Eugene Vasilchenko
27 *
28 * File Description: GenBank Data loader
29 *
30 */
31 
32 #include <ncbi_pch.hpp>
33 #include <common/ncbi_source_ver.h>
34 #include <corelib/ncbi_param.hpp>
41 
44 
45 // TODO: remove the following includes
46 #define REGISTER_READER_ENTRY_POINTS 1
47 #ifdef REGISTER_READER_ENTRY_POINTS
49 #endif
50 
52 #include <objtools/error_codes.hpp>
53 
55 
56 #include <objmgr/impl/tse_info.hpp>
62 
64 
65 #include <corelib/ncbithr.hpp>
66 #include <corelib/ncbiapp.hpp>
67 
70 
71 #include <util/md5.hpp>
72 
73 #include <algorithm>
74 
75 
76 #define NCBI_USE_ERRCODE_X Objtools_GBLoader
77 
80 
81 
82 NCBI_PARAM_DECL(bool, GENBANK, LOADER_PSG);
83 NCBI_PARAM_DEF_EX(bool, GENBANK, LOADER_PSG, false,
84  eParam_NoThread, GENBANK_LOADER_PSG);
85 typedef NCBI_PARAM_TYPE(GENBANK, LOADER_PSG) TGenbankLoaderPsg;
86 
87 #define GBLOADER_NAME "GBLOADER"
88 #define GBLOADER_HUP_NAME "GBLOADER-HUP"
89 
91  : m_ReaderPtr(0),
92  m_ParamTree(0),
93  m_Preopen(ePreopenByConfig),
94  m_UsePSGInitialized(false),
95  m_UsePSG(false),
96  m_PSGNoSplit(false),
97  m_HasHUPIncluded(false)
98 {
99 }
100 
101 
102 CGBLoaderParams::CGBLoaderParams(const string& reader_name)
103  : CGBLoaderParams()
104 {
105  m_ReaderName = reader_name;
106 }
107 
108 
110  : CGBLoaderParams()
111 {
112  m_ReaderPtr = reader_ptr;
113 }
114 
115 
117  : CGBLoaderParams()
118 {
119  m_ParamTree = param_tree;
120 }
121 
122 
124  : CGBLoaderParams()
125 {
126  m_Preopen = preopen;
127 }
128 
129 
130 CGBLoaderParams::~CGBLoaderParams(void) = default;
131 
134 
135 
137 {
138  m_ReaderPtr = reader_ptr;
139 }
140 
141 
143 {
145 }
146 
147 
149 {
150  m_ParamTree = param_tree;
151 }
152 
153 
155 {
156  return !m_EnableSNP.IsNull();
157 }
158 
160 {
161  return m_EnableSNP.GetValue();
162 }
163 
165 {
166  m_EnableSNP = enable;
167 }
168 
170 {
171  return !m_EnableWGS.IsNull();
172 }
173 
175 {
176  return m_EnableWGS.GetValue();
177 }
178 
180 {
181  m_EnableWGS = enable;
182 }
183 
185 {
186  return !m_EnableCDD.IsNull();
187 }
188 
190 {
191  return m_EnableCDD.GetValue();
192 }
193 
195 {
196  m_EnableCDD = enable;
197 }
198 
199 
200 NCBI_PARAM_DEF_EX(string, GENBANK, LOADER_METHOD, "",
201  eParam_NoThread, GENBANK_LOADER_METHOD);
202 typedef NCBI_PARAM_TYPE(GENBANK, LOADER_METHOD) TGenbankLoaderMethod;
203 
204 #define NCBI_GBLOADER_PARAM_LOADER_PSG = "loader_psg"
205 #define NCBI_PSG_READER_NAME "psg"
206 
207 
209 {
210  string method = GetParam(params, NCBI_GBLOADER_PARAM_LOADER_METHOD);
211  if ( method.empty() ) {
212  // try config first
213  method = TGenbankLoaderMethod::GetDefault();
214  }
215  return method;
216 }
217 
218 
219 static bool s_CheckPSGMethod(const string& loader_method)
220 {
221  bool use_psg = false;
222  if ( NStr::FindNoCase(loader_method, NCBI_PSG_READER_NAME) != NPOS ) {
223  vector<string> str_list;
224  NStr::Split(loader_method, ";", str_list);
225  for (auto s : str_list) {
227 #ifdef HAVE_PSG_LOADER
228  if (str_list.size() == 1) {
229  use_psg = true;
230  break;
231  }
232  // PSG method can not be combined with any other methods.
233  NCBI_THROW(CLoaderException, eBadConfig,
234  "'PSG' loader method can not be combined with other methods: '" + loader_method + "'");
235 #else
236  // PSG method is not available
237  NCBI_THROW(CLoaderException, eBadConfig,
238  "'PSG' loader method is not available: '" + loader_method + "'");
239 #endif
240  }
241  }
242  }
243  return use_psg;
244 }
245 
246 
247 static bool s_GetDefaultUsePSG()
248 {
249  static atomic<bool> initialized;
250  static atomic<bool> loader_psg;
251  if ( !initialized.load(memory_order_acquire) ) {
252  bool new_value = false;
253 #ifdef HAVE_PSG_LOADER
254  if ( TGenbankLoaderPsg::GetDefault() ) {
255  new_value = true;
256  }
257 #endif
258  if ( !new_value ) {
259  new_value = s_CheckPSGMethod(TGenbankLoaderMethod::GetDefault());
260  }
261  loader_psg.store(new_value, memory_order_relaxed);
262  initialized.store(true, memory_order_release);
263  }
264  return loader_psg.load(memory_order_relaxed);
265 }
266 
267 
268 static bool s_GetDefaultUsePSG(const CGBLoaderParams::TParamTree* param_tree)
269 {
270  if ( param_tree ) {
271  if ( const CGBLoaderParams::TParamTree* gb_params = CGBDataLoader::GetLoaderParams(param_tree) ) {
272 #ifdef HAVE_LOADER_PSG
273  auto loader_psg_param = CGBDataLoader::GetParam(gb_params, NCBI_GBLOADER_PARAM_LOADER_PSG);
274  if ( !loader_psg_param.empty() ) {
275  try {
276  return NStr::StringToBool(loader_psg_param);
277  }
278  catch (CStringException& ex) {
279  NCBI_THROW_FMT(CConfigException, eInvalidParameter,
280  "Cannot init GenBank loader, incorrect parameter format: "
281  << NCBI_GBLOADER_PARAM_LOADER_PSG << " : " << loader_psg_param
282  << ". " << ex.what());
283  }
284  }
285 #endif
286  string loader_method = CGBDataLoader::GetParam(gb_params, NCBI_GBLOADER_PARAM_LOADER_METHOD);
287  if ( !loader_method.empty() ) {
288  return s_CheckPSGMethod(loader_method);
289  }
290  }
291  }
292  return s_GetDefaultUsePSG();
293 }
294 
295 
297 {
298  if ( m_UsePSGInitialized ) {
299  return m_UsePSG;
300  }
301 
302  string loader_method = GetLoaderMethod();
303  if (loader_method.empty()) {
304  loader_method = GetReaderName();
305  }
306  if (loader_method.empty()) {
307  // use default settings from config
309  }
310  else {
311  m_UsePSG = s_CheckPSGMethod(loader_method);
312  }
313  m_UsePSGInitialized = true;
314  return m_UsePSG;
315 }
316 
317 /*
318 void CGBDataLoader::SetLoaderMethod(CGBLoaderParams& params)
319 {
320  string loader_method = params.GetLoaderMethod();
321  if (loader_method.empty()) {
322  loader_method = params.GetReaderName();
323  }
324  if (loader_method.empty()) {
325  unique_ptr<TParamTree> app_params;
326  const TParamTree* gb_params = 0;
327  if ( params.GetParamTree() ) {
328  gb_params = GetLoaderParams(params.GetParamTree());
329  }
330  else {
331  CNcbiApplicationGuard app = CNcbiApplication::InstanceGuard();
332  if ( app ) {
333  app_params.reset(CConfig::ConvertRegToTree(app->GetConfig()));
334  gb_params = GetLoaderParams(app_params.get());
335  }
336  }
337 
338  if ( !gb_params ) {
339  app_params.reset(new TParamTree);
340  gb_params = GetLoaderParams(app_params.get());
341  }
342 
343  loader_method = GetParam(gb_params, NCBI_GBLOADER_PARAM_LOADER_METHOD);
344  if ( loader_method.empty() ) {
345  // try config first
346  loader_method = TGenbankLoaderMethod::GetDefault();
347  }
348  params.SetLoaderMethod(loader_method);
349  }
350 
351  vector<string> str_list;
352  NStr::Split(loader_method, ";", str_list);
353  for (auto s : str_list) {
354  if (!NStr::EqualNocase(s, "psg")) continue;
355  if (str_list.size() == 1) {
356  TGenbankLoaderPsg::SetDefault(true);
357  break;
358  }
359  // PSG method can not be combined with any other methods.
360  NCBI_THROW(CLoaderException, eBadConfig,
361  "'PSG' loader method can not be combined with other methods: '" + loader_method + "'");
362  }
363 }
364 */
365 
368  CReader* reader_ptr,
369  CObjectManager::EIsDefault is_default,
370  CObjectManager::TPriority priority)
371 {
372  CGBLoaderParams params(reader_ptr);
373  return RegisterInObjectManager(om, params, is_default, priority);
374 }
375 
376 
378 {
379  return GBLOADER_NAME;
380 }
381 
382 
385  const string& reader_name,
386  CObjectManager::EIsDefault is_default,
387  CObjectManager::TPriority priority)
388 {
389  CGBLoaderParams params(reader_name);
390  return RegisterInObjectManager(om, params, is_default, priority);
391 }
392 
393 
394 string CGBDataLoader::GetLoaderNameFromArgs(const string& /*reader_name*/)
395 {
396  return GBLOADER_NAME;
397 }
398 
399 
402  EIncludeHUP include_hup,
403  CObjectManager::EIsDefault is_default,
404  CObjectManager::TPriority priority)
405 {
406  return RegisterInObjectManager(om, include_hup, NcbiEmptyString, is_default,
407  priority);
408 }
409 
411 {
412  return GBLOADER_HUP_NAME;
413 }
414 
417  EIncludeHUP /*include_hup*/,
418  const string& web_cookie,
419  CObjectManager::EIsDefault is_default,
420  CObjectManager::TPriority priority)
421 {
422  CGBLoaderParams params;
423  params.SetHUPIncluded(true, web_cookie);
424  return RegisterInObjectManager(om, params, is_default, priority);
425 }
426 
427 
429  const string& web_cookie)
430 {
431  CGBLoaderParams params;
432  params.SetHUPIncluded(true, web_cookie);
433  return GetLoaderNameFromArgs(params);
434 }
435 
438  const string& reader_name,
439  EIncludeHUP include_hup,
440  CObjectManager::EIsDefault is_default,
441  CObjectManager::TPriority priority)
442 {
443  return RegisterInObjectManager(om, reader_name, include_hup, NcbiEmptyString,
444  is_default, priority);
445 }
446 
447 string CGBDataLoader::GetLoaderNameFromArgs(const string& reader_name,
448  EIncludeHUP include_hup)
449 {
450  return GBLOADER_HUP_NAME;
451 }
452 
453 
456  const string& reader_name,
457  EIncludeHUP include_hup,
458  const string& web_cookie,
459  CObjectManager::EIsDefault is_default,
460  CObjectManager::TPriority priority)
461 {
462  CGBLoaderParams params(reader_name);
463  params.SetHUPIncluded(true, web_cookie);
464  return RegisterInObjectManager(om, params, is_default, priority);
465 }
466 
467 
468 string CGBDataLoader::GetLoaderNameFromArgs(const string& reader_name,
469  EIncludeHUP include_hup,
470  const string& web_cookie)
471 {
472  CGBLoaderParams params(reader_name);
473  params.SetHUPIncluded(true, web_cookie);
474  return GetLoaderNameFromArgs(params);
475 }
476 
477 
480  const TParamTree& param_tree,
481  CObjectManager::EIsDefault is_default,
482  CObjectManager::TPriority priority)
483 {
484  CGBLoaderParams params(&param_tree);
485  return RegisterInObjectManager(om, params, is_default, priority);
486 }
487 
488 
490 {
491  return GBLOADER_NAME;
492 }
493 
494 
497  const CGBLoaderParams& params,
498  CObjectManager::EIsDefault is_default,
499  CObjectManager::TPriority priority)
500 {
501  if ( params.GetUsePSG() ) {
502 #if defined(HAVE_PSG_LOADER)
503  return CPSGDataLoader::RegisterInObjectManager(om, params, is_default, priority);
504 #else
505  ERR_POST_X(3, Critical << "PSG Loader is requested but not available");
507  info.Set(nullptr, false);
508  return info;
509 #endif
510  }
511  return CGBDataLoader_Native::RegisterInObjectManager(om, params, is_default, priority);
512 }
513 
514 
516 {
517  if ( !params.GetLoaderName().empty() ) {
518  return params.GetLoaderName();
519  }
520  if (params.HasHUPIncluded()) {
521  const string& web_cookie = params.GetWebCookie();
522  if (web_cookie.empty()) {
523  return GBLOADER_HUP_NAME;
524  }
525  else {
526  CMD5 md5;
527  md5.Update(web_cookie.data(), web_cookie.size());
528  return GBLOADER_HUP_NAME + string("-") + md5.GetHexSum();
529  }
530  } else {
531  return GBLOADER_NAME;
532  }
533 }
534 
535 
536 CGBDataLoader::CGBDataLoader(const string& loader_name,
537  const CGBLoaderParams& params)
538  : CDataLoader(loader_name),
539  m_HasHUPIncluded(params.HasHUPIncluded()),
540  m_WebCookie(params.GetWebCookie())
541 {
542 }
543 
544 
546 {
547 }
548 
549 
551 {
553  if ( HasHUPIncluded() ) {
554  // HUP data loader has lower priority by default
555  priority += 1;
556  }
557  return priority;
558 }
559 
560 
562 {
563  return true;
564 }
565 
566 
567 namespace {
568  typedef CGBDataLoader::TParamTree TParams;
569 
570  TParams* FindSubNode(TParams* params,
571  const string& name)
572  {
573  return params? params->FindSubNode(name): 0;
574  }
575 
576  const TParams* FindSubNode(const TParams* params,
577  const string& name)
578  {
579  return params? params->FindSubNode(name): 0;
580  }
581 }
582 
583 
586  const string& subnode_name)
587 {
588  const TParamTree* subnode = 0;
589  if ( params ) {
590  if ( params->KeyEqual(subnode_name) ) {
591  subnode = params;
592  }
593  else {
594  subnode = FindSubNode(params, subnode_name);
595  }
596  }
597  return subnode;
598 }
599 
600 
603  const string& subnode_name)
604 {
605  _ASSERT(params);
606  TParamTree* subnode = 0;
607  if ( params->KeyEqual(subnode_name) ) {
608  subnode = params;
609  }
610  else {
611  subnode = FindSubNode(params, subnode_name);
612  if ( !subnode ) {
613  subnode = params->AddNode(
614  TParamTree::TValueType(subnode_name, kEmptyStr));
615  }
616  }
617  return subnode;
618 }
619 
620 
623 {
625 }
626 
627 
630  const string& reader_name)
631 {
632  return GetParamsSubnode(GetLoaderParams(params), reader_name);
633 }
634 
635 
638 {
640 }
641 
642 
645  const string& reader_name)
646 {
647  return GetParamsSubnode(GetLoaderParams(params), reader_name);
648 }
649 
650 
652  const string& param_name,
653  const string& param_value)
654 {
655  TParamTree* subnode = FindSubNode(params, param_name);
656  if ( !subnode ) {
657  params->AddNode(TParamTree::TValueType(param_name, param_value));
658  }
659  else {
660  subnode->GetValue().value = param_value;
661  }
662 }
663 
664 
665 string CGBDataLoader::GetParam(const TParamTree* params,
666  const string& param_name)
667 {
668  if ( params ) {
669  const TParamTree* subnode = FindSubNode(params, param_name);
670  if ( subnode ) {
671  return subnode->GetValue().value;
672  }
673  }
674  return kEmptyStr;
675 }
676 
677 
679  int sat_key,
680  int sub_sat) const
681 {
682 #if defined(HAVE_PSG_LOADER)
683  if ( IsUsingPSGLoader() ) {
684  string str = NStr::NumericToString(sat)+'.'+NStr::NumericToString(sat_key);
685  if ( sub_sat != CSeqref::eSubSat_main ) {
686  str += '.'+NStr::NumericToString(sub_sat);
687  }
688  return TBlobId(new CPsgBlobId(str));
689  }
690 #endif
691  CRef<CBlob_id> blob_id(new CBlob_id);
692  blob_id->SetSat(sat);
693  blob_id->SetSatKey(sat_key);
694  blob_id->SetSubSat(sub_sat);
695  return TBlobId(blob_id);
696 }
697 
698 
700 {
701  TBlobId id = GetBlobId(sih);
702  if (id) {
703  TRealBlobId blob_id = GetRealBlobId(id);
704  return ConstRef(new CSeqref(ZERO_GI, blob_id.GetSat(), blob_id.GetSatKey()));
705  }
706  return CConstRef<CSeqref>();
707 }
708 
709 
711 {
713 }
714 
715 
718 {
719  return x_GetRealBlobId(blob_id);
720 }
721 
722 
725 {
726  if (&tse_info.GetDataSource() != GetDataSource()) {
727  NCBI_THROW(CLoaderException, eLoaderFailed,
728  "not mine TSE");
729  }
730  return GetRealBlobId(tse_info.GetBlobId());
731 }
732 
733 
735 {
736  return s_GetDefaultUsePSG();
737 }
738 
739 
741 
742 // ===========================================================================
743 
745 
747 {
748  RegisterEntryPoint<CDataLoader>(NCBI_EntryPoint_DataLoader_GB);
749 }
750 
751 
753 {
754 public:
757  virtual ~CGB_DataLoaderCF(void) {}
758 
759 protected:
762  const TPluginManagerParamTree* params) const;
763 };
764 
765 
768  const TPluginManagerParamTree* params) const
769 {
770  if ( !ValidParams(params) ) {
771  // Use constructor without arguments
773  }
774  // Parse params, select constructor
775  if ( params ) {
776  // Let the loader detect driver from params
778  om,
779  *params,
780  GetIsDefault(params),
781  GetPriority(params)).GetLoader();
782  }
784  om,
785  0, // no driver - try to autodetect
786  GetIsDefault(params),
787  GetPriority(params)).GetLoader();
788 }
789 
790 
794 {
796  method);
797 }
798 
802 {
803  NCBI_EntryPoint_DataLoader_GB(info_list, method);
804 }
805 
806 
TSat GetSat() const
Definition: blob_id.hpp:56
TSatKey GetSatKey() const
Definition: blob_id.hpp:64
CConfigException –.
Definition: ncbi_config.hpp:53
CConstRef –.
Definition: ncbiobj.hpp:1266
CObjectManager::TPriority GetPriority(const TPluginManagerParamTree *params) const
CObjectManager::EIsDefault GetIsDefault(const TPluginManagerParamTree *params) const
bool ValidParams(const TPluginManagerParamTree *params) const
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const CGBLoaderParams &params, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: gbnative.cpp:147
virtual TRealBlobId x_GetRealBlobId(const TBlobId &blob_id) const =0
static void SetParam(TParamTree *params, const string &param_name, const string &param_value)
Definition: gbloader.cpp:651
CConstRef< CSeqref > GetSatSatkey(const CSeq_id_Handle &idh)
Definition: gbloader.cpp:699
CGBDataLoader(const string &loader_name, const CGBLoaderParams &params)
Definition: gbloader.cpp:536
static TParamTree * GetReaderParams(TParamTree *params, const string &reader_name)
Definition: gbloader.cpp:644
virtual bool GetTrackSplitSeq() const override
Definition: gbloader.cpp:561
static string GetLoaderNameFromArgs(CReader *reader=0)
Definition: gbloader.cpp:377
TRealBlobId GetRealBlobId(const TBlobId &blob_id) const
Definition: gbloader.cpp:717
TBlobId GetBlobIdFromSatSatKey(int sat, int sat_key, int sub_sat=0) const
Definition: gbloader.cpp:678
static TParamTree * GetParamsSubnode(TParamTree *params, const string &subnode_name)
Definition: gbloader.cpp:602
bool HasHUPIncluded(void) const
Definition: gbloader.hpp:417
virtual CObjectManager::TPriority GetDefaultPriority(void) const override
Definition: gbloader.cpp:550
static bool IsUsingPSGLoader(void)
Definition: gbloader.cpp:734
static string x_GetLoaderMethod(const TParamTree *params)
Definition: gbloader.cpp:208
static string GetParam(const TParamTree *params, const string &param_name)
Definition: gbloader.cpp:665
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: gbloader.cpp:366
virtual ~CGBDataLoader(void)
Definition: gbloader.cpp:545
static TParamTree * GetLoaderParams(TParamTree *params)
Definition: gbloader.cpp:637
const string & GetLoaderMethod(void) const
Definition: gbloader.hpp:117
CReader * GetReaderPtr(void) const
Definition: gbloader.cpp:142
EPreopenConnection m_Preopen
Definition: gbloader.hpp:218
const string & GetLoaderName(void) const
Definition: gbloader.hpp:107
const TParamTree * m_ParamTree
Definition: gbloader.hpp:217
bool IsSetEnableCDD(void) const
Definition: gbloader.cpp:184
void SetEnableSNP(bool enable)
Definition: gbloader.cpp:164
const TParamTree * GetParamTree(void) const
Definition: gbloader.hpp:144
CRef< CReader > m_ReaderPtr
Definition: gbloader.hpp:216
CNullable< bool > m_EnableCDD
Definition: gbloader.hpp:228
void SetEnableWGS(bool enable)
Definition: gbloader.cpp:179
void SetParamTree(const TParamTree *params)
Definition: gbloader.cpp:148
CNullable< bool > m_EnableSNP
Definition: gbloader.hpp:226
void SetEnableCDD(bool enable)
Definition: gbloader.cpp:194
bool IsSetEnableSNP(void) const
Definition: gbloader.cpp:154
const string & GetWebCookie(void) const
Definition: gbloader.hpp:168
bool m_UsePSGInitialized
Definition: gbloader.hpp:219
bool GetEnableWGS(void) const
Definition: gbloader.cpp:174
CGBLoaderParams(void)
Definition: gbloader.cpp:90
CNullable< bool > m_EnableWGS
Definition: gbloader.hpp:227
bool HasHUPIncluded(void) const
Definition: gbloader.hpp:163
bool GetEnableCDD(void) const
Definition: gbloader.cpp:189
CGBLoaderParams & operator=(const CGBLoaderParams &)
const string & GetReaderName(void) const
Definition: gbloader.hpp:126
void SetHUPIncluded(bool include_hup=true, const string &web_cookie=NcbiEmptyString)
Definition: gbloader.hpp:157
bool GetEnableSNP(void) const
Definition: gbloader.cpp:159
string m_ReaderName
Definition: gbloader.hpp:213
bool IsSetEnableWGS(void) const
Definition: gbloader.cpp:169
~CGBLoaderParams(void)
bool GetUsePSG() const
Definition: gbloader.cpp:296
void SetReaderPtr(CReader *reader_ptr)
Definition: gbloader.cpp:136
virtual ~CGB_DataLoaderCF(void)
Definition: gbloader.cpp:757
CGB_DataLoaderCF(void)
Definition: gbloader.cpp:755
virtual CDataLoader * CreateAndRegister(CObjectManager &om, const TPluginManagerParamTree *params) const
Definition: gbloader.cpp:766
Data loader exceptions, used by GenBank loader.
Definition: md5.hpp:46
CObjectManager –.
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: psg_loader.cpp:170
CRef –.
Definition: ncbiobj.hpp:618
@ eSubSat_main
Definition: seqref.hpp:61
CStringException –.
Definition: ncbistr.hpp:4508
CDataSource & GetDataSource(void) const
Definition: tse_info.hpp:805
const TBlobId & GetBlobId(void) const
Definition: tse_info.hpp:907
definition of a Culling tree
Definition: ncbi_tree.hpp:100
#define false
Definition: bool.h:36
static const char * str(char *buf, int n)
Definition: stats.c:84
static void md5(const char *src, const char *out)
Definition: challenge.c:77
USING_SCOPE(objects)
NCBI_PARAM_DECL(bool, GENBANK, LOADER_PSG)
#define NCBI_GBLOADER_PARAM_LOADER_PSG
Definition: gbloader.cpp:204
#define NCBI_PSG_READER_NAME
Definition: gbloader.cpp:205
static bool s_GetDefaultUsePSG()
Definition: gbloader.cpp:247
#define GBLOADER_NAME
Definition: gbloader.cpp:87
void DataLoaders_Register_GenBank(void)
Definition: gbloader.cpp:746
#define GBLOADER_HUP_NAME
Definition: gbloader.cpp:88
void NCBI_EntryPoint_DataLoader_GB(CPluginManager< CDataLoader >::TDriverInfoList &info_list, CPluginManager< CDataLoader >::EEntryPointRequest method)
Definition: gbloader.cpp:791
void NCBI_EntryPoint_xloader_genbank(CPluginManager< objects::CDataLoader >::TDriverInfoList &info_list, CPluginManager< objects::CDataLoader >::EEntryPointRequest method)
Definition: gbloader.cpp:799
static bool s_CheckPSGMethod(const string &loader_method)
Definition: gbloader.cpp:219
typedef NCBI_PARAM_TYPE(GENBANK, LOADER_PSG) TGenbankLoaderPsg
NCBI_PARAM_DEF_EX(bool, GENBANK, LOADER_PSG, false, eParam_NoThread, GENBANK_LOADER_PSG)
#define NCBI_GBLOADER_PARAM_LOADER_METHOD
#define NCBI_GBLOADER_DRIVER_NAME
bool IsNull(void) const
Check if the object is unassigned.
Definition: ncbimisc.hpp:686
#define ZERO_GI
Definition: ncbimisc.hpp:1088
const TValue & GetValue(void) const
Get a const reference to the current value.
Definition: ncbimisc.hpp:703
string
Definition: cgiapp.hpp:687
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
Definition: ncbidiag.hpp:550
void Critical(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1203
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
Definition: ncbiexpt.hpp:719
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
virtual CObjectManager::TPriority GetDefaultPriority(void) const
TLoader * GetLoader(void) const
Get pointer to the loader.
CBlobIdKey TBlobId
CDataSource * GetDataSource(void) const
Definition: data_loader.cpp:92
EIsDefault
Flag defining if the data loader is included in the "default" group.
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
TObjectType * GetNCPointerOrNull(void) const THROWS_NONE
Get pointer value.
Definition: ncbiobj.hpp:1162
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
@ eParam_NoThread
Do not use per-thread values.
Definition: ncbi_param.hpp:418
static void NCBI_EntryPointImpl(TDriverInfoList &info_list, EEntryPointRequest method)
Entry point implementation.
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
static bool StringToBool(const CTempString str)
Convert string to bool.
Definition: ncbistr.cpp:2812
#define kEmptyStr
Definition: ncbistr.hpp:123
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
Definition: ncbistr.cpp:3452
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
Definition: ncbistr.cpp:2984
#define NPOS
Definition: ncbistr.hpp:133
#define NcbiEmptyString
Definition: ncbistr.hpp:122
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5355
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
bool KeyEqual(const TKeyType &key) const
Check if the node's key is equal to the argument.
Definition: ncbi_tree.hpp:204
void AddNode(TTreeType *subnode)
Add new subnode.
Definition: ncbi_tree.hpp:743
const TTreeType * FindSubNode(const TKeyType &key) const
Non recursive linear scan of all subnodes, with key comparison.
Definition: ncbi_tree.hpp:940
const TValue & GetValue(void) const
Return node's value.
Definition: ncbi_tree.hpp:184
TValue TValueType
Definition: ncbi_tree.hpp:102
Definition of all error codes used in objtools libraries.
CMD5 - class for computing Message Digest version 5 checksums.
static MDB_envinfo info
Definition: mdb_load.c:37
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Multi-threading – classes, functions, and features.
Helper classes and templates to implement plugins.
CRef< objects::CObjectManager > om
SRegisterLoaderInfo –.
#define _ASSERT
Modified on Mon Jul 15 05:35:14 2024 by modify_doxy.py rev. 669887