vector <string> & mask_name)
47m_MaskNames (mask_name),
49m_OffsetLease (atlas),
51m_IndexFile (m_Atlas),
52m_OffsetFile (m_Atlas)
81 if(page == -1)
return;
95vol =
offset[pagesize + page * 2];
96off =
offset[pagesize + page * 2 + 1];
103 const Int4* datap = (
const Int4*)
108datap = (
const Int4*)
124 stringext_i(
".gmi");
125 stringext_o(
".gmo");
126 stringext_d(
".gmd");
128 const Int2bytetest = 0x0011;
129 const char*ptr = (
const char*) &bytetest;
130 if(ptr[0] == 0x11) {
132ext_i[2] = ext_o[2] = ext_d[2] =
'n';
144 if(! (found_i && found_o)) {
146 "Could not open gi-mask index files.");
162 "Could not open gi-mask data file.");
165 for(
intvol=0; vol<
m_NumVols; ++vol) {
169fnd <<
m_MaskNames[algo_id] <<
"."<< vol/10 << vol%10 << ext_d;
175 "Could not open gi-mask data files.");
195 const char* ptr =
file.GetFileDataPtr(lease, begin, end);
202 const intkFixedFieldBytes = 32;
211 intfmt_version = header.
ReadInt4();
213 if(fmt_version != 1) {
216 "Gi-mask file uses unknown format_version.");
`Blob' Class for SeqDB (and WriteDB).
Int4 ReadInt4()
Read a 4 byte integer at the pointer (and move the pointer).
void ReferTo(CTempString data)
Refer to an existing memory area.
CTempString ReadString(EStringFormat fmt)
Read string data from the blob (moving the read pointer).
void Init(const string &filename)
Initializes a memory map object.
void GetMaskData(int algo_id, TGi gi, CSeqDB::TSequenceRanges &ranges, CSeqDBLockHold &locked)
Get the mask data for GI.
CSeqDBRawFile m_OffsetFile
Offset file.
const vector< string > m_MaskNames
The set of gi masks found in alias description.
Int4 m_AlgoId
The current used mask id.
void x_ReadFields(void)
Open files and read field data from the atlas.
string m_Desc
The description about the masking algo.
Int4 m_NumIndex
Number of Gi indices.
Int4 m_OffsetSize
Offset size.
static void s_GetFileRange(TIndx begin, TIndx end, CSeqDBRawFile &file, CSeqDBFileMemMap &lease, CBlastDbBlob &blob)
Get a range of the index or data file.
CSeqDBAtlas::TIndx TIndx
File offset type.
CSeqDBAtlas & m_Atlas
Reference to the atlas.
vector< CSeqDBRawFile * > m_DataFile
Data file.
Int4 m_PageSize
Page size.
const Uint4 * m_GiIndex
Mapped Gi index.
void x_VerifyAlgorithmId(int algo_id) const
Verify the algorithm exists. If not, raise an exception.
static const CBlastDbBlob::EStringFormat kStringFmt
Sgring format used by gi mask files.
void x_Open(Int4 algo_id)
Open file for a chosen algo_id.
CSeqDBRawFile m_IndexFile
Index file.
string m_Date
The create date of the GI mask.
CSeqDBGiMask(CSeqDBAtlas &atlas, const vector< string > &mask_name)
Constructor.
CSeqDBFileMemMap m_IndexLease
Index file lease.
const string & GetDesc(int algo_id, CSeqDBLockHold &locked)
Get the mask description for algo id.
vector< CSeqDBFileMemMap * > m_DataLease
Data file lease.
Int4 m_NumGi
Number of Gis.
static bool s_BinarySearch(const T *keys, const int n, const T key, int &idx)
Binary search for value associated with a key.
Int4 m_IndexStart
Start offset (in the index file) of the offset array.
CSeqDBFileMemMap m_OffsetLease
Offset file lease.
Int4 m_NumVols
Number of data volumes.
TIndx GetFileLength() const
Get the length of the file.
bool Open(const CSeqDB_Path &name)
MMap or Open a file.
const char * GetFileDataPtr(CSeqDBFileMemMap &lease, TIndx start, TIndx end) const
Get a pointer to a section of the file.
const string & GetPathS() const
Get the path as a string.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
string SeqDB_ResolveDbPath(const string &filename)
Resolve a file path using SeqDB's path algorithms.
This file defines several SeqDB utility functions related to byte order and file system portability.
#define SEQDB_FILE_ASSERT(YESNO)
Defines gi-based mask data files.
List of sequence offset ranges.
void append(const void *src, size_type num_elements)
Append extra elements at the end.
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