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/dbindex_8cpp_source.html below:

NCBI C++ ToolKit: src/algo/blast/dbindex/dbindex.cpp Source File

66  template

<

typename

t_

int

>

70  char buf

[

sizeof

( t_int )];

73  template

<

typename

t_

int

>

74  void

ReadInt( std::istream & is, t_int & v )

76

UIntHolder< t_int > h;

77

is.read( h.buf,

sizeof

( t_int ) );

81  template

<

typename

t_

int

>

82  void

WriteInt( std::ostream & os,

const

t_int & v )

84

UIntHolder< t_int > h;

86

os.write( h.buf,

sizeof

( t_int ) );

91  if

( is.eof() || is.bad() ) {

108

std::ostringstream os;

109

os << idxname <<

"."

<< setw(2) << setfill(

'0'

)

110

<< volume <<

".idx"

;

117  union

{

Uint4 a

;

unsigned char b

[4]; } x;

118

x.a = (

Uint4

)0x01020304ULL;

123 #define M_CHECK_STREAM(_s,_f,_m) { \ 124  std::ostringstream _os; \ 125  _os << '[' << _f << "] "

<< _m; \

126

CheckStream( _s, _os.str() ); \

137

std::ostringstream os;

138

os <<

"file "

<< fname <<

" does not exist"

;

143

std::ostringstream os;

144

os <<

"read access denied for "

<< fname;

148  size_t

file_size( (

size_t

)fl.

GetLength

() );

149

std::ifstream is( fname.c_str() );

152

ReadInt( is, endianness );

154

endianness = (endianness == 0) ?

169

file_size, endianness,

version

, fname, is ) );

173

std::ostringstream os;

185

: actual_size_(

size

), endianness_( endianness ), version_(

version

)

191

: endianness_( GetSystemEndianness() ), version_(

version

)

212  if

(

size

!= EXPECTED_SIZE ) {

213

std::ostringstream os;

214

os <<

": expected "

<< EXPECTED_SIZE <<

"; got "

<<

size

;

219

ReadInt( is, num_seq_ );

221

ReadInt( is, num_vol_ );

236

num_seq_( n_seq ), num_vol_( n_vol )

245

std::ofstream os( fname.c_str() );

248

WriteInt( os, num_seq_ );

250

WriteInt( os, num_vol_ );

257

std::ifstream is( fname.c_str() );

259  for

(

int i

( 0 );

i

< 7; ++

i

) { ReadInt( is,

t

); }

261

ReadInt( is, start );

265  if

( is.bad() ) start = end = 0;

269 #undef M_CHECK_STREAM 273  void

CheckIndexEndianness(

void

*

map

)

275  static const TWord

MAX_KEY_SIZE = 15;

277  if

( key_size <= MAX_KEY_SIZE )

return

;

280  TWord

rev_key_size( 0 );

281

rev_key_size += ((key_size&0xFF)<<24);

282

rev_key_size += (((key_size>>8)&0xFF)<<16);

283

rev_key_size += (((key_size>>16)&0xFF)<<8);

284

rev_key_size += (key_size>>24);

286  if

( rev_key_size <= MAX_KEY_SIZE ) {

289  "possible index endianness mismatch: check " 290  "if the index was created for the " 291  "architecture with different endianness"

);

295  "index header validation failed"

);

304

CheckIndexEndianness(

map

);

308  result

.hkey_width_ = (

unsigned

long)(*ptr++);

310  tmp

= (

unsigned

long)(*ptr++);

311  tmp

= (

unsigned

long)(*ptr++);

331

CheckIndexEndianness(

map

);

334  result

.hkey_width_ = (

unsigned

long)(*ptr++);

335  result

.stride_ = (

unsigned

long)(*ptr++);

336  result

.ws_hint_ = (

unsigned

long)(*ptr++);

373  case eBadOption

:

return "bad index creation option"

;

376  case eBadData

:

return "corrupt index data"

;

377  case eIO

:

return "I/O error"

;

411  return

(

unsigned long

)

version

;

419  if

( !index_stream ) {

424

index_stream.close();

427  case VERSION

:

return

LoadIndex< true >( fname, nomap );

428  case VERSION

+ 1:

return

LoadIndex< false >( fname, nomap );

433  "wrong index version"

);

441  do

{ stride >>= 1; ++

result

; }

while

( stride != 0 );

464  for

(

unsigned long i

= 0;

i

< n_subjects; ++

i

) {

465

cerr <<

i

<<

" ---> "

<<

subjects_

[

i

] - 1 << endl;

480  c2s_map_

.push_back( make_pair(

i

- 1, chunk ) );

501  TWord

nlengths = *(*map)++;

502

nlengths /=

sizeof

(

TWord

);

509  for

(

unsigned long i

= 0;

i

< nlengths; ++

i

) {

510

cerr <<

"length( "

<<

i

<<

") = "

<<

lengths_

[

i

] << endl;

514  TWord

nlidmap = *(*map)++;

515

nlidmap /=

sizeof

(

TWord

);

528  TWord

nlengths = *(*map)++;

529

nlengths /=

sizeof

(

TWord

);

536  for

(

unsigned long i

= 0;

i

< nlengths; ++

i

) {

537

cerr <<

"length( "

<<

i

<<

") = "

<<

lengths_

[

i

] << endl;

541  TWord

nlidmap = *(*map)++;

542

nlidmap /=

sizeof

(

TWord

);

546  Load

(

map

, start, stop, stride );

551  TWord

**

map

,

unsigned long

hkey_width,

552  unsigned long

stride,

unsigned long

ws_hint )

553

: total_( 0 ), hkey_width_( hkey_width ), stride_( stride ),

554

ws_hint_( ws_hint ), min_offset_(

GetMinOffset

( stride ) )

562

*

map

+= hash_table_size + 1;

Structures and functions prototypes used for BLAST gapped extension.

#define MAX_DBSEQ_LEN

Split subject sequences if longer than this.

Structures and API used for saving BLAST hits.

#define DBSEQ_CHUNK_OVERLAP

By how much should the chunks of a subject sequence overlap if it is too long and has to be split.

Types of exception the indexing library can throw.

@ eBadOption

Bad index creation/search option.

@ eBadVersion

Wrong index version.

@ eBadData

Bad index data.

@ eBadSequence

Bad input sequence data.

virtual const char * GetErrCodeString() const override

Get a human readable description of the exception type.

static SOptions DefaultSOptions()

Creates an SOptions instance initialized with default values.

static const unsigned long STRIDE

Only process every STRIDEth nmer.

static const unsigned char VERSION

Index version that this library handles.

static CRef< CDbIndex > Load(const std::string &fname, bool nomap=false)

Load index.

THashTable hash_table_

The hash table (mapping from Nmer values to the lists of offsets.

COffsetData_Base(TWord **map, unsigned long hkey_width, unsigned long stride, unsigned long ws_hint)

Object constructor.

TWord total_

Auxiliary data member used for importing the offset list data.

CDbIndex::TWord TWord

Index word type (public to support Solaris).

unsigned long hkey_width_

Hash key width in bp.

TLengths lengths_

Subject lengths storage.

TWord offset_mask_

Mask to extract offsets.

unsigned long stride_

Index stride value.

unsigned long max_chunk_size_

void Load(TWord **map, TSeqNum start, TSeqNum stop, unsigned long stride)

Loads index by mapping to the memory segment.

unsigned long min_offset_

Minimum offset used by the index.

Uint1 offset_bits_

Number of bits used to encode offset.

TWord total_

Size in bytes of the raw sequence storage.

TLIdMap lid_map_

Local id -> chunk map storage.

TSubjects subjects_

Mapping from database oids to the chunk info.

TChunks chunks_

Collection of individual chunk descriptors.

TSeqStore seq_store_

Storage for the raw subject sequence data.

unsigned long chunk_overlap_

void SetSeqDataFromMap(TWord **map)

Set up the sequence store from the memory segment.

CSubjectMap()

Trivial constructor.

TSCPairMap c2s_map_

CId -> (SId, RCId) map.

CDbIndex::TSeqNum TSeqNum

TVector::size_type size_type

void SetPtr(T *base, size_type sz)

Make the object hold an external sequence.

size_type size() const

Get the sequence size.

unsigned long GetIndexStride< true >(const SIndexHeader &header)

CRef< CIndexSuperHeader_Base > GetIndexSuperHeader(const std::string &fname)

Read superheader structure from the file.

#define M_CHECK_STREAM(_s, _f, _m)

unsigned long GetIndexStride< false >(const SIndexHeader &header)

const SIndexHeader ReadIndexHeader< false >(void *map)

unsigned long GetMinOffset(unsigned long stride)

Compute the minimum offset value needed encode offsets based on stride.

const SIndexHeader ReadIndexHeader< true >(void *map)

unsigned long GetIndexWSHint< false >(const SIndexHeader &header)

unsigned long GetCodeBits(unsigned long stride)

Compute the number of bits to encode special offsets based on stride.

unsigned long GetIndexWSHint< true >(const SIndexHeader &header)

unsigned long GetIndexVersion(CNcbiIstream &is)

Get the index format version for the index data represented by the input stream.

size_t GetIdxVolNumOIDs(const std::string &fname)

Read the index header information from the given file.

const unsigned long REPORT_NORMAL

Normal reporting.

void ReadWord(CNcbiIstream &is, word_t &data)

Read a word from the input stream.

CDbIndex::TSeqNum TSeqNum

Forwarding declarations for convenience.

TErrCode GetErrCode(void) const

Get error code.

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

virtual const char * GetErrCodeString(void) const

Get error code interpreted as text.

Int8 GetLength(void) const

Get size of file.

bool CheckAccess(TMode access_mode) const

Check access rights.

virtual bool Exists(void) const

Check existence of file.

uint8_t Uint1

1-byte (8-bit) unsigned integer

uint32_t Uint4

4-byte (32-bit) unsigned integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

#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.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

const string version

version string

const struct ncbi::grid::netcache::search::fields::SIZE size

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

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

Simple record type used to specify index creation parameters.


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