57 #define NCBI_USE_ERRCODE_X VDBGraphLoader
66 #define OVERVIEW_NAME_SUFFIX "@@5000"
67 #define MID_ZOOM_NAME_SUFFIX "@@100"
154 static int lookup_type =
NCBI_PARAM_TYPE(VDBGRAPH_LOADER, LOOKUP_TYPE)::GetDefault();
246 LOG_POST_X(1,
"CVDBGraphDataLoader: opening explicit file "<<*it);
263 unsigned retry_count)
265 if ( retry_count == 0 ) {
268 for (
unsigned t = 1;
t < retry_count; ++
t ) {
277 LOG_POST(
Warning<<
"CVDBGraphDataLoader::"<<name<<
"() try "<<
t<<
" exception: "<<exc);
279 catch ( exception& exc ) {
283 LOG_POST(
Warning<<
"CVDBGraphDataLoader::"<<name<<
"() try "<<
t<<
" exception");
288 LOG_POST(
Warning<<
"CVDBGraphDataLoader: waiting "<<wait_sec<<
"s before retry");
315 info->m_VDBFile = name;
324 return m_BaseAnnotName;
432 ds, cref(
id), sel, processed_nas),
433 "GetOrphanAnnotRecords");
448 if ( it.second->ContainsAnnotsFor(
id) ) {
478 if (
file->ContainsAnnotsFor(
id) ) {
494 "loading full entry for "<<blob_id.
m_SeqId);
515 info.GetMainAnnotName(),
520 info.GetMainAnnotName(),
524 info.GetMainAnnotName(),
535 "loading split entry for "<<blob_id.
m_SeqId);
559 static const TSeqPos kSize[3] = {
565 info.GetOverviewAnnotName(),
566 info.GetMidZoomAnnotName(),
567 info.GetMainAnnotName()
571 for (
int k = 0; k < 3; ++k ) {
580 for (
int i = 0;
i*kSize[k] < length; ++
i ) {
581 TSeqPos from =
i*kSize[k], to_open =
min(length, from+kSize[k]);
583 size_t id_add = kIdAdd[k];
633 static const char*
const kTypeName[
kChunkIdMul] = {
639 string name =
info.GetMainAnnotName();
642 TSeqPos from =
i*kSize[k], to_open =
min(length, from+kSize[k]);
645 "loading "<<kTypeName[k]<<
" chunk "<<blob_id.
m_SeqId<<
646 " @ "<<from<<
"-"<<(to_open-1));
653 "loaded "<<kTypeName[k]<<
" chunk "<<blob_id.
m_SeqId<<
665 if ( s.size() < 13 ) {
668 if ( s[0] !=
'N' || s[1] !=
'A' || s[11] !=
'.' ) {
671 for (
int i = 0;
i < 9; ++
i ) {
699 info->m_VDBFile = na_acc;
700 info->m_BaseAnnotName = na_acc;
703 LOG_POST_X(2,
"CVDBGraphDataLoader: auto-opening file "<<na_acc);
712 LOG_POST_X(3,
"CVDBGraphDataLoader: accession not found: "<<na_acc);
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)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
@ eNotFoundDb
DB main file not found.
virtual TErrCode GetErrCode(void) const
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)
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
bool IsLoaded(void) const
void AddChunk(CTSE_Chunk_Info &chunk_info)
string ToString(void) const
Get string representation of blob id.
bool operator==(const CBlobId &id) const
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)
~CVDBGraphDataLoader_Impl(void)
TTSE_Lock GetBlobById(CDataSource *ds, const TBlobId &blob_id)
CRef< SVDBFileInfo > x_GetFileInfo(const string &name)
TFixedFileMap m_FixedFileMap
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)
vector< string > TVDBFiles
TAutoFileMap m_AutoFileMap
TBlobId GetBlobId(const CSeq_id_Handle &idh)
TBlobId GetBlobIdFromString(const string &str) const
CRef< SVDBFileInfo > OpenVDBGraphFile(const string &name)
TMissingFileSet m_MissingFileSet
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
TSeqPos GetSeqLength(void) const
CRef< CSeq_annot > GetAnnot(COpenRange< TSeqPos > range, const string &annot_name=kEmptyStr, TContentFlags content=fDefaultContent) const
const CSeq_id_Handle & GetSeq_id_Handle(void) const
container_type::iterator iterator
const_iterator end() const
const_iterator find(const key_type &key) const
iterator_bool insert(const value_type &val)
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
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)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Warning(CExceptionArgs_Base &args)
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
string GetName(void) const
Get the base entry name with extension (if any).
#define MSerial_AsnText
I/O stream manipulators –.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
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.
@ eParam_NoThread
Do not use per-thread values.
uint32_t Uint4
4-byte (32-bit) unsigned integer
static TThisType GetWhole(void)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
NCBI_NS_STD::string::size_type SIZE_TYPE
static int StringToNonNegativeInt(const CTempString str, TStringToNumFlags flags=0)
Convert string to non-negative integer value.
TSet & SetSet(void)
Select the variant.
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
void SetId(TId &value)
Assign a value to Id data member.
list< CRef< CSeq_annot > > TAnnot
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in SRA C++ support libraries.
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
string s_Value(TValue value)
const GenericPointer< typename T::ValueType > T2 value
void SleepMilliSec(unsigned long ml_sec, EInterruptOnSignal onsignal=eRestartOnSignal)
Helper classes and templates to implement plugins.
string GetMidZoomAnnotName(void) const
string GetMainAnnotName(void) const
bool ContainsAnnotsFor(const CSeq_id_Handle &id) const
string GetOverviewAnnotName(void) const
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