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

Go to the SVN repository for this file.

1 /* $Id: psg_loader.cpp 101837 2024-02-20 19:11:32Z 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: Eugene Vasilchenko, Aleksey Grichenko
27  *
28  * File Description: PSG data loader
29  *
30  * ===========================================================================
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbistd.hpp>
35 
38 #include <objects/seq/seq__.hpp>
40 
47 
50 
51 #if defined(HAVE_PSG_LOADER)
52 
54 
55 NCBI_PARAM_ENUM_ARRAY(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT) {
56  {"", objects::CSeq_id::eSNPScaleLimit_Default},
57  {"Unit", objects::CSeq_id::eSNPScaleLimit_Unit},
58  {"Contig", objects::CSeq_id::eSNPScaleLimit_Contig},
59  {"Supercontig", objects::CSeq_id::eSNPScaleLimit_Supercontig},
60  {"Chromosome", objects::CSeq_id::eSNPScaleLimit_Chromosome},
61 };
62 NCBI_PARAM_ENUM_DECL(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT);
63 NCBI_PARAM_ENUM_DEF_EX(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT,
64  objects::CSeq_id::eSNPScaleLimit_Default,
65  eParam_NoThread, PSG_LOADER_SNP_SCALE_LIMIT);
66 typedef NCBI_PARAM_TYPE(PSG_LOADER, SNP_SCALE_LIMIT) TSNP_Scale_Limit;
67 
69 
70 /////////////////////////////////////////////////////////////////////////////
71 // CPsgBlobId
72 /////////////////////////////////////////////////////////////////////////////
73 
74 
76  : m_Id(id)
77 {
78 }
79 
80 
81 CPsgBlobId::CPsgBlobId(const string& id, const string& id2_info)
82  : m_Id(id),
83  m_Id2Info(id2_info)
84 {
85 }
86 
87 
89 {
90 }
91 
92 
93 string CPsgBlobId::ToString(void) const
94 {
95  return m_Id;
96 }
97 
98 
99 bool CPsgBlobId::operator==(const CBlobId& id_ref) const
100 {
101  const CPsgBlobId* id = dynamic_cast<const CPsgBlobId*>(&id_ref);
102  return id && m_Id == id->m_Id;
103 }
104 
105 
106 bool CPsgBlobId::operator<(const CBlobId& id_ref) const
107 {
108  const CPsgBlobId* id = dynamic_cast<const CPsgBlobId*>(&id_ref);
109  if ( !id ) {
110  return LessByTypeId(id_ref);
111  }
112  return m_Id < id->m_Id;
113 }
114 
115 
116 bool CPsgBlobId::GetSatSatkey(int& sat, int& satkey) const
117 {
118  string ssat, ssatkey;
119  NStr::SplitInTwo(m_Id, ".", ssat, ssatkey);
120  if (ssat.empty() || ssatkey.empty()) return false;
121  try {
122  sat = NStr::StringToNumeric<int>(ssat);
123  satkey = NStr::StringToNumeric<int>(ssatkey);
124  }
125  catch (CStringException&) {
126  return false;
127  }
128  return true;
129 }
130 
131 
133 {
134  if ( auto psg_blob_id = dynamic_cast<const CPsgBlobId*>(&blob_id) ) {
135  return ConstRef(psg_blob_id);
136  }
137  const CBlob_id* gb_blob_id = dynamic_cast<const CBlob_id*>(&blob_id);
138  if (!gb_blob_id) {
139  NCBI_THROW(CLoaderException, eOtherError, "Incompatible blob-id: " + blob_id.ToString());
140  }
141  return ConstRef(new CPsgBlobId(
142  NStr::NumericToString(gb_blob_id->GetSat()) +
143  '.' +
144  NStr::NumericToString(gb_blob_id->GetSatKey())));
145 }
146 
147 
148 /////////////////////////////////////////////////////////////////////////////
149 // CPSGDataLoader
150 /////////////////////////////////////////////////////////////////////////////
151 
152 
153 #define PSGLOADER_NAME "GBLOADER"
154 
155 const char kDataLoader_PSG_DriverName[] = "psg";
156 
157 
159 {
160  return TSNP_Scale_Limit::GetDefault();
161 }
162 
163 
165 {
166  TSNP_Scale_Limit::SetDefault(value);
167 }
168 
169 
172  CObjectManager::EIsDefault is_default,
173  CObjectManager::TPriority priority)
174 {
175  return RegisterInObjectManager(om, CGBLoaderParams(), is_default, priority);
176 }
177 
178 
181  const CGBLoaderParams& params,
182  CObjectManager::EIsDefault is_default,
183  CObjectManager::TPriority priority)
184 {
185  CGBLoaderMaker<CPSGDataLoader> maker(params);
186  CDataLoader::RegisterInObjectManager(om, maker, is_default, priority);
187  return maker.GetRegisterInfo();
188 }
189 
190 
191 CPSGDataLoader::CPSGDataLoader(const string& loader_name,
192  const CGBLoaderParams& params)
193  : CGBDataLoader(loader_name, params)
194 {
195  m_Impl.Reset(new CPSGDataLoader_Impl(params));
196 }
197 
198 
200 {
201 }
202 
203 
205 {
206  return TBlobId(m_Impl->GetBlobId(idh).GetPointerOrNull());
207 }
208 
209 
212 {
213  return TBlobId(new CPsgBlobId(str));
214 }
215 
216 
218 {
219  return true;
220 }
221 
222 
225  EChoice choice)
226 {
227  return m_Impl->GetRecords(GetDataSource(), idh, choice);
228 }
229 
230 
232  const SAnnotSelector* sel,
233  TProcessedNAs* processed_nas)
234 {
235  return CDataLoader::TTSE_LockSet();
236 }
237 
238 
239 namespace {
240  struct SBetterId
241  {
242  int GetScore(const CSeq_id_Handle& id1) const
243  {
244  if ( id1.IsGi() ) {
245  return 100;
246  }
247  if ( !id1 ) {
248  return -1;
249  }
250  CConstRef<CSeq_id> seq_id = id1.GetSeqId();
251  const CTextseq_id* text_id = seq_id->GetTextseq_Id();
252  if ( text_id ) {
253  int score;
254  if ( text_id->IsSetAccession() ) {
255  if ( text_id->IsSetVersion() ) {
256  score = 99;
257  }
258  else {
259  score = 50;
260  }
261  }
262  else {
263  score = 0;
264  }
265  return score;
266  }
267  if ( seq_id->IsGeneral() ) {
268  return 10;
269  }
270  if ( seq_id->IsLocal() ) {
271  return 0;
272  }
273  return 1;
274  }
275  bool operator()(const CSeq_id_Handle& id1,
276  const CSeq_id_Handle& id2) const
277  {
278  int score1 = GetScore(id1);
279  int score2 = GetScore(id2);
280  if ( score1 != score2 ) {
281  return score1 > score2;
282  }
283  return id1 < id2;
284  }
285  };
286 }
287 
288 
290  const SAnnotSelector* sel,
291  TProcessedNAs* processed_nas)
292 {
293  TIds ids = bioseq.GetId();
294  sort(ids.begin(), ids.end(), SBetterId());
295  return m_Impl->GetAnnotRecordsNA(GetDataSource(), ids, sel, processed_nas);
296 }
297 
298 
300 {
301  m_Impl->LoadChunk(GetDataSource(), *chunk);
302 }
303 
304 
306 {
307  m_Impl->LoadChunks(GetDataSource(), chunks);
308 }
309 
310 
312 {
313  m_Impl->GetBlobs(GetDataSource(), tse_sets);
314 }
315 
316 
317 void CPSGDataLoader::GetCDDAnnots(const TSeqIdSets& id_sets, TLoaded& loaded, TCDD_Locks& ret)
318 {
319  m_Impl->GetCDDAnnots(GetDataSource(), id_sets, loaded, ret);
320 }
321 
322 
325 {
326  return m_Impl->GetBlobById(GetDataSource(),
327  *CPsgBlobId::GetPsgBlobId(*blob_id));
328 }
329 
330 
332 {
333  m_Impl->GetIds(idh, ids);
334 }
335 
336 
339 {
340  return m_Impl->GetGi(idh);
341 }
342 
343 
346 {
347  return m_Impl->GetAccVer(idh);
348 }
349 
350 
352 {
353  auto taxid = m_Impl->GetTaxId(idh);
354  return taxid != INVALID_TAX_ID ? taxid : CDataLoader::GetTaxId(idh);
355 }
356 
357 
358 void CPSGDataLoader::GetTaxIds(const TIds& ids, TLoaded& loaded, TTaxIds& ret)
359 {
360  m_Impl->GetTaxIds(ids, loaded, ret);
361 }
362 
363 
365 {
366  return m_Impl->GetSequenceLength(idh);
367 }
368 
369 
372 {
373  return m_Impl->GetSequenceHash(idh);
374 }
375 
376 
379 {
380  return m_Impl->GetSequenceType(idh);
381 }
382 
383 
385 {
386  return m_Impl->GetSequenceState(GetDataSource(), idh);
387 }
388 
389 
391 {
392  m_Impl->DropTSE(dynamic_cast<const CPsgBlobId&>(*tse_info->GetBlobId()));
393 }
394 
395 
396 void CPSGDataLoader::GetBulkIds(const TIds& ids, TLoaded& loaded, TBulkIds& ret)
397 {
398  m_Impl->GetBulkIds(ids, loaded, ret);
399 }
400 
401 
402 void CPSGDataLoader::GetAccVers(const TIds& ids, TLoaded& loaded, TIds& ret)
403 {
404  m_Impl->GetAccVers(ids, loaded, ret);
405 }
406 
407 
408 void CPSGDataLoader::GetGis(const TIds& ids, TLoaded& loaded, TGis& ret)
409 {
410  m_Impl->GetGis(ids, loaded, ret);
411 }
412 
413 
414 void CPSGDataLoader::GetLabels(const TIds& ids, TLoaded& loaded, TLabels& ret)
415 {
416  m_Impl->GetLabels(ids, loaded, ret);
417 }
418 
419 
421 {
422  m_Impl->GetSequenceLengths(ids, loaded, ret);
423 }
424 
425 
427 {
428  m_Impl->GetSequenceTypes(ids, loaded, ret);
429 }
430 
431 
433 {
434  m_Impl->GetSequenceStates(GetDataSource(), ids, loaded, ret);
435 }
436 
437 
439 {
440  m_Impl->GetSequenceHashes(ids, loaded, ret, known);
441 }
442 
443 
446 {
448 
449  /*
450  CGBReaderRequestResult result(this, sih);
451  SAnnotSelector sel;
452  sel.IncludeNamedAnnotAccession("NA*");
453  CLoadLockBlobIds blobs(result, sih, &sel);
454  m_Dispatcher->LoadSeq_idBlob_ids(result, sih, &sel);
455  _ASSERT(blobs.IsLoaded());
456 
457  CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
458  if ((blob_ids.GetState() & CBioseq_Handle::fState_no_data) != 0) {
459  if (blob_ids.GetState() == CBioseq_Handle::fState_no_data) {
460  // default state - return empty name set
461  return names;
462  }
463  NCBI_THROW2(CBlobStateException, eBlobStateError,
464  "blob state error for " + sih.AsString(),
465  blob_ids.GetState());
466  }
467 
468  ITERATE(CFixedBlob_ids, it, blob_ids) {
469  const CBlob_Info& info = *it;
470  if (!info.IsSetAnnotInfo()) {
471  continue;
472  }
473  CConstRef<CBlob_Annot_Info> annot_info = info.GetAnnotInfo();
474  ITERATE(CBlob_Annot_Info::TNamedAnnotNames, jt,
475  annot_info->GetNamedAnnotNames()) {
476  names.insert(*jt);
477  }
478  }
479  */
480 
481  return names;
482 }
483 
484 
487  const string& named_acc)
488 {
490 
491  /*
492  CGBReaderRequestResult result(this, sih);
493  SAnnotSelector sel;
494  if (!ExtractZoomLevel(named_acc, 0, 0)) {
495  sel.IncludeNamedAnnotAccession(CombineWithZoomLevel(named_acc, -1));
496  }
497  else {
498  sel.IncludeNamedAnnotAccession(named_acc);
499  }
500  CLoadLockBlobIds blobs(result, sih, &sel);
501  m_Dispatcher->LoadSeq_idBlob_ids(result, sih, &sel);
502  _ASSERT(blobs.IsLoaded());
503 
504  CFixedBlob_ids blob_ids = blobs.GetBlob_ids();
505  if ((blob_ids.GetState() & CBioseq_Handle::fState_no_data) != 0) {
506  if (blob_ids.GetState() == CBioseq_Handle::fState_no_data) {
507  // default state - return empty name set
508  return names;
509  }
510  NCBI_THROW2(CBlobStateException, eBlobStateError,
511  "blob state error for " + sih.AsString(),
512  blob_ids.GetState());
513  }
514 
515  ITERATE(CFixedBlob_ids, it, blob_ids) {
516  const CBlob_Info& info = *it;
517  if (!info.IsSetAnnotInfo()) {
518  continue;
519  }
520  CConstRef<CBlob_Annot_Info> annot_info = info.GetAnnotInfo();
521  ITERATE(CBlob_Annot_Info::TNamedAnnotNames, jt,
522  annot_info->GetNamedAnnotNames()) {
523  names.insert(*jt);
524  }
525  }
526  */
527 
528  return names;
529 }
530 
531 
534 {
535  const CPsgBlobId* psg_blob_id = dynamic_cast<const CPsgBlobId*>(&*blob_id);
536  if (psg_blob_id) {
537  int sat, satkey;
538  if (psg_blob_id->GetSatSatkey(sat, satkey)) {
539  CBlob_id gb_blob_id;
540  gb_blob_id.SetSat(sat);
541  gb_blob_id.SetSatKey(satkey);
542  return gb_blob_id;
543  }
544  }
545  const CBlob_id* gb_blob_id = dynamic_cast<const CBlob_id*>(&*blob_id);
546  if (gb_blob_id) return *gb_blob_id;
547  return CBlob_id();
548 }
549 
550 
552 
553 // ===========================================================================
554 
556 
558 {
559 public:
562  virtual ~CPSG_DataLoaderCF(void) {}
563 
564 protected:
565  virtual CDataLoader* CreateAndRegister(
567  const TPluginManagerParamTree* params) const;
568 };
569 
570 
573  const TPluginManagerParamTree* params) const
574 {
575  if ( !ValidParams(params) ) {
576  // Use constructor without arguments
578  }
579  // IsDefault and Priority arguments may be specified
581  om,
582  GetIsDefault(params),
583  GetPriority(params)).GetLoader();
584 }
585 
587 
588 #endif // HAVE_PSG_LOADER
const TId & GetId(void) const
TSat GetSat() const
Definition: blob_id.hpp:56
TSatKey GetSatKey() const
Definition: blob_id.hpp:64
void SetSatKey(TSatKey v)
Definition: blob_id.hpp:113
void SetSat(TSat v)
Definition: blob_id.hpp:105
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
TRegisterInfo GetRegisterInfo(void)
Definition: gbloader.hpp:454
Data loader exceptions, used by GenBank loader.
CObjectManager –.
void GetBulkIds(const TIds &ids, TLoaded &loaded, TBulkIds &ret)
CRef< CPsgBlobId > GetBlobId(const CSeq_id_Handle &idh)
void GetAccVers(const TIds &ids, TLoaded &loaded, TIds &ret)
void GetIds(const CSeq_id_Handle &idh, TIds &ids)
CDataLoader::SGiFound GetGi(const CSeq_id_Handle &idh)
void DropTSE(const CPsgBlobId &blob_id)
void LoadChunk(CDataSource *data_source, CTSE_Chunk_Info &chunk_info)
CTSE_Lock GetBlobById(CDataSource *data_source, const CPsgBlobId &blob_id)
void LoadChunks(CDataSource *data_source, const CDataLoader::TChunkSet &chunks)
int GetSequenceState(CDataSource *data_source, const CSeq_id_Handle &idh)
void GetSequenceStates(CDataSource *data_source, const TIds &ids, TLoaded &loaded, TSequenceStates &ret)
TTaxId GetTaxId(const CSeq_id_Handle &idh)
CDataLoader::TTSE_LockSet GetRecords(CDataSource *data_source, const CSeq_id_Handle &idh, CDataLoader::EChoice choice)
void GetSequenceHashes(const TIds &ids, TLoaded &loaded, TSequenceHashes &ret, THashKnown &known)
CDataLoader::STypeFound GetSequenceType(const CSeq_id_Handle &idh)
void GetGis(const TIds &ids, TLoaded &loaded, TGis &ret)
void GetLabels(const TIds &ids, TLoaded &loaded, TLabels &ret)
void GetSequenceTypes(const TIds &ids, TLoaded &loaded, TSequenceTypes &ret)
TSeqPos GetSequenceLength(const CSeq_id_Handle &idh)
void GetSequenceLengths(const TIds &ids, TLoaded &loaded, TSequenceLengths &ret)
CDataLoader::SHashFound GetSequenceHash(const CSeq_id_Handle &idh)
void GetBlobs(CDataSource *data_source, TTSE_LockSets &tse_sets)
void GetCDDAnnots(CDataSource *data_source, const TSeqIdSets &id_sets, TLoaded &loaded, TCDD_Locks &ret)
CDataLoader::TTSE_LockSet GetAnnotRecordsNA(CDataSource *data_source, const TIds &ids, const SAnnotSelector *sel, CDataLoader::TProcessedNAs *processed_nas)
void GetTaxIds(const TIds &ids, TLoaded &loaded, TTaxIds &ret)
CDataLoader::SAccVerFound GetAccVer(const CSeq_id_Handle &idh)
void GetBulkIds(const TIds &ids, TLoaded &loaded, TBulkIds &ret) override
Definition: psg_loader.cpp:396
void GetLabels(const TIds &ids, TLoaded &loaded, TLabels &ret) override
Definition: psg_loader.cpp:414
void GetCDDAnnots(const TSeqIdSets &id_sets, TLoaded &loaded, TCDD_Locks &ret) override
Definition: psg_loader.cpp:317
void GetGis(const TIds &ids, TLoaded &loaded, TGis &ret) override
Definition: psg_loader.cpp:408
void GetSequenceHashes(const TIds &ids, TLoaded &loaded, TSequenceHashes &ret, THashKnown &known) override
Definition: psg_loader.cpp:438
bool CanGetBlobById(void) const override
Definition: psg_loader.cpp:217
void GetIds(const CSeq_id_Handle &idh, TIds &ids) override
Definition: psg_loader.cpp:331
TBlobId GetBlobIdFromString(const string &str) const override
Definition: psg_loader.cpp:211
~CPSGDataLoader(void)
Definition: psg_loader.cpp:199
TRealBlobId x_GetRealBlobId(const TBlobId &blob_id) const override
Definition: psg_loader.cpp:533
void GetTaxIds(const TIds &ids, TLoaded &loaded, TTaxIds &ret) override
Definition: psg_loader.cpp:358
void GetChunk(TChunk chunk) override
Definition: psg_loader.cpp:299
static void SetSNP_Scale_Limit(CSeq_id::ESNPScaleLimit value)
Definition: psg_loader.cpp:164
int GetSequenceState(const CSeq_id_Handle &idh) override
Request for a state of a sequence.
Definition: psg_loader.cpp:384
CPSGDataLoader(void)
static CSeq_id::ESNPScaleLimit GetSNP_Scale_Limit(void)
Definition: psg_loader.cpp:158
void GetSequenceStates(const TIds &ids, TLoaded &loaded, TSequenceStates &ret) override
Definition: psg_loader.cpp:432
SAccVerFound GetAccVerFound(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:345
TTaxId GetTaxId(const CSeq_id_Handle &idh) override
Request for a taxonomy id of a sequence.
Definition: psg_loader.cpp:351
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
Definition: psg_loader.cpp:170
SGiFound GetGiFound(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:338
void DropTSE(CRef< CTSE_Info > tse_info) override
Definition: psg_loader.cpp:390
void GetChunks(const TChunkSet &chunks) override
Definition: psg_loader.cpp:305
void GetSequenceLengths(const TIds &ids, TLoaded &loaded, TSequenceLengths &ret) override
Definition: psg_loader.cpp:420
SHashFound GetSequenceHashFound(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:371
void GetAccVers(const TIds &ids, TLoaded &loaded, TIds &ret) override
Definition: psg_loader.cpp:402
TBlobId GetBlobId(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:204
TSeqPos GetSequenceLength(const CSeq_id_Handle &idh) override
Request for a length of a sequence.
Definition: psg_loader.cpp:364
TTSE_LockSet GetExternalAnnotRecordsNA(const CBioseq_Info &bioseq, const SAnnotSelector *sel, TProcessedNAs *processed_nas) override
Definition: psg_loader.cpp:289
void GetBlobs(TTSE_LockSets &tse_sets) override
Definition: psg_loader.cpp:311
TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice) override
Request from a datasource using handles and ranges instead of seq-loc The TSEs loaded in this call wi...
Definition: psg_loader.cpp:224
STypeFound GetSequenceTypeFound(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:378
TTSE_LockSet GetOrphanAnnotRecordsNA(const CSeq_id_Handle &idh, const SAnnotSelector *sel, TProcessedNAs *processed_nas) override
new Get*AnnotRecords() methods
Definition: psg_loader.cpp:231
TNamedAnnotNames GetNamedAnnotAccessions(const CSeq_id_Handle &idh) override
Definition: psg_loader.cpp:445
void GetSequenceTypes(const TIds &ids, TLoaded &loaded, TSequenceTypes &ret) override
Definition: psg_loader.cpp:426
CRef< CPSGDataLoader_Impl > m_Impl
Definition: psg_loader.hpp:169
TTSE_Lock GetBlobById(const TBlobId &blob_id) override
Definition: psg_loader.cpp:324
virtual CDataLoader * CreateAndRegister(CObjectManager &om, const TPluginManagerParamTree *params) const
Definition: psg_loader.cpp:571
virtual ~CPSG_DataLoaderCF(void)
Definition: psg_loader.cpp:562
virtual string ToString(void) const override
Get string representation of blob id.
Definition: psg_loader.cpp:93
CPsgBlobId(const string &id)
Definition: psg_loader.cpp:75
string m_Id
Definition: psg_loader.hpp:82
static CConstRef< CPsgBlobId > GetPsgBlobId(const CBlobId &blob_id)
Definition: psg_loader.cpp:132
virtual bool operator<(const CBlobId &id) const override
Definition: psg_loader.cpp:106
virtual bool operator==(const CBlobId &id) const override
Definition: psg_loader.cpp:99
virtual ~CPsgBlobId()
Definition: psg_loader.cpp:88
bool GetSatSatkey(int &sat, int &satkey) const
Definition: psg_loader.cpp:116
CStringException –.
Definition: ncbistr.hpp:4506
const TBlobId & GetBlobId(void) const
Definition: tse_info.hpp:907
definition of a Culling tree
Definition: ncbi_tree.hpp:100
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const struct name_t names[]
static const char * str(char *buf, int n)
Definition: stats.c:84
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define INVALID_TAX_ID
Definition: ncbimisc.hpp:1116
SStrictId_Tax::TId TTaxId
Taxon id type.
Definition: ncbimisc.hpp:1048
#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
CConstRef< CSeq_id > GetSeqId(void) const
bool IsGi(void) const
const CTextseq_id * GetTextseq_Id(void) const
Return embedded CTextseq_id, if any.
Definition: Seq_id.cpp:169
ESNPScaleLimit
SNP annotation scale limits.
Definition: Seq_id.hpp:847
TLoader * GetLoader(void) const
Get pointer to the loader.
vector< TSeqPos > TSequenceLengths
vector< CTSE_Lock > TCDD_Locks
vector< CSeq_id_Handle > TIds
CBlobIdKey TBlobId
vector< bool > THashKnown
CDataSource * GetDataSource(void) const
Definition: data_loader.cpp:92
vector< TGi > TGis
virtual string ToString(void) const =0
Get string representation of blob id.
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
vector< TIds > TBulkIds
vector< CSeq_inst::TMol > TSequenceTypes
vector< vector< CSeq_id_Handle > > TSeqIdSets
virtual TTaxId GetTaxId(const CSeq_id_Handle &idh)
Request for a taxonomy id of a sequence.
EIsDefault
Flag defining if the data loader is included in the "default" group.
vector< bool > TLoaded
Bulk loading interface for a small pieces of information per id.
vector< string > TLabels
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
vector< TTaxId > TTaxIds
vector< int > TSequenceStates
vector< int > TSequenceHashes
vector< TChunk > TChunkSet
bool LessByTypeId(const CBlobId &id2) const
set< TTSE_Lock > TTSE_LockSet
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
@ eParam_NoThread
Do not use per-thread values.
Definition: ncbi_param.hpp:418
#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 SplitInTwo(const CTempString str, const CTempString delim, string &str1, string &str2, TSplitFlags flags=0)
Split a string into two pieces using the specified delimiters.
Definition: ncbistr.cpp:3554
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 IsSetAccession(void) const
Check if a value has been assigned to Accession data member.
bool IsGeneral(void) const
Check if variant General is selected.
Definition: Seq_id_.hpp:877
bool IsLocal(void) const
Check if variant Local is selected.
Definition: Seq_id_.hpp:775
bool IsSetVersion(void) const
Check if a value has been assigned to Version data member.
constexpr auto sort(_Init &&init)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Helper classes and templates to implement plugins.
USING_SCOPE(objects)
NCBI_PARAM_ENUM_DECL(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT)
NCBI_PARAM_ENUM_ARRAY(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT)
Definition: psg_loader.cpp:55
typedef NCBI_PARAM_TYPE(PSG_LOADER, SNP_SCALE_LIMIT) TSNP_Scale_Limit
const char kDataLoader_PSG_DriverName[]
Definition: psg_loader.cpp:155
NCBI_PARAM_ENUM_DEF_EX(objects::CSeq_id::ESNPScaleLimit, PSG_LOADER, SNP_SCALE_LIMIT, objects::CSeq_id::eSNPScaleLimit_Default, eParam_NoThread, PSG_LOADER_SNP_SCALE_LIMIT)
CRef< objects::CObjectManager > om
Better replacement of GetAccVer(), this method should be defined in data loaders, GetAccVer() is left...
Better replacement of GetGi(), this method should be defined in data loaders, GetGi() is left for com...
Better replacement of GetSequenceHash(), this method should be defined in data loaders,...
Better replacement of GetSequenceType(), this method should be defined in data loaders,...
SAnnotSelector –.
SRegisterLoaderInfo –.
#define const
Definition: zconf.h:232
Modified on Wed May 01 14:23:03 2024 by modify_doxy.py rev. 669887