A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/wgsresolver__impl_8cpp_source.html below:

NCBI C++ ToolKit: src/sra/readers/sra/wgsresolver_impl.cpp Source File

46 #define NCBI_USE_ERRCODE_X WGSResolver 52 #define DEFAULT_WGS_INDEX_ACC "ZZZZ99" 53 #define DEFAULT_WGS_INDEX2_ACC "ZZZZ98" 54 #define DEFAULT_WGS_INDEX3_ACC "ZZZZ97" 55 #define DEFAULT_WGS_INDEX_PATH1 NCBI_TRACES04_PATH "/wgs03/WGS/ZZ/ZZ/ZZZZ99" 56 #define DEFAULT_WGS_INDEX_PATH2 NCBI_TRACES04_PATH "/wgs03/WGS/WGS_INDEX" 57 #define DEFAULT_WGS_INDEX2_PATH1 NCBI_TRACES04_PATH "/wgs03/WGS/ZZ/ZZ/ZZZZ98" 58 #define DEFAULT_WGS_INDEX2_PATH2 NCBI_TRACES04_PATH "/wgs03/WGS/WGS_INDEX_V2" 59 #define DEFAULT_WGS_INDEX3_PATH1 NCBI_TRACES04_PATH "/wgs03/WGS/ZZ/ZZ/ZZZZ97" 60 #define DEFAULT_WGS_INDEX3_PATH2 NCBI_TRACES04_PATH "/wgs03/WGS/WGS_INDEX_V3" 62 #define DEFAULT_WGS_RANGE_INDEX_ACC "ZZZZ79" 63 #define DEFAULT_WGS_RANGE_INDEX2_ACC "ZZZZ78" 64 #define DEFAULT_WGS_RANGE_INDEX_PATH1 NCBI_TRACES04_PATH "/wgs03/WGS/ZZ/ZZ/ZZZZ79" 65 #define DEFAULT_WGS_RANGE_INDEX_PATH2 NCBI_TRACES04_PATH "/wgs03/WGS/WGS_RANGE_INDEX_1" 66 #define DEFAULT_WGS_RANGE_INDEX2_PATH1 NCBI_TRACES04_PATH "/wgs03/WGS/ZZ/ZZ/ZZZZ78" 67 #define DEFAULT_WGS_RANGE_INDEX2_PATH2 NCBI_TRACES04_PATH "/wgs03/WGS/WGS_RANGE_INDEX_2" 123 #ifdef COLLECT_PROFILE 129

SProfiler() : name(0),

count

(0) {}

132

cout << name<<

" calls: "

<<

count

<<

" time: "

<<

sw

.

Elapsed

()<<endl;

135 struct

SProfilerGuard

138

SProfilerGuard(SProfiler&

sw

,

const char

* name)

151 static

SProfiler sw_AccFind;

152 static

SProfiler sw_AccRange;

153 static

SProfiler sw_WGSPrefix;

155 # define PROFILE(var) SProfilerGuard guard(var, #var) 157 # define PROFILE(var) 260  if

(

NCBI_PARAM_TYPE

(WGS, RESOLVER_DIRECT_WGS_INDEX)::GetDefault() ) {

261  const char

* path1 = 0;

262  const char

* path2 = 0;

287  if

( path1 &&

CDirEntry

(path1).Exists() ) {

290  else if

( path2 &&

CDirEntry

(path2).Exists() ) {

304  if

( path.empty() ) {

315  if

( path.empty() ) {

320  if

( path.find_first_of(

"\\/"

) !=

NPOS

&& !

CDirEntry

(path).Exists() ) {

323  ERR_POST_X

(9,

"CWGSResolver_VDB: cannot find index file: "

<<path);

334

: m_NextResolver(next_resolver)

384

unique_ptr<SImpl>

impl

= make_unique<SImpl>(mgr, acc_or_path);

391  ERR_POST_X

(33,

"CWGSResolver_VDB("

<<acc_or_path<<

"): " 424

m_GiIdxCursorCache.Put(curs,

row

);

433

m_AccIdxCursorCache.Put(curs);

441  return m_Impl

->GiIdx(gi);

467

: m_FailedGiRequestCount(0),

468

m_FailedAccRequestCount(0)

488  ERR_POST_X

(36,

"CWGSResolver_VDB: cannot get URL timestamp of "

<< path <<

": "

<< exc);

500  auto

gi_idx =

GiIdx

();

502  LOG_POST_X

(33,

"CWGSResolver_VDB("

<<acc_or_path<<

"):" 503  " gi_rows: "

<<gi_idx->m_Cursor.GetMaxRowId()<<

504  " acc_rows: "

<<acc_idx->m_Cursor.GetMaxRowId());

536  LOG_POST_X

(32,

"CWGSResolver_VDB: new index path: "

<<path);

551  ERR_POST_X

(36,

"CWGSResolver_VDB: cannot get URL timestamp of "

<< path <<

": "

<< exc);

570  if

( !

value

.empty() ) {

574

ret.push_back(*

value

);

576  m_Impl

->m_FailedAccRequestCount = 0;

580  m_Impl

->m_FailedAccRequestCount += 1;

589  size_t

acc_len = uacc.size();

590  if

( acc_len <= 4 ) {

593  size_t

prefix_len = acc_len-4;

595  for

(

int i

= 0;

i

< 4; ++

i

) {

596  char

c = uacc[prefix_len+

i

];

597  if

( c < '0' || c >

'9'

) {

600

v = v*10 + (c-

'0'

);

603

uacc.erase(prefix_len);

630

range =

m_Impl

->m_AccIndex.Find(uacc);

634  "range "

<<range.first<<

"-"

<<range.second);

636  if

( range.second ) {

643

cur->ACCESSION_RANGE(row_id);

644  if

( v[0] > key_num ) {

648  if

( v[1] < key_num ) {

658

ret.push_back(prefix);

662  m_Impl

->m_FailedGiRequestCount = 0;

665  m_Impl

->m_FailedGiRequestCount += 1;

723  const string

& db = dbtag.

GetDb

();

736  for

( num_letters = 0; num_letters <

kNumLettersV2

; ++num_letters ) {

737  if

( num_letters >= prefix.size() || !

isalpha

(prefix[num_letters]&0xff) ) {

745  if

( prefix.size() == num_letters ) {

755  for

(

size_t i

= 0;

i

< num_letters; ++

i

) {

760  for

(

size_t i

= num_letters;

i

< prefix.size(); ++

i

) {

776  for

( num_letters = 0; num_letters <

kNumLettersV2

; ++num_letters ) {

777  if

( !

isalpha

(acc[num_letters]&0xff) ) {

785  for

(

size_t i

= num_letters;

i

< prefix_len; ++

i

) {

791  switch

( acc[row_pos] ) {

811  size_t

row_digits = acc.size() - row_pos;

822  for

(

size_t i

= row_pos;

i

< acc.size(); ++

i

) {

824  if

( c < '0' || c >

'9'

) {

828  return

acc.substr(0, prefix_len);

837  string

wgs_acc = ParseWGSAcc(text_id.

GetName

(),

true

);

838  if

( !wgs_acc.empty() ) {

851  return

ParseWGSAcc(acc,

false

);

863  if

(

id

.IsGeneral() ) {

864  return

ParseWGSPrefix(

id

.GetGeneral());

866  else if

(

const CTextseq_id

* text_id =

id

.GetTextseq_Id() ) {

867  return

ParseWGSPrefix(*text_id);

888 #ifdef WGS_RESOLVER_USE_ID2_CLIENT 895

CWGSResolver_ID2::CWGSResolver_ID2(

void

)

901

CWGSResolver_ID2::~CWGSResolver_ID2(

void

)

907

CWGSResolver_ID2::CreateResolver(

void

)

910  if

( !resolver->IsValid() ) {

917 string

CWGSResolver_ID2::ParseWGSPrefix(

const CID2_Reply

& reply)

const 929  if

( !prefix.empty() ) {

937 bool

CWGSResolver_ID2::Update(

void

)

940  bool

ret = !m_Cache.empty();

948

TWGSPrefixes prefixes;

950  string

id_str =

id

.AsFastaString();

951

TCache::const_iterator iter = m_Cache.find(id_str);

952  if

( iter != m_Cache.end() ) {

953  if

( !iter->second.empty() ) {

954

prefixes.push_back(iter->second);

963  "Asking ID2 for ids of "

<<

id

.AsFastaString());

965

m_ID2Client->AskGet_seq_id(req);

972  string

prefix = ParseWGSPrefix(**rit);

973  if

( !prefix.empty() ) {

975  LOG_POST_X

(18,

"CWGSResolver_ID2: WGS prefix: "

<<prefix);

977

prefixes.push_back(prefix);

981  string

& save = m_Cache[id_str];

982  if

( !prefixes.empty() ) {

vector< CRef< TReply > > TReplies

CID2_Reply_Get_Seq_id –.

CID2_Request_Get_Seq_id –.

@ eNotFoundDb

DB main file not found.

virtual TErrCode GetErrCode(void) const

CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...

string FindDereferencedAccPath(const string &acc_or_path) const

CTime GetTimestamp(const string &path) const

string ParseWGSAcc(const string &acc, bool protein) const

string ParseWGSPrefix(const CDbtag &dbtag) const

virtual TWGSPrefixes GetPrefixes(TGi gi)

TWGSPrefixes x_GetAccPrefixes(const string &acc)

const CTime & GetTimestamp(void) const

void Open(const CVDBMgr &mgr, const string &path)

const string & GetWGSIndexPath(void) const

CRef< SGiIdxTableCursor > GiIdx(TIntId gi=0)

static string GetDefaultWGSIndexAcc(EIndexType index_type=eMainIndex)

bool AccIndexIsPrefix() const

CWGSResolver_VDB(const CVDBMgr &mgr, EIndexType index_type=eMainIndex, CWGSResolver_VDB *next_resolver=0)

unique_ptr< SImpl > m_Impl

const CVDBTable & GiIdxTable(void)

static CRef< CWGSResolver > CreateResolver(const CVDBMgr &mgr)

TWGSPrefixes x_GetGiPrefixes(TGi gi)

static string GetDefaultWGSIndexPath(EIndexType index_type=eMainIndex)

virtual TWGSPrefixes GetPrefixes(TGi gi)

const string & GetWGSIndexResolvedPath(void) const

CRef< SAccIdxTableCursor > AccIdx(void)

const CVDBTable & AccIdxTable(void)

void Put(CRef< SGiIdxTableCursor > &curs, TIntId gi=0)

CRef< CWGSResolver_VDB > m_NextResolver

virtual bool Update(void)

static bool s_DebugEnabled(EDebugLevel level)

vector< string > TWGSPrefixes

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)

#define LOG_POST_X(err_subcode, message)

#define ERR_POST_X(err_subcode, message)

Error posting with default error code and given error subcode.

#define MSerial_AsnText

I/O stream manipulators –.

static EAccessionInfo IdentifyAccession(const CTempString &accession, TParseFlags flags=fParse_AnyRaw)

Deduces information from a bare accession a la WHICH_db_accession; may report false negatives on prop...

EAccessionInfo

For IdentifyAccession (below)

#define NCBI_PARAM_TYPE(section, name)

Generate typename for a parameter from its {section, name} attributes.

uint8_t Uint1

1-byte (8-bit) unsigned integer

uint16_t Uint2

2-byte (16-bit) unsigned integer

NCBI_NS_STD::string::size_type SIZE_TYPE

static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)

Check if a string starts with a specified prefix value.

static string & ToUpper(string &str)

Convert string to upper case – string& version.

@ eNocase

Case insensitive compare.

double Elapsed(void) const

Return time elapsed since first Start() or last Restart() call (in seconds).

void Stop(void)

Suspend the timer.

void Start(void)

Start the timer.

const TDb & GetDb(void) const

Get the Db member data.

void SetSeq_id_type(TSeq_id_type value)

Assign a value to Seq_id_type data member.

bool IsGet_seq_id(void) const

Check if variant Get_seq_id is selected.

const TSeq_id & GetSeq_id(void) const

Get the Seq_id member data.

const TReply & GetReply(void) const

Get the Reply member data.

const TGet_seq_id & GetGet_seq_id(void) const

Get the variant data.

bool IsSetSeq_id(void) const

resolved Seq-id not set if error occurred Check if a value has been assigned to Seq_id data member.

list< CRef< CSeq_id > > TSeq_id

void SetSeq_id(TSeq_id &value)

Assign a value to Seq_id data member.

@ eSeq_id_type_general

general Seq-id is preferred

bool IsSetAccession(void) const

Check if a value has been assigned to Accession data member.

const TName & GetName(void) const

Get the Name member data.

TGi & SetGi(void)

Select the variant.

bool IsSetName(void) const

Check if a value has been assigned to Name data member.

const TAccession & GetAccession(void) const

Get the Accession member data.

static bool s_DebugEnabled(EDebugLevel level)

Definition of all error codes used in SRA C++ support libraries.

<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table

Lightweight interface for getting lines of data with minimal memory copying.

const GenericPointer< typename T::ValueType > T2 value

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

#define row(bind, expected)

DECLARE_VDB_COLUMN_AS(acc_range_number_t, ACCESSION_RANGE)

DECLARE_VDB_COLUMN_AS_STRING(WGS_PREFIX)

SAccIdxTableCursor(const CVDBTable &table)

SGiIdxTableCursor(const CVDBTable &table)

DECLARE_VDB_COLUMN_AS_STRING(WGS_PREFIX)

CVDBObjectCache< SGiIdxTableCursor > m_GiIdxCursorCache

void Put(CRef< SGiIdxTableCursor > &curs, TIntId gi=0)

const CVDBTable & GiIdxTable(void)

string m_WGSIndexResolvedPath

CRef< SGiIdxTableCursor > GiIdx(TIntId gi=0)

SImpl(const CVDBMgr &mgr, const string &acc_or_path)

CRef< SAccIdxTableCursor > AccIdx(void)

CVDBTableIndex m_AccIndex

#define INIT_VDB_COLUMN(name)

pair< TVDBRowId, TVDBRowCount > TVDBRowIdRange

#define INIT_OPTIONAL_VDB_COLUMN(name)

#define DEFAULT_WGS_INDEX2_ACC

static const size_t kNumLettersV1

#define DEFAULT_WGS_INDEX3_PATH2

static const size_t kMaxRowDigitsV2

static const size_t kMinRowDigitsV2

#define DEFAULT_WGS_RANGE_INDEX2_PATH1

static const size_t kNumLettersV2

#define DEFAULT_WGS_RANGE_INDEX_PATH2

static const size_t kVersionDigits

static const size_t kTypePrefixLen

#define DEFAULT_WGS_INDEX_PATH2

#define DEFAULT_WGS_RANGE_INDEX_PATH1

#define DEFAULT_WGS_INDEX_ACC

NCBI_DEFINE_ERR_SUBCODE_X(36)

#define DEFAULT_WGS_INDEX2_PATH1

NCBI_PARAM_DECL(bool, WGS, RESOLVER_DIRECT_WGS_INDEX)

static const size_t kMaxRowDigitsV1

static const size_t kPrefixLenV2

#define DEFAULT_WGS_INDEX2_PATH2

NCBI_PARAM_DEF(bool, WGS, RESOLVER_DIRECT_WGS_INDEX, true)

#define DEFAULT_WGS_INDEX_PATH1

#define DEFAULT_WGS_RANGE_INDEX2_PATH2

#define DEFAULT_WGS_INDEX3_PATH1

#define DEFAULT_WGS_RANGE_INDEX_ACC

static const size_t kMinRowDigitsV1

#define DEFAULT_WGS_RANGE_INDEX2_ACC

static bool s_UseWGSRangeIndex(void)

static bool s_SplitAccIndex(string &uacc, Uint2 &key_num)

static string GetDirectWGSIndexPath(CWGSResolver_VDB::EIndexType index_type)

static const size_t kPrefixLenV1

#define DEFAULT_WGS_INDEX3_ACC


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4