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

Go to the SVN repository for this file.

1 /* $Id: vdbgraphloader_impl.cpp 100510 2023-08-08 16:07:50Z 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
27  *
28  * File Description: data loader for VDB graph data
29  *
30  * ===========================================================================
31  */
32 
33 #include <ncbi_pch.hpp>
34 #include <corelib/ncbistd.hpp>
35 
38 #include <objects/seq/seq__.hpp>
40 
49 
53 #include <sra/error_codes.hpp>
54 
56 
57 #define NCBI_USE_ERRCODE_X VDBGraphLoader
59 
60 class CObject;
61 
63 
64 class CDataLoader;
65 
66 #define OVERVIEW_NAME_SUFFIX "@@5000"
67 #define MID_ZOOM_NAME_SUFFIX "@@100"
68 
69 static const TSeqPos kOverviewChunkSize = 20000*5000;
70 static const TSeqPos kMidZoomChunkSize = 20000*100;
71 static const TSeqPos kMainChunkSize = 100000;
72 
73 static const size_t kOverviewChunkIdAdd = 0;
74 static const size_t kMidZoomChunkIdAdd = 1;
75 static const size_t kMainGraphChunkIdAdd = 2;
76 static const size_t kMainTableChunkIdAdd = 3;
77 static const size_t kChunkIdMul = 4;
78 
79 static const int kTSEId = 1;
80 
81 NCBI_PARAM_DECL(int, VDBGRAPH_LOADER, DEBUG);
82 NCBI_PARAM_DEF_EX(int, VDBGRAPH_LOADER, DEBUG, 0,
83  eParam_NoThread, VDBGRAPH_LOADER_DEBUG);
84 
85 static int GetDebugLevel(void)
86 {
87  static CSafeStatic<NCBI_PARAM_TYPE(VDBGRAPH_LOADER, DEBUG)> s_Value;
88  return s_Value->Get();
89 }
90 
91 
92 NCBI_PARAM_DECL(size_t, VDBGRAPH_LOADER, GC_SIZE);
93 NCBI_PARAM_DEF_EX(size_t, VDBGRAPH_LOADER, GC_SIZE, 10,
94  eParam_NoThread, VDBGRAPH_LOADER_GC_SIZE);
95 
96 static size_t GetGCSize(void)
97 {
98  static CSafeStatic<NCBI_PARAM_TYPE(VDBGRAPH_LOADER, GC_SIZE)> s_Value;
99  return s_Value->Get();
100 }
101 
102 
103 NCBI_PARAM_DECL(size_t, VDBGRAPH_LOADER, MISSING_GC_SIZE);
104 NCBI_PARAM_DEF_EX(size_t, VDBGRAPH_LOADER, MISSING_GC_SIZE, 10000,
105  eParam_NoThread, VDBGRAPH_LOADER_MISSING_GC_SIZE);
106 
107 static size_t GetMissingGCSize(void)
108 {
109  static CSafeStatic<NCBI_PARAM_TYPE(VDBGRAPH_LOADER, MISSING_GC_SIZE)> s_Value;
110  return s_Value->Get();
111 }
112 
113 
114 NCBI_PARAM_DECL(int, VDBGRAPH_LOADER, USE_TABLE);
115 NCBI_PARAM_DEF_EX(int, VDBGRAPH_LOADER, USE_TABLE, 2,
116  eParam_NoThread, VDBGRAPH_LOADER_USE_TABLE);
117 
118 static int GetUseTable(void)
119 {
120  static CSafeStatic<NCBI_PARAM_TYPE(VDBGRAPH_LOADER, USE_TABLE)> s_Value;
121  return s_Value->Get();
122 }
123 
124 
125 NCBI_PARAM_DECL(bool, VDBGRAPH_LOADER, DISABLE_ZOOM);
126 NCBI_PARAM_DEF_EX(bool, VDBGRAPH_LOADER, DISABLE_ZOOM, false,
127  eParam_NoThread, VDBGRAPH_LOADER_DISABLE_ZOOM);
128 
129 static bool GetDisabledZoom(void)
130 {
131  static CSafeStatic<NCBI_PARAM_TYPE(VDBGRAPH_LOADER, DISABLE_ZOOM)> s_Value;
132  return s_Value->Get();
133 }
134 
135 
136 static bool GetEnabledOverview(void)
137 {
138  return !GetDisabledZoom();
139 }
140 
141 
142 static bool GetEnabledMidZoom(void)
143 {
144  return !GetDisabledZoom();
145 }
146 
147 
148 NCBI_PARAM_DECL(int, VDBGRAPH_LOADER, LOOKUP_TYPE);
149 NCBI_PARAM_DEF_EX(int, VDBGRAPH_LOADER, LOOKUP_TYPE, CVDBGraphDb_Impl::eLookupDefault,
150  eParam_NoThread, VDBGRAPH_LOADER_LOOKUP_TYPE);
151 
153 {
154  static int lookup_type = NCBI_PARAM_TYPE(VDBGRAPH_LOADER, LOOKUP_TYPE)::GetDefault();
155  return CVDBGraphDb_Impl::ELookupType(lookup_type);
156 }
157 
158 
159 NCBI_PARAM_DECL(unsigned, VDBGRAPH_LOADER, RETRY_COUNT);
160 NCBI_PARAM_DEF(unsigned, VDBGRAPH_LOADER, RETRY_COUNT, 3);
161 
162 static unsigned GetRetryCountParam(void)
163 {
164  static unsigned value = NCBI_PARAM_TYPE(VDBGRAPH_LOADER, RETRY_COUNT)::GetDefault();
165  return value;
166 }
167 
168 
169 /////////////////////////////////////////////////////////////////////////////
170 // CVDBGraphBlobId
171 /////////////////////////////////////////////////////////////////////////////
172 
173 class CVDBGraphBlobId : public CBlobId
174 {
175 public:
176  CVDBGraphBlobId(const string& file, const CSeq_id_Handle& id);
177  ~CVDBGraphBlobId(void);
178 
179  string m_VDBFile;
182 
183  string ToString(void) const;
184  CVDBGraphBlobId(const string& str);
185 
186  bool operator<(const CBlobId& id) const;
187  bool operator==(const CBlobId& id) const;
188 };
189 
190 
192  : m_VDBFile(file),
193  m_SeqId(id)
194 {
195 }
196 
197 
199 {
200 }
201 
202 
203 string CVDBGraphBlobId::ToString(void) const
204 {
206  out << m_VDBFile << '\0' << m_SeqId;
208 }
209 
210 
212 {
213  SIZE_TYPE pos1 = str.find('\0');
214  m_VDBFile = str.substr(0, pos1);
215  m_SeqId = CSeq_id_Handle::GetHandle(str.substr(pos1+1));
216 }
217 
218 
219 bool CVDBGraphBlobId::operator<(const CBlobId& id) const
220 {
221  const CVDBGraphBlobId& sra2 = dynamic_cast<const CVDBGraphBlobId&>(id);
222  return m_SeqId < sra2.m_SeqId ||
223  (m_SeqId == sra2.m_SeqId && m_VDBFile < sra2.m_VDBFile);
224 }
225 
226 
228 {
229  const CVDBGraphBlobId& sra2 = dynamic_cast<const CVDBGraphBlobId&>(id);
230  return m_SeqId == sra2.m_SeqId && m_VDBFile == sra2.m_VDBFile;
231 }
232 
233 
234 /////////////////////////////////////////////////////////////////////////////
235 // CVDBGraphDataLoader_Impl
236 /////////////////////////////////////////////////////////////////////////////
237 
238 
240  : m_RetryCount(GetRetryCountParam()),
241  m_AutoFileMap(GetGCSize()),
242  m_MissingFileSet(GetMissingGCSize())
243 {
244  ITERATE ( TVDBFiles, it, vdb_files ) {
245  if ( GetDebugLevel() >= 2 ) {
246  LOG_POST_X(1, "CVDBGraphDataLoader: opening explicit file "<<*it);
247  }
249  m_FixedFileMap[*it] = info;
250  }
251 }
252 
253 
255 {
256 }
257 
258 
259 template<class Call>
262  const char* name,
263  unsigned retry_count)
264 {
265  if ( retry_count == 0 ) {
266  retry_count = m_RetryCount;
267  }
268  for ( unsigned t = 1; t < retry_count; ++ t ) {
269  try {
270  return call();
271  }
272  catch ( CBlobStateException& ) {
273  // no retry
274  throw;
275  }
276  catch ( CException& exc ) {
277  LOG_POST(Warning<<"CVDBGraphDataLoader::"<<name<<"() try "<<t<<" exception: "<<exc);
278  }
279  catch ( exception& exc ) {
280  LOG_POST(Warning<<"CVDBGraphDataLoader::"<<name<<"() try "<<t<<" exception: "<<exc.what());
281  }
282  catch ( ... ) {
283  LOG_POST(Warning<<"CVDBGraphDataLoader::"<<name<<"() try "<<t<<" exception");
284  }
285  if ( t >= 2 ) {
286  //double wait_sec = m_WaitTime.GetTime(t-2);
287  double wait_sec = 1;
288  LOG_POST(Warning<<"CVDBGraphDataLoader: waiting "<<wait_sec<<"s before retry");
289  SleepMilliSec(Uint4(wait_sec*1000));
290  }
291  }
292  return call();
293 }
294 
295 
297 {
298  return CVDBGraphSeqIterator(m_VDB, id);
299 }
300 
301 
304 {
306  name),
307  "OpenVDBGraphFile");
308 }
309 
310 
313 {
315  info->m_VDBFile = name;
316  info->m_BaseAnnotName = CDirEntry(name).GetName();
317  info->m_VDB = CVDBGraphDb(m_Mgr, name, GetLookupType());
318  return info;
319 }
320 
321 
323 {
324  return m_BaseAnnotName;
325 }
326 
327 
329 {
330  return m_BaseAnnotName+OVERVIEW_NAME_SUFFIX;
331 }
332 
333 
335 {
336  return m_BaseAnnotName+MID_ZOOM_NAME_SUFFIX;
337 }
338 
339 
341 {
343  if ( m_FixedFileMap.empty() ) {
344  // implicit loading data loader has lower priority by default
345  priority += 1;
346  }
347  return priority;
348 }
349 
350 
353 {
356  const SVDBFileInfo& info = *it->second;
357  names.push_back(CAnnotName(info.GetMainAnnotName()));
358  names.push_back(CAnnotName(info.GetMidZoomAnnotName()));
359  names.push_back(CAnnotName(info.GetOverviewAnnotName()));
360  }
361  sort(names.begin(), names.end());
362  names.erase(unique(names.begin(), names.end()), names.end());
363  return names;
364 }
365 
366 
369 {
370  // no blobs with sequence
371  return CDataLoader::TBlobId();
372 }
373 
374 
377 {
379 }
380 
381 
384  const CDataLoader::TBlobId& blob_id)
385 {
387  ds, cref(blob_id)),
388  "GetBlobById");
389 }
390 
391 
394  const CDataLoader::TBlobId& blob_id0)
395 {
396  CTSE_LoadLock load_lock = ds->GetTSE_LoadLock(blob_id0);
397  if ( !load_lock.IsLoaded() ) {
398  const CVDBGraphBlobId& blob_id =
399  dynamic_cast<const CVDBGraphBlobId&>(*blob_id0);
400  if ( 1 ) {
401  LoadSplitEntry(*load_lock, blob_id);
402  }
403  else {
404  load_lock->SetSeq_entry(*LoadFullEntry(blob_id));
405  }
406  load_lock.SetLoaded();
407  }
408  return load_lock;
409 }
410 
411 
414  const CSeq_id_Handle& id,
415  CDataLoader::EChoice choice)
416 {
417  if ( choice == CDataLoader::eOrphanAnnot ||
418  choice == CDataLoader::eAll ) {
419  return GetOrphanAnnotRecords(ds, id, 0, 0);
420  }
421  return TTSE_LockSet();
422 }
423 
424 
427  const CSeq_id_Handle& id,
428  const SAnnotSelector* sel,
429  CDataLoader::TProcessedNAs* processed_nas)
430 {
432  ds, cref(id), sel, processed_nas),
433  "GetOrphanAnnotRecords");
434 }
435 
436 
439  const CSeq_id_Handle& id,
440  const SAnnotSelector* sel,
441  CDataLoader::TProcessedNAs* processed_nas)
442 {
443  TTSE_LockSet locks;
444  // explicitly specified files
445  for ( auto& it : m_FixedFileMap ) {
446  if ( !sel || CDataLoader::IsRequestedNA(it.second->m_BaseAnnotName, sel) ) {
447  CDataLoader::SetProcessedNA(it.second->m_BaseAnnotName, processed_nas);
448  if ( it.second->ContainsAnnotsFor(id) ) {
449  TBlobId blob_id(new CVDBGraphBlobId(it.second->m_VDBFile, id));
450  locks.insert(GetBlobById(ds, blob_id));
451  }
452  }
453  }
454  // implicitly load NA accessions
458  if ( m_AutoFileMap.get_size_limit() < accs.size() ) {
459  // increase VDB cache size
461  }
462  if ( m_MissingFileSet.get_size_limit() < accs.size() ) {
463  // increase VDB cache size
465  }
467  if ( 1 ) {
468  TBlobId blob_id(new CVDBGraphBlobId(it->first, id));
469  if ( CTSE_LoadLock lock = ds->GetTSE_LoadLockIfLoaded(blob_id) ) {
470  CDataLoader::SetProcessedNA(it->first, processed_nas);
471  locks.insert(GetBlobById(ds, blob_id));
472  continue;
473  }
474  }
475  SVDBFileInfo* file = x_GetNAFileInfo(it->first);
476  if ( file ) {
477  CDataLoader::SetProcessedNA(it->first, processed_nas);
478  if ( file->ContainsAnnotsFor(id) ) {
479  TBlobId blob_id(new CVDBGraphBlobId(file->m_VDBFile, id));
480  locks.insert(GetBlobById(ds, blob_id));
481  }
482  }
483  }
484  }
485  return locks;
486 }
487 
488 
491 {
492  if ( GetDebugLevel() >= 5 ) {
493  LOG_POST_X(4, "CVDBGraphDataLoader: "
494  "loading full entry for "<<blob_id.m_SeqId);
495  }
496  CRef<SVDBFileInfo> info_ref = x_GetFileInfo(blob_id.m_VDBFile);
497  SVDBFileInfo& info = *info_ref;
498  CVDBGraphSeqIterator it(info.m_VDB, blob_id.m_SeqId);
499  if ( !it ) {
500  return null;
501  }
502  CRef<CSeq_entry> entry(new CSeq_entry);
503  entry->SetSet().SetSeq_set();
505  CBioseq_set::TAnnot& dst = entry->SetSet().SetAnnot();
509  if ( GetUseTable() == 2 ||
510  (GetUseTable() == 1 && it.SeqTableIsSmaller(range)) ) {
511  main_flags |= it.fGraphMainAsTable;
512  }
513  if ( GetEnabledOverview() ) {
514  dst.push_back(it.GetAnnot(range,
515  info.GetMainAnnotName(),
516  overview_flags));
517  }
518  if ( GetEnabledMidZoom() && info.m_VDB->HasMidZoomGraphs() ) {
519  dst.push_back(it.GetAnnot(range,
520  info.GetMainAnnotName(),
521  mid_zoom_flags));
522  }
523  dst.push_back(it.GetAnnot(range,
524  info.GetMainAnnotName(),
525  main_flags));
526  return entry;
527 }
528 
529 
531  const CVDBGraphBlobId& blob_id)
532 {
533  if ( GetDebugLevel() >= 5 ) {
534  LOG_POST_X(5, "CVDBGraphDataLoader: "
535  "loading split entry for "<<blob_id.m_SeqId);
536  }
537  CRef<SVDBFileInfo> info_ref = x_GetFileInfo(blob_id.m_VDBFile);
538  const_cast<CVDBGraphBlobId&>(blob_id).m_FileInfo = info_ref;
539  SVDBFileInfo& info = *info_ref;
540  CVDBGraphSeqIterator it(info.m_VDB, blob_id.m_SeqId);
541  if ( !it ) {
542  return;
543  }
544  CRef<CSeq_entry> entry(new CSeq_entry);
545  entry->SetSet().SetSeq_set();
546  entry->SetSet().SetId().SetId(kTSEId);
547  tse.SetSeq_entry(*entry);
548  TSeqPos length = it.GetSeqLength();
549  size_t kIdAdd[3] = {
553  };
554  if ( GetUseTable() == 2 ||
555  (GetUseTable() == 1 &&
557  kIdAdd[2] = kMainTableChunkIdAdd;
558  }
559  static const TSeqPos kSize[3] = {
563  };
564  CAnnotName kName[3] = {
565  info.GetOverviewAnnotName(),
566  info.GetMidZoomAnnotName(),
567  info.GetMainAnnotName()
568  };
569  CTSE_Split_Info& split_info = tse.GetSplitInfo();
571  for ( int k = 0; k < 3; ++k ) {
572  if ( kIdAdd[k] == kOverviewChunkIdAdd &&
573  !GetEnabledOverview() ) {
574  continue;
575  }
576  if ( kIdAdd[k] == kMidZoomChunkIdAdd &&
577  !(GetEnabledMidZoom() && info.m_VDB->HasMidZoomGraphs()) ) {
578  continue;
579  }
580  for ( int i = 0; i*kSize[k] < length; ++i ) {
581  TSeqPos from = i*kSize[k], to_open = min(length, from+kSize[k]);
582  COpenRange<TSeqPos> range(from, to_open);
583  size_t id_add = kIdAdd[k];
585  if ( id_add == kMainTableChunkIdAdd ) {
587  }
588  int chunk_id = int(i*kChunkIdMul+id_add);
589  CRef<CTSE_Chunk_Info> chunk(new CTSE_Chunk_Info(chunk_id));
590  chunk->x_AddAnnotType(kName[k], type, it.GetSeq_id_Handle(), range);
591  chunk->x_AddAnnotPlace(place);
592  split_info.AddChunk(*chunk);
593  }
594  }
595 }
596 
597 
599 {
601  ref(chunk)),
602  "GetChunk");
603 }
604 
605 
607 {
608  const CVDBGraphBlobId& blob_id =
609  dynamic_cast<const CVDBGraphBlobId&>(*chunk.GetBlobId());
610  CRef<SVDBFileInfo> info_ref = blob_id.m_FileInfo;
611  if ( !info_ref ) {
612  info_ref = x_GetFileInfo(blob_id.m_VDBFile);
613  }
614  SVDBFileInfo& info = *info_ref;
615  CVDBGraphSeqIterator it(info.m_VDB, blob_id.m_SeqId);
616  if ( !it ) {
617  return;
618  }
619  TSeqPos length = it.GetSeqLength();
620 
621  static const TSeqPos kSize[kChunkIdMul] = {
626  };
632  };
633  static const char* const kTypeName[kChunkIdMul] = {
634  "overview",
635  "mid-zoom",
636  "main graph",
637  "main table"
638  };
639  string name = info.GetMainAnnotName();
640  int k = chunk.GetChunkId()%kChunkIdMul;
641  int i = chunk.GetChunkId()/kChunkIdMul;
642  TSeqPos from = i*kSize[k], to_open = min(length, from+kSize[k]);
643  if ( GetDebugLevel() >= 6 ) {
644  LOG_POST_X(6, "CVDBGraphDataLoader: "
645  "loading "<<kTypeName[k]<<" chunk "<<blob_id.m_SeqId<<
646  " @ "<<from<<"-"<<(to_open-1));
647  }
649  CRef<CSeq_annot> annot =
650  it.GetAnnot(COpenRange<TSeqPos>(from, to_open), name, flags);
651  if ( GetDebugLevel() >= 6 ) {
652  LOG_POST_X(7, "CVDBGraphDataLoader: "
653  "loaded "<<kTypeName[k]<<" chunk "<<blob_id.m_SeqId<<
654  " @ "<<from<<"-"<<(to_open-1)<<": "<<MSerial_AsnText<<*annot);
655  }
657  chunk.x_LoadAnnot(place, *annot);
658  chunk.SetLoaded();
659 }
660 
661 
662 static bool sx_IsNA(const string& s)
663 {
664  // NA%09d.%d
665  if ( s.size() < 13 ) {
666  return false;
667  }
668  if ( s[0] != 'N' || s[1] != 'A' || s[11] != '.' ) {
669  return false;
670  }
671  for ( int i = 0; i < 9; ++i ) {
672  if ( !isdigit(s[i+2]&0xff) ) {
673  return false;
674  }
675  }
676  return NStr::StringToNonNegativeInt(s.substr(12)) > 0;
677 }
678 
679 
682 {
683  if ( !m_FixedFileMap.empty() ) {
684  return null;
685  }
686  if ( !sx_IsNA(na_acc) ) {
687  return null;
688  }
689  CMutexGuard guard(m_Mutex);
690  TMissingFileSet::iterator it2 = m_MissingFileSet.find(na_acc);
691  if ( it2 != m_MissingFileSet.end() ) {
692  return null;
693  }
694  TAutoFileMap::iterator it = m_AutoFileMap.find(na_acc);
695  if ( it != m_AutoFileMap.end() ) {
696  return it->second;
697  }
699  info->m_VDBFile = na_acc;
700  info->m_BaseAnnotName = na_acc;
701  try {
702  if ( GetDebugLevel() >= 2 ) {
703  LOG_POST_X(2, "CVDBGraphDataLoader: auto-opening file "<<na_acc);
704  }
705  info->m_VDB = CVDBGraphDb(m_Mgr, na_acc, GetLookupType());
706  }
707  catch ( CSraException& exc ) {
708  if ( exc.GetErrCode() != exc.eNotFoundDb ) {
709  throw;
710  }
711  if ( GetDebugLevel() >= 2 ) {
712  LOG_POST_X(3, "CVDBGraphDataLoader: accession not found: "<<na_acc);
713  }
714  m_MissingFileSet[na_acc] = true;
715  return null;
716  }
717  m_AutoFileMap[na_acc] = info;
718  return info;
719 }
720 
721 
724 {
726  if ( it != m_FixedFileMap.end() ) {
727  return it->second;
728  }
729  return x_GetNAFileInfo(name);
730 }
731 
732 
static const NStr::TNumToStringFlags kFlags
Blob state exceptions, used by GenBank loader.
CTSE_LoadLock GetTSE_LoadLock(const TBlobId &blob_id)
CTSE_LoadLock GetTSE_LoadLockIfLoaded(const TBlobId &blob_id)
CDirEntry –.
Definition: ncbifile.hpp:262
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Definition: ncbistre.hpp:802
CObject –.
Definition: ncbiobj.hpp:180
CSafeStatic<>::
Definition: Seq_entry.hpp:56
@ eNotFoundDb
DB main file not found.
Definition: exception.hpp:92
virtual TErrCode GetErrCode(void) const
Definition: sraread.cpp:164
pair< TBioseqId, TBioseq_setId > TPlace
void x_AddAnnotPlace(const TBioseqId &id)
TBlobId GetBlobId(void) const
void x_LoadAnnot(const TPlace &place, const CSeq_annot &annot)
void SetLoaded(CObject *obj=0)
TChunkId GetChunkId(void) const
void x_AddAnnotType(const CAnnotName &annot_name, const SAnnotTypeSelector &annot_type, const TLocationId &location_id)
CTSE_Split_Info & GetSplitInfo(void)
Definition: tse_info.cpp:1395
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
Definition: tse_info.cpp:351
bool IsLoaded(void) const
void SetLoaded(void)
void AddChunk(CTSE_Chunk_Info &chunk_info)
string ToString(void) const
Get string representation of blob id.
bool operator==(const CBlobId &id) const
CSeq_id_Handle m_SeqId
CRef< CVDBGraphDataLoader_Impl::SVDBFileInfo > m_FileInfo
bool operator<(const CBlobId &id) const
CVDBGraphBlobId(const string &file, const CSeq_id_Handle &id)
CRef< SVDBFileInfo > OpenVDBGraphFileOnce(const string &name)
TTSE_LockSet GetOrphanAnnotRecords(CDataSource *ds, const CSeq_id_Handle &idh, const SAnnotSelector *sel, CDataLoader::TProcessedNAs *processed_nas)
std::invoke_result< Call >::type CallWithRetry(Call &&call, const char *name, unsigned retry_count=0)
void GetChunkOnce(CTSE_Chunk_Info &chunk)
void GetChunk(CTSE_Chunk_Info &chunk)
TTSE_Lock GetBlobById(CDataSource *ds, const TBlobId &blob_id)
CRef< SVDBFileInfo > x_GetFileInfo(const string &name)
CRef< CSeq_entry > LoadFullEntry(const CVDBGraphBlobId &blob_id)
CDataLoader::TTSE_LockSet TTSE_LockSet
TAnnotNames GetPossibleAnnotNames(void) const
TTSE_Lock GetBlobByIdOnce(CDataSource *ds, const TBlobId &blob_id)
CVDBGraphDataLoader_Impl(const TVDBFiles &vdb_files)
TBlobId GetBlobId(const CSeq_id_Handle &idh)
TBlobId GetBlobIdFromString(const string &str) const
CRef< SVDBFileInfo > OpenVDBGraphFile(const string &name)
CObjectManager::TPriority GetDefaultPriority(void) const
CRef< SVDBFileInfo > x_GetNAFileInfo(const string &na_acc)
TTSE_LockSet GetRecords(CDataSource *ds, const CSeq_id_Handle &idh, CDataLoader::EChoice choice)
TTSE_LockSet GetOrphanAnnotRecordsOnce(CDataSource *ds, const CSeq_id_Handle &idh, const SAnnotSelector *sel, CDataLoader::TProcessedNAs *processed_nas)
vector< CAnnotName > TAnnotNames
void LoadSplitEntry(CTSE_Info &tse, const CVDBGraphBlobId &blob_id)
bool SeqTableIsSmaller(COpenRange< TSeqPos > range) const
Definition: graphread.cpp:651
TSeqPos GetSeqLength(void) const
Definition: graphread.hpp:227
CRef< CSeq_annot > GetAnnot(COpenRange< TSeqPos > range, const string &annot_name=kEmptyStr, TContentFlags content=fDefaultContent) const
Definition: graphread.cpp:669
const CSeq_id_Handle & GetSeq_id_Handle(void) const
Definition: graphread.hpp:223
size_type size() const
Definition: map.hpp:148
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
const_iterator find(const key_type &key) const
Definition: map.hpp:153
iterator_bool insert(const value_type &val)
Definition: set.hpp:149
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static int type
Definition: getdata.c:31
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 ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
iterator end(void)
iterator find(const key_type &key)
size_t get_size_limit(void) const
void set_size_limit(size_t size_limit)
#define LOG_POST_X(err_subcode, message)
Definition: ncbidiag.hpp:553
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
string GetName(void) const
Get the base entry name with extension (if any).
Definition: ncbifile.hpp:3917
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:696
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
CBlobIdKey TBlobId
static void SetProcessedNA(const string &na, TProcessedNAs *processed_nas)
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
static bool IsRequestedAnyNA(const SAnnotSelector *sel)
static bool IsRequestedNA(const string &na, const SAnnotSelector *sel)
@ kPriority_Extra
Default priority for extra annot loaders.
@ eAll
all blobs (main and external)
@ eOrphanAnnot
all external annotations if no Bioseq exists
const TNamedAnnotAccessions & GetNamedAnnotAccessions(void) const
#define NCBI_PARAM_TYPE(section, name)
Generate typename for a parameter from its {section, name} attributes.
Definition: ncbi_param.hpp:149
@ eParam_NoThread
Do not use per-thread values.
Definition: ncbi_param.hpp:418
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
static TThisType GetWhole(void)
Definition: range.hpp:272
#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
NCBI_NS_STD::string::size_type SIZE_TYPE
Definition: ncbistr.hpp:132
static int StringToNonNegativeInt(const CTempString str, TStringToNumFlags flags=0)
Convert string to non-negative integer value.
Definition: ncbistr.cpp:457
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
void SetId(TId &value)
Assign a value to Id data member.
Definition: Bioseq_set_.cpp:93
list< CRef< CSeq_annot > > TAnnot
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
E_Choice
Choice variants.
Definition: Seq_annot_.hpp:131
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
#define DEBUG
Definition: config.h:32
Definition of all error codes used in SRA C++ support libraries.
FILE * file
int i
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
string s_Value(TValue value)
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
EIPRangeType t
Definition: ncbi_localip.c:101
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
int isdigit(Uchar c)
Definition: ncbictype.hpp:64
T min(T x_, T y_)
Helper classes and templates to implement plugins.
static const bool kName
bool ContainsAnnotsFor(const CSeq_id_Handle &id) const
SAnnotSelector –.
Definition: type.c:6
static const size_t kMainTableChunkIdAdd
static const size_t kMainGraphChunkIdAdd
static unsigned GetRetryCountParam(void)
#define MID_ZOOM_NAME_SUFFIX
static const TSeqPos kMainChunkSize
NCBI_PARAM_DEF(unsigned, VDBGRAPH_LOADER, RETRY_COUNT, 3)
static CVDBGraphDb_Impl::ELookupType GetLookupType(void)
static bool GetEnabledOverview(void)
static const size_t kOverviewChunkIdAdd
static size_t GetGCSize(void)
static const size_t kChunkIdMul
static bool GetEnabledMidZoom(void)
static const size_t kMidZoomChunkIdAdd
static int GetUseTable(void)
static int GetDebugLevel(void)
static size_t GetMissingGCSize(void)
static const TSeqPos kOverviewChunkSize
NCBI_PARAM_DEF_EX(int, VDBGRAPH_LOADER, DEBUG, 0, eParam_NoThread, VDBGRAPH_LOADER_DEBUG)
static bool sx_IsNA(const string &s)
static const TSeqPos kMidZoomChunkSize
NCBI_DEFINE_ERR_SUBCODE_X(8)
static bool GetDisabledZoom(void)
NCBI_PARAM_DECL(int, VDBGRAPH_LOADER, DEBUG)
#define OVERVIEW_NAME_SUFFIX
static const int kTSEId
Modified on Wed Sep 04 15:01:50 2024 by modify_doxy.py rev. 669887