NCBI C++ ToolKit
|
Search Toolkit Book for CSubjectMap
Type representing subject map data. More...
#include <algo/blast/dbindex/dbindex.hpp>
Public Types | |
typedef pair< TSeqNum, TSeqPos > | TSOPair |
typedef pair< TSeqNum, TSeqNum > | TSCPair |
typedef vector< TSCPair > | TSCPairMap |
Public Member Functions | |
CSubjectMap () | |
Trivial constructor. More... | |
CSubjectMap (TWord **map, TSeqNum start, TSeqNum stop, unsigned long stride) | |
Constructs object by mapping to the memory segment. More... | |
CSubjectMap (TWord **map, const SIndexHeader &header) | |
void | Load (TWord **map, TSeqNum start, TSeqNum stop, unsigned long stride) |
Loads index by mapping to the memory segment. More... | |
const TWord * | GetSubjectMap () const |
Provides a mapping from real subject ids and chunk numbers to internal logical subject ids. More... | |
const Uint1 * | GetSeqStoreBase () const |
Return the start of the raw storage for compressed subject sequence data. More... | |
TWord | GetSeqStoreSize () const |
Return the size in bytes of the eaw sequence storage. More... | |
TSeqNum | NumChunks () const |
Get the total number of sequence chunks in the map. More... | |
TSeqNum | GetNumChunks (TSeqNum lid) const |
Get number of chunks combined into a given logical sequence. More... | |
TSeqNum | MapSubject (TSeqNum subject, TSeqNum chunk) const |
Get the logical sequence id from the database oid and the chunk number. More... | |
unsigned long | GetStride () const |
Accessor for stride value. More... | |
std::pair< TSeqNum, TSeqPos > | DecodeOffset (TWord offset) const |
Decode offset. More... | |
void | SetSubjInfo (TSeqNum subj, TWord &start, TWord &end) const |
Return the subject information based on the given logical subject id. More... | |
std::pair< TSeqNum, TSeqPos > | MapSubjOff (TSeqNum lid, TSeqPos soff) const |
Map logical sequence id and logical sequence offset to relative chunk number and chunk offset. More... | |
TSeqNum | MapLId2Chunk (TSeqNum lid, TSeqNum lchunk) const |
Map logical id and relative chunk to absolute chunk id. More... | |
TSeqNum | NumSubjects () const |
Get the total number of logical sequences in the map. More... | |
TSeqPos | GetSeqLen (TSeqNum oid) const |
Get the length of the subject sequence. More... | |
const Uint1 * | GetSeqData (TSeqNum oid) const |
Get the sequence data of the subject sequence. More... | |
TWord | getSubjectLength (TSeqNum sid) const |
TSeqNum | getCId (TSeqNum sid, TSeqNum rcid) const |
TSCPair | getSRCId (TSeqNum cid) const |
TWord | getChunkLength (TSeqNum cid) const |
TSeqNum | getCIdByLRCId (TSeqNum lid, TSeqNum rcid) const |
TSOPair | getRCIdOffByLIdOff (TSeqNum lid, TSeqPos loff) const |
TSeqPos | getSOff (TSeqNum sid, TSeqNum rcid, TSeqPos coff) const |
TSeqNum | getNumSubjects () const |
TSeqNum | getNumChunks () const |
TSeqNum | getNumChunks (TSeqNum sid) const |
const Uint1 * | getSeqData (TSeqNum sid) const |
TSeqNum | getLId (const TOffsetValue &v) const |
TSeqPos | getLOff (const TOffsetValue &v) const |
Private Types | |
typedef CDbIndex::TSeqNum | TSeqNum |
typedef CDbIndex::TWord | TWord |
typedef CDbIndex::TOffsetValue | TOffsetValue |
typedef CVectorWrap< TWord > | TSubjects |
Type used to map database oids to the chunk info. More... | |
typedef CVectorWrap< Uint1 > | TSeqStore |
Type used for compressed subject sequence data storage. More... | |
typedef CVectorWrap< TWord > | TChunks |
Type for storing the chunk data. More... | |
typedef CVectorWrap< TWord > | TLengths |
Subject lengths storage type. More... | |
typedef CVectorWrap< TWord > | TLIdMap |
Local id -> chunks map storage type. More... | |
Private Member Functions | |
void | SetSeqDataFromMap (TWord **map) |
Set up the sequence store from the memory segment. More... | |
Private Attributes | |
TSubjects | subjects_ |
Mapping from database oids to the chunk info. More... | |
TSeqStore | seq_store_ |
Storage for the raw subject sequence data. More... | |
TWord | total_ |
Size in bytes of the raw sequence storage. More... | |
TChunks | chunks_ |
Collection of individual chunk descriptors. More... | |
unsigned long | stride_ |
Index stride value. More... | |
unsigned long | min_offset_ |
Minimum offset used by the index. More... | |
TLengths | lengths_ |
Subject lengths storage. More... | |
TLIdMap | lid_map_ |
Local id -> chunk map storage. More... | |
Uint1 | offset_bits_ |
Number of bits used to encode offset. More... | |
TWord | offset_mask_ |
Mask to extract offsets. More... | |
TSCPairMap | c2s_map_ |
CId -> (SId, RCId) map. More... | |
unsigned long | max_chunk_size_ |
unsigned long | chunk_overlap_ |
Type representing subject map data.
Definition at line 1027 of file dbindex.hpp.
|
private |
Type for storing the chunk data.
For raw offset encoding the offset into the vector serves also as the internal logical sequence id.
Definition at line 1045 of file dbindex.hpp.
|
private |
Subject lengths storage type.
Definition at line 1047 of file dbindex.hpp.
|
private |
Local id -> chunks map storage type.
Definition at line 1048 of file dbindex.hpp.
|
private |
Definition at line 1033 of file dbindex.hpp.
typedef pair< TSeqNum, TSeqNum > CSubjectMap::TSCPair |
Definition at line 1261 of file dbindex.hpp.
typedef vector< TSCPair > CSubjectMap::TSCPairMap |
Definition at line 1262 of file dbindex.hpp.
|
private |
Definition at line 1031 of file dbindex.hpp.
|
private |
Type used for compressed subject sequence data storage.
Definition at line 1039 of file dbindex.hpp.
typedef pair< TSeqNum, TSeqPos > CSubjectMap::TSOPair |
Definition at line 1260 of file dbindex.hpp.
|
private |
Type used to map database oids to the chunk info.
Definition at line 1036 of file dbindex.hpp.
|
private |
Definition at line 1032 of file dbindex.hpp.
|
inline |
Trivial constructor.
Definition at line 1053 of file dbindex.hpp.
Constructs object by mapping to the memory segment.
map | [I/O] pointer to the memory segment |
start | [I] database oid of the first sequence in the map |
stop | [I] database oid of the last sequence in the map |
stride | [I] index stride value |
Definition at line 525 of file dbindex.cpp.
References i, lengths_, lid_map_, Load(), offset_bits_, offset_mask_, and CVectorWrap< T >::SetPtr().
CSubjectMap::CSubjectMap | ( | TWord ** | map, |
const SIndexHeader & | header | ||
) |
Definition at line 499 of file dbindex.cpp.
References SIndexHeader::chunk_overlap_, chunk_overlap_, i, lengths_, lid_map_, Load(), SIndexHeader::max_chunk_size_, max_chunk_size_, offset_bits_, offset_mask_, CVectorWrap< T >::SetPtr(), SIndexHeader::start_, SIndexHeader::stop_, and SIndexHeader::stride_.
Decode offset.
offset | The encoded offset value. |
Definition at line 1149 of file dbindex.hpp.
References min_offset_, offset, offset_bits_, offset_mask_, and stride_.
Referenced by CSearch< LEGACY, NHITS >::DecodeOffset().
Definition at line 1270 of file dbindex.hpp.
References ASSERT, chunk_overlap_, chunks_, getSRCId(), getSubjectLength(), max_chunk_size_, CVectorWrap< T >::size(), subjects_, and t.
Referenced by CDbIndex::getChunkLength().
Definition at line 1252 of file dbindex.hpp.
References ASSERT, chunks_, result, CVectorWrap< T >::size(), and subjects_.
Referenced by CDbIndex::getCId().
Definition at line 1290 of file dbindex.hpp.
References ASSERT, lid_map_, and CVectorWrap< T >::size().
Referenced by CDbIndex::getCIdByLRCId().
|
inline |
Definition at line 1356 of file dbindex.hpp.
References CDbIndex::SOffsetValue::offset, and offset_bits_.
Referenced by CDbIndex::getLId().
|
inline |
Definition at line 1359 of file dbindex.hpp.
References CDbIndex::SOffsetValue::offset, offset_mask_, and stride_.
Referenced by CDbIndex::getLOff().
|
inline |
Definition at line 1337 of file dbindex.hpp.
References chunks_, and CVectorWrap< T >::size().
Referenced by CDbIndex::getNumChunks().
Get number of chunks combined into a given logical sequence.
lid | The logical sequence id. |
Definition at line 1110 of file dbindex.hpp.
References lid_map_.
Referenced by CSearch_Base< LEGACY, NHITS, derived_t >::operator()(), and CTrackedSeeds_Base< TWO_HIT >::SetLId().
Definition at line 1339 of file dbindex.hpp.
References ASSERT, chunks_, CVectorWrap< T >::size(), and subjects_.
|
inline |
Definition at line 1336 of file dbindex.hpp.
References CVectorWrap< T >::size(), and subjects_.
Referenced by CDbIndex::getNumSubjects().
Definition at line 1299 of file dbindex.hpp.
References ASSERT, CVectorWrap< T >::begin(), chunks_, CDbIndex::CR, CR, lid_map_, seq_store_, and CVectorWrap< T >::size().
Referenced by CDbIndex::getRCIdOffByLIdOff().
Get the sequence data of the subject sequence.
oid | Ordinal id of the subject sequence. |
Definition at line 1239 of file dbindex.hpp.
References chunks_, seq_store_, and subjects_.
Referenced by CDbIndex_Impl< LEGACY >::GetSeqData().
Definition at line 1348 of file dbindex.hpp.
References ASSERT, chunks_, seq_store_, CVectorWrap< T >::size(), and subjects_.
Referenced by CDbIndex::getSeqData().
Get the length of the subject sequence.
oid | Ordinal id of the subject sequence. |
Definition at line 1230 of file dbindex.hpp.
References lengths_.
Referenced by CDbIndex_Impl< LEGACY >::GetSeqLen().
Return the start of the raw storage for compressed subject sequence data.
Definition at line 1091 of file dbindex.hpp.
References seq_store_.
Referenced by CDbIndex_Impl< LEGACY >::GetSeqStoreBase().
|
inline |
Return the size in bytes of the eaw sequence storage.
Definition at line 1097 of file dbindex.hpp.
References total_.
Definition at line 1326 of file dbindex.hpp.
References ASSERT, chunk_overlap_, chunks_, lengths_, max_chunk_size_, CVectorWrap< T >::size(), and subjects_.
Referenced by CDbIndex::getSOff().
Definition at line 1264 of file dbindex.hpp.
References ASSERT, c2s_map_, chunks_, and CVectorWrap< T >::size().
Referenced by getChunkLength(), and CDbIndex::getSRCId().
|
inline |
Accessor for stride value.
Definition at line 1140 of file dbindex.hpp.
References stride_.
Definition at line 1246 of file dbindex.hpp.
References ASSERT, lengths_, CVectorWrap< T >::size(), and subjects_.
Referenced by getChunkLength(), and CDbIndex::getSubjectLength().
Provides a mapping from real subject ids and chunk numbers to internal logical subject ids.
Definition at line 1085 of file dbindex.hpp.
References subjects_.
Referenced by CSearch_Base< LEGACY, NHITS, derived_t >::operator()().
Loads index by mapping to the memory segment.
map | [I/O] pointer to the memory segment |
start | [I] database oid of the first sequence in the map |
stop | [I] database oid of the last sequence in the map |
stride | [I] index stride value |
Definition at line 450 of file dbindex.cpp.
References c2s_map_, chunks_, GetMinOffset(), i, min_offset_, CVectorWrap< T >::SetPtr(), SetSeqDataFromMap(), CVectorWrap< T >::size(), stride_, subjects_, and total_.
Referenced by CSubjectMap().
Map logical id and relative chunk to absolute chunk id.
lid | logical sequence id |
lchunk | chunk number within the logical sequence |
Definition at line 1211 of file dbindex.hpp.
References lid_map_.
Get the logical sequence id from the database oid and the chunk number.
subject | [I] database oid |
chunk | [I] the chunk number |
Definition at line 1122 of file dbindex.hpp.
References chunks_, result, CVectorWrap< T >::size(), subject, and subjects_.
Map logical sequence id and logical sequence offset to relative chunk number and chunk offset.
lid | The logical sequence id. |
soff | The logical sequence offset. |
Definition at line 1180 of file dbindex.hpp.
References ASSERT, CVectorWrap< T >::begin(), chunks_, CDbIndex::CR, CR, and lid_map_.
|
inline |
Get the total number of sequence chunks in the map.
Definition at line 1102 of file dbindex.hpp.
References chunks_, and CVectorWrap< T >::size().
Referenced by CDbIndex_Impl< LEGACY >::NumChunks().
|
inline |
Get the total number of logical sequences in the map.
Definition at line 1221 of file dbindex.hpp.
References lid_map_, and CVectorWrap< T >::size().
Referenced by CDbIndex_Impl< LEGACY >::NumSubjects().
|
private |
Set up the sequence store from the memory segment.
map | [I/O] points to the memory segment |
Definition at line 489 of file dbindex.cpp.
References seq_store_, CVectorWrap< T >::SetPtr(), and total_.
Referenced by Load().
Return the subject information based on the given logical subject id.
subj | [I] logical subject id |
start | [0] starting offset of subj in the sequence store |
end | [0] 1 + ending offset of subj in the sequence store |
Definition at line 1164 of file dbindex.hpp.
References lid_map_.
Referenced by CSearch< LEGACY, NHITS >::SetSubjInfo().
|
private |
CId -> (SId, RCId) map.
Definition at line 1383 of file dbindex.hpp.
Referenced by getSRCId(), and Load().
|
private |
Definition at line 1386 of file dbindex.hpp.
Referenced by CSubjectMap(), getChunkLength(), and getSOff().
|
private |
Collection of individual chunk descriptors.
Definition at line 1374 of file dbindex.hpp.
Referenced by getChunkLength(), getCId(), getNumChunks(), getRCIdOffByLIdOff(), GetSeqData(), getSeqData(), getSOff(), getSRCId(), Load(), MapSubject(), MapSubjOff(), and NumChunks().
|
private |
Subject lengths storage.
Definition at line 1379 of file dbindex.hpp.
Referenced by CSubjectMap(), GetSeqLen(), getSOff(), and getSubjectLength().
|
private |
Local id -> chunk map storage.
Definition at line 1380 of file dbindex.hpp.
Referenced by CSubjectMap(), getCIdByLRCId(), GetNumChunks(), getRCIdOffByLIdOff(), MapLId2Chunk(), MapSubjOff(), NumSubjects(), and SetSubjInfo().
|
private |
Definition at line 1385 of file dbindex.hpp.
Referenced by CSubjectMap(), getChunkLength(), and getSOff().
|
private |
Minimum offset used by the index.
Definition at line 1377 of file dbindex.hpp.
Referenced by DecodeOffset(), and Load().
|
private |
Number of bits used to encode offset.
Definition at line 1381 of file dbindex.hpp.
Referenced by CSubjectMap(), DecodeOffset(), and getLId().
|
private |
Mask to extract offsets.
Definition at line 1382 of file dbindex.hpp.
Referenced by CSubjectMap(), DecodeOffset(), and getLOff().
|
private |
Storage for the raw subject sequence data.
Definition at line 1370 of file dbindex.hpp.
Referenced by getRCIdOffByLIdOff(), GetSeqData(), getSeqData(), GetSeqStoreBase(), and SetSeqDataFromMap().
|
private |
Index stride value.
Definition at line 1376 of file dbindex.hpp.
Referenced by DecodeOffset(), getLOff(), GetStride(), and Load().
|
private |
Mapping from database oids to the chunk info.
Definition at line 1369 of file dbindex.hpp.
Referenced by getChunkLength(), getCId(), getNumChunks(), getNumSubjects(), GetSeqData(), getSeqData(), getSOff(), getSubjectLength(), GetSubjectMap(), Load(), and MapSubject().
|
private |
Size in bytes of the raw sequence storage.
(only valid after the complete object has been constructed)
Definition at line 1371 of file dbindex.hpp.
Referenced by GetSeqStoreSize(), Load(), and SetSeqDataFromMap().