1 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBGIMASK_HPP
2 #define OBJTOOLS_READERS_SEQDB__SEQDBGIMASK_HPP
50 #if ((!defined(NCBI_COMPILER_WORKSHOP) || (NCBI_COMPILER_VERSION > 550)) && \
51 (!defined(NCBI_COMPILER_MIPSPRO)) )
66 const vector <string> & mask_name);
115 oss <<
"Filtering algorithm " << algo_name
116 <<
" does not exist." << endl;
134 <<
"Available filtering algorithm(s):"
136 retval << setw(14) << left <<
"Algorithm ID"
137 << setw(40) << left <<
"Algorithm name" << endl;
138 for (
unsigned int id=0;
id <
m_MaskNames.size(); ++id) {
139 retval <<
" " << setw(10) << left <<
id
170 if (algo_id < 0 || algo_id >= (
int)
m_MaskNames.size()) {
172 oss <<
"Filtering algorithm ID " << algo_id
173 <<
" does not exist." << endl;
209 int lower(0), upper(
n - 1);
211 if (
key > keys[upper] ||
key < keys[lower]) {
217 if (
key == keys[upper]) {
222 if (
key == keys[lower]) {
227 idx = (lower + upper) / 2;
229 while (idx != lower) {
230 if (
key > keys[idx]) {
232 idx = (lower + upper) / 2;
234 else if (
key < keys[idx]) {
236 idx = (lower + upper) / 2;
`Blob' Class for SeqDB (and WriteDB).
EStringFormat
String termination style.
@ eSizeVar
Write string length as VarInt, then string data.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
CNcbiStreamoff TIndx
The type used for file offsets.
void Clear()
Clears the memory mapobject.
void GetMaskData(int algo_id, TGi gi, CSeqDB::TSequenceRanges &ranges, CSeqDBLockHold &locked)
Get the mask data for GI.
CSeqDBGiMask & operator=(CSeqDBGiMask &)
Prevent copy assignment.
CSeqDBRawFile m_OffsetFile
Offset file.
int GetAlgorithmId(const string &algo_name) const
Get the mask algorithsm id for a string id.
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.
const string & GetAlgorithmName(int algo_id) const
Get the mask algorithsm name for a numeric id.
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.
~CSeqDBGiMask()
Destructor.
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.
string GetAvailableAlgorithmNames() const
Get the names of available mask algorithms as string.
Int4 m_NumGi
Number of Gis.
void GetAvailableMaskAlgorithms(vector< int > &algo) const
Get the available mask algorithsm ids.
CSeqDBGiMask(const CSeqDBGiMask &)
Prevent copy construction.
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.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
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.
const struct ncbi::grid::netcache::search::fields::KEY key
Defines BLAST database access classes.
The SeqDB memory management layer.
CSeqDBAtlas::TIndx TIndx
Index file.
File access objects for CSeqDB.
USING_SCOPE(objects)
Import definitions from the objects namespace.
List of sequence offset ranges.