NCBI C++ ToolKit
Public Member Functions | List of all members
CSeqDBExpert Class Reference

Search Toolkit Book for CSeqDBExpert

CSeqDBExpert. More...

#include <objtools/blast/seqdb_reader/seqdbexpert.hpp>

+ Inheritance diagram for CSeqDBExpert:
+ Collaboration diagram for CSeqDBExpert:

Public Member Functions

 CSeqDBExpert (const string &dbname, ESeqType seqtype, CSeqDBGiList *gilist=0)
 Short Constructor. More...
 
 CSeqDBExpert (const string &dbname, ESeqType seqtype, int oid_begin, int oid_end, bool use_mmap, CSeqDBGiList *gi_list=0)
 Constructor with MMap Flag and OID Range. More...
 
 CSeqDBExpert ()
 Null Constructor. More...
 
 ~CSeqDBExpert ()
 Destructor. More...
 
void GetRawSeqAndAmbig (int oid, const char **buffer, int *seq_length, int *ambig_length) const
 Raw Sequence and Ambiguity Data. More...
 
void GetGiBounds (TGi *low_id, TGi *high_id, int *count)
 Get GI Bounds. More...
 
void GetPigBounds (int *low_id, int *high_id, int *count)
 Get PIG Bounds. More...
 
void GetStringBounds (string *low_id, string *high_id, int *count)
 Get String Bounds. More...
 
unsigned GetSequenceHash (int oid)
 Get the sequence hash for a given OID. More...
 
void HashToOids (unsigned hash, vector< int > &oids)
 Get the OIDs for a given sequence hash. More...
 
void Verify ()
 Verify internal SeqDB data structures for consistency. More...
 
- Public Member Functions inherited from CSeqDB
 CSeqDB (const string &dbname, ESeqType seqtype, CSeqDBGiList *gilist=0, bool use_atlas_lock=true)
 Short Constructor. More...
 
 CSeqDB (const string &dbname, ESeqType seqtype, CSeqDBNegativeList *nlist)
 Short Constructor with Negative ID list. More...
 
 CSeqDB (const string &dbname, ESeqType seqtype, CSeqDBGiList *gilist, CSeqDBNegativeList *nlist)
 Short Constructor with Positive and Negative ID list. More...
 
 CSeqDB (const string &dbname, ESeqType seqtype, int oid_begin, int oid_end, CSeqDBGiList *gilist, CSeqDBNegativeList *nlist)
 Short Constructor with Positive and Negative ID list with oid range. More...
 
 CSeqDB (const string &dbname, ESeqType seqtype, CSeqDBIdSet ids)
 Short Constructor with Computed ID list. More...
 
 CSeqDB (const vector< string > &dbs, ESeqType seqtype, CSeqDBGiList *gilist=0)
 Short Constructor. More...
 
 CSeqDB (const string &dbname, ESeqType seqtype, int oid_begin, int oid_end, bool use_mmap, CSeqDBGiList *gi_list=0)
 Constructor with MMap Flag and OID Range. More...
 
 CSeqDB (const vector< string > &dbname, ESeqType seqtype, int oid_begin, int oid_end, bool use_mmap, CSeqDBGiList *gi_list=0)
 Constructor with MMap Flag and OID Range. More...
 
 ~CSeqDB ()
 Destructor. More...
 
int GetSeqLength (int oid) const
 Returns the sequence length in base pairs or residues. More...
 
TGi GetSeqGI (int oid) const
 Returns the first Gi (if any) of the sequence. More...
 
int GetSeqLengthApprox (int oid) const
 Returns an unbiased, approximate sequence length. More...
 
CRef< CBlast_def_line_setGetHdr (int oid) const
 Get the ASN.1 header for the sequence. More...
 
void GetLeafTaxIDs (int oid, map< TGi, set< TTaxId > > &gi_to_taxid_set, bool persist=false) const
 Get taxid for an OID. More...
 
void GetLeafTaxIDs (int oid, vector< TTaxId > &taxids, bool persist=false) const
 Get taxids for an OID. More...
 
void GetTaxIDs (int oid, map< TGi, TTaxId > &gi_to_taxid, bool persist=false) const
 Get taxid for an OID. More...
 
void GetTaxIDs (int oid, vector< TTaxId > &taxids, bool persist=false) const
 Get taxids for an OID. More...
 
void GetAllTaxIDs (int oid, set< TTaxId > &taxids) const
 Get all tax ids for an oid. More...
 
CRef< CBioseqGetBioseq (int oid, TGi target_gi=ZERO_GI, const CSeq_id *target_seq_id=NULL) const
 Get a CBioseq for a sequence. More...
 
CRef< CBioseqGetBioseqNoData (int oid, TGi target_gi=ZERO_GI, const CSeq_id *target_seq_id=NULL) const
 Get a CBioseq for a sequence without sequence data. More...
 
int GetSequence (int oid, const char **buffer) const
 Get a pointer to raw sequence data. More...
 
int GetAmbigSeq (int oid, const char **buffer, int nucl_code) const
 Get a pointer to sequence data with ambiguities. More...
 
int GetAmbigSeq (int oid, const char **buffer, int nucl_code, int begin_offset, int end_offset) const
 Get a pointer to a range of sequence data with ambiguities. More...
 
int GetAmbigSeqAlloc (int oid, char **buffer, int nucl_code, ESeqDBAllocType strategy, TSequenceRanges *masks=NULL) const
 Get a pointer to sequence data with ambiguities. More...
 
int GetAmbigPartialSeq (int oid, char **buffer, int nucl_code, ESeqDBAllocType strategy, TSequenceRanges *partial_ranges, TSequenceRanges *masks=NULL) const
 
void RetSequence (const char **buffer) const
 Returns any resources associated with the sequence. More...
 
void RetAmbigSeq (const char **buffer) const
 Returns any resources associated with the sequence. More...
 
list< CRef< CSeq_id > > GetSeqIDs (int oid) const
 Gets a list of sequence identifiers. More...
 
void GetGis (int oid, vector< TGi > &gis, bool append=false) const
 Gets a list of GIs for an OID. More...
 
ESeqType GetSequenceType () const
 Returns the type of database opened - protein or nucleotide. More...
 
string GetTitle () const
 Returns the database title. More...
 
string GetDate () const
 Returns the construction date of the database. More...
 
int GetNumSeqs () const
 Returns the number of sequences available. More...
 
int GetNumSeqsStats () const
 Returns the number of sequences available. More...
 
int GetNumOIDs () const
 Returns the size of the (possibly sparse) OID range. More...
 
Uint8 GetTotalLength () const
 Returns the sum of the lengths of all available sequences. More...
 
Uint8 GetExactTotalLength ()
 Returns the exact sum of the lengths of all available sequences. More...
 
Uint8 GetTotalLengthStats () const
 Returns the sum of the lengths of all available sequences. More...
 
Uint8 GetVolumeLength () const
 Returns the sum of the lengths of all volumes. More...
 
void GetTotals (ESummaryType sumtype, int *oid_count, Uint8 *total_length, bool use_approx=true) const
 Returns the sum of the sequence lengths. More...
 
int GetMaxLength () const
 Returns the length of the largest sequence in the database. More...
 
int GetMinLength () const
 Returns the length of the shortest sequence in the database. More...
 
CSeqDBIter Begin () const
 Returns a sequence iterator. More...
 
bool CheckOrFindOID (int &next_oid) const
 Find an included OID, incrementing next_oid if necessary. More...
 
EOidListType GetNextOIDChunk (int &begin_chunk, int &end_chunk, int oid_size, vector< int > &oid_list, int *oid_state=NULL)
 Return a chunk of OIDs, and update the OID bookmark. More...
 
void ResetInternalChunkBookmark ()
 Resets this object's internal chunk bookmark, which is used when the oid_state argument to GetNextOIDChunk is NULL. More...
 
const stringGetDBNameList () const
 Get list of database names. More...
 
const CSeqDBGiListGetGiList () const
 Get GI list attached to this database. More...
 
CSeqDBIdSet GetIdSet () const
 Get IdSet list attached to this database. More...
 
bool PigToOid (int pig, int &oid) const
 Translate a PIG to an OID. More...
 
bool OidToPig (int oid, int &pig) const
 Translate an OID to a PIG. More...
 
bool TiToOid (Int8 ti, int &oid) const
 Translate a TI to an OID. More...
 
bool OidToGi (int oid, TGi &gi) const
 Translate an OID to a GI. More...
 
bool GiToOid (TGi gi, int &oid) const
 Translate a GI to an OID. More...
 
bool GiToOidwFilterCheck (TGi gi, int &oid) const
 Translate a GI To an OID with filter check. More...
 
bool GiToPig (TGi gi, int &pig) const
 Translate a GI to a PIG. More...
 
bool PigToGi (int pig, TGi &gi) const
 Translate a PIG to a GI. More...
 
void AccessionToOids (const string &acc, vector< int > &oids) const
 Translate an Accession to a list of OIDs. More...
 
void AccessionsToOids (const vector< string > &accs, vector< blastdb::TOid > &oids) const
 
void SeqidToOids (const CSeq_id &seqid, vector< int > &oids) const
 Translate a Seq-id to a list of OIDs. More...
 
bool SeqidToOid (const CSeq_id &seqid, int &oid) const
 Translate a Seq-id to any matching OID. More...
 
int GetOidAtOffset (int first_seq, Uint8 residue) const
 Find the sequence closest to the given offset into the database. More...
 
CRef< CBioseqGiToBioseq (TGi gi) const
 Get a CBioseq for a given GI. More...
 
CRef< CBioseqPigToBioseq (int pig) const
 Get a CBioseq for a given PIG. More...
 
CRef< CBioseqSeqidToBioseq (const CSeq_id &seqid) const
 Get a CBioseq for a given Seq-id. More...
 
void FindVolumePaths (vector< string > &paths, bool recursive=true) const
 Find volume paths. More...
 
void SetIterationRange (int oid_begin, int oid_end)
 Set Iteration Range. More...
 
void GetAliasFileValues (TAliasFileValues &afv)
 Get Name/Value Data From Alias Files. More...
 
CRef< CSeq_dataGetSeqData (int oid, TSeqPos begin, TSeqPos end) const
 Fetch data as a CSeq_data object. More...
 
void GetSequenceAsString (int oid, CSeqUtil::ECoding coding, string &output, TSeqRange range=TSeqRange()) const
 Get a sequence in a given encoding. More...
 
void GetSequenceAsString (int oid, string &output, TSeqRange range=TSeqRange()) const
 Get a sequence in a readable text encoding. More...
 
void ListColumns (vector< string > &titles)
 List columns titles found in this database. More...
 
int GetColumnId (const string &title)
 Get an ID number for a given column title. More...
 
const map< string, string > & GetColumnMetaData (int column_id)
 Get all metadata for the specified column. More...
 
const stringGetColumnValue (int column_id, const string &key)
 Look up the value for a specific column metadata key. More...
 
const map< string, string > & GetColumnMetaData (int column_id, const string &volname)
 Get all metadata for the specified column. More...
 
void GetColumnBlob (int col_id, int oid, CBlastDbBlob &blob)
 Fetch the data blob for the given column and oid. More...
 
void GetAvailableMaskAlgorithms (vector< int > &algorithms)
 Get a list of algorithm IDs for which mask data exists. More...
 
int GetMaskAlgorithmId (const string &algo_name) const
 Get the numeric algorithm ID for a string. More...
 
string GetAvailableMaskAlgorithmDescriptions ()
 Returns a formatted string with the list of available masking algorithms in this database for display purposes (i.e. More...
 
vector< intValidateMaskAlgorithms (const vector< int > &algorithm_ids)
 Validates the algorithm IDs passed to this function, returning a vector of those algorithm IDs not present in this object. More...
 
void GetMaskAlgorithmDetails (int algorithm_id, objects::EBlast_filter_program &program, string &program_name, string &algo_opts)
 Get information about one type of masking available here. More...
 
void GetMaskAlgorithmDetails (int algorithm_id, string &program, string &program_name, string &algo_opts)
 
void GetMaskData (int oid, const vector< int > &algo_ids, TSequenceRanges &ranges)
 Get masked ranges of a sequence. More...
 
void GetMaskData (int oid, int algo_id, TSequenceRanges &ranges)
 Get masked ranges of a sequence. More...
 
void SetOffsetRanges (int oid, const TRangeList &offset_ranges, bool append_ranges, bool cache_data)
 Apply a range of offsets to a database sequence. More...
 
void RemoveOffsetRanges (int oid)
 Remove any offset ranges for the given OID. More...
 
void FlushOffsetRangeCache ()
 Flush all offset ranges cached. More...
 
void SetNumberOfThreads (int num_threads, bool force_mt=false)
 Setting the number of threads. More...
 
Int8 GetDiskUsage () const
 Retrieve the disk usage in bytes for this BLAST database. More...
 
void SetVolsMemBit (int mbit)
 Set the membership of all volumes. More...
 
void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Dump debug information for this object. More...
 
EBlastDbVersion GetBlastDbVersion () const
 Return blast db version. More...
 
void TaxIdsToOids (set< TTaxId > &tax_ids, vector< blastdb::TOid > &rv) const
 Get Oid list for input tax ids. More...
 
void GetDBTaxIds (set< TTaxId > &tax_ids) const
 Get all unique tax ids from db. More...
 
void GetTaxIdsForOids (const vector< blastdb::TOid > &oids, set< TTaxId > &tax_ids) const
 
CRef< CBlast_db_metadataGetDBMetaData (string user_path=kEmptyStr)
 
void GetTaxIdsForAccession (const string &accs, vector< TTaxId > &taxids)
 Get all tax ids for an accessions. More...
 
void GetTaxIdsForSeqId (const CSeq_id &seq_id, vector< TTaxId > &taxids)
 Get all tax ids for a seq id. More...
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Additional Inherited Members

- Public Types inherited from CSeqDB
enum  EOidListType { eOidList , eOidRange }
 Indicates how block of OIDs was returned. More...
 
enum  ESeqType { eProtein , eNucleotide , eUnknown }
 Sequence types (eUnknown tries protein, then nucleotide). More...
 
enum  ESummaryType { eUnfilteredAll , eFilteredAll , eFilteredRange }
 Types of summary information available. More...
 
enum  EMmapFileTypes { eMmap_IndexFile , eMmap_SequenceFile }
 File type for which mmap strategy may be set. More...
 
enum  EMmapStrategies { eMmap_Normal , eMmap_Sequential , eMmap_WillNeed }
 Permitted mmap strategies. More...
 
typedef TSeqDBAliasFileValues TAliasFileValues
 Import type to allow shorter name. More...
 
typedef int TOID
 Sequence type accepted and returned for OID indices. More...
 
typedef int TPIG
 Sequence type accepted and returned for PIG indices. More...
 
typedef TGi TGI
 Sequence type accepted and returned for GI indices. More...
 
typedef set< pair< int, int > > TRangeList
 List of sequence offset ranges. More...
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Static Public Member Functions inherited from CSeqDB
static string ESeqType2String (ESeqType type)
 Converts a CSeqDB sequence type into a human readable string. More...
 
static string GenerateSearchPath ()
 Returns the default BLAST database search path configured for this local installation of BLAST. More...
 
static CRef< CBlast_def_line_setExtractBlastDefline (const CBioseq &bioseq)
 Extract a Blast-def-line-set object from a Bioseq retrieved by CSeqDB. More...
 
static CRef< CBlast_def_line_setExtractBlastDefline (const CBioseq_Handle &handle)
 Extract a Blast-def-line-set object from a Bioseq_Handle retrieved by CSeqDB. More...
 
static CTime GetDate (const string &dbname, ESeqType seqtype)
 Returns the construction date of the database. More...
 
static void FindVolumePaths (const string &dbname, ESeqType seqtype, vector< string > &paths, vector< string > *alias_paths=NULL, bool recursive=true, bool expand_links=true)
 Find volume paths. More...
 
static void GetTaxInfo (TTaxId taxid, SSeqDBTaxInfo &info)
 Get taxonomy information. More...
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CSeqDB
static const string kOidNotFound
 String containing the error message in exceptions thrown when a given OID cannot be found. More...
 
static const char * kBlastDbDateFormat = "b d, Y H:m P"
 Format string for the date returned by CSeqDB::GetDate. More...
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CSeqDB
 CSeqDB ()
 No-argument Constructor. More...
 
void x_GetDBFilesMetaData (Int8 &disk_bytes, Int8 &cached_bytes, vector< string > &db_files, const string &user_path) const
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 
- Protected Attributes inherited from CSeqDB
class CSeqDBImplm_Impl
 Implementation details are hidden. (See seqdbimpl.hpp). More...
 

Detailed Description

CSeqDBExpert.

User interface class for blast databases, including experimental and advanced code for expert NCBI use.

Definition at line 55 of file seqdbexpert.hpp.

Constructor & Destructor Documentation

◆ CSeqDBExpert() [1/3]

CSeqDBExpert::CSeqDBExpert ( const string dbname,
ESeqType  seqtype,
CSeqDBGiList gilist = 0 
)

Short Constructor.

This version of the constructor assumes memory mapping and that the entire possible OID range will be included.

Parameters
dbnameA list of database or alias names, seperated by spaces
seqtypeSpecify eProtein, eNucleotide, or eUnknown.
gilistThe database will be filtered by this GI list if non-null.

Definition at line 38 of file seqdbexpert.cpp.

◆ CSeqDBExpert() [2/3]

CSeqDBExpert::CSeqDBExpert ( const string dbname,
ESeqType  seqtype,
int  oid_begin,
int  oid_end,
bool  use_mmap,
CSeqDBGiList gi_list = 0 
)

Constructor with MMap Flag and OID Range.

If the oid_end value is specified as zero, or as a value larger than the number of OIDs, it will be adjusted to the number of OIDs in the database. Specifying 0,0 for the start and end will cause inclusion of the entire database. This version of the constructor is obsolete because the sequence type is specified as a character (eventually only the ESeqType version will exist).

Parameters
dbnameA list of database or alias names, seperated by spaces.
seqtypeSpecify eProtein, eNucleotide, or eUnknown.
oid_beginIterator will skip OIDs less than this value. Only OIDs found in the OID lists (if any) will be returned.
oid_endIterator will return up to (but not including) this OID.
use_mmapIf kSeqDBMMap is specified (the default), memory mapping is attempted. If kSeqDBNoMMap is specified, or memory mapping fails, this platform does not support it, the less efficient read and write calls are used instead.
gi_listThe database will be filtered by this GI list if non-null.

Definition at line 45 of file seqdbexpert.cpp.

◆ CSeqDBExpert() [3/3]

CSeqDBExpert::CSeqDBExpert ( )

Null Constructor.

This version of the constructor does not open a specific blast database. This is provided for cases where the application only needs 'global' resources like the taxonomy database.

Definition at line 55 of file seqdbexpert.cpp.

◆ ~CSeqDBExpert()

CSeqDBExpert::~CSeqDBExpert ( )

Destructor.

This will return resources acquired by this object, including any gotten by the GetSequence() call, whether or not they have been returned by RetSequence().

Definition at line 60 of file seqdbexpert.cpp.

Member Function Documentation

◆ GetGiBounds()

void CSeqDBExpert::GetGiBounds ( TGi low_id,
TGi high_id,
int count 
)

Get GI Bounds.

Fetch the lowest, highest, and total number of GIs. A value is returned for each non-null argument. If the operation fails, an exception will be thrown, which probably indicates a missing index file.

Parameters
low_idLowest GI value in database. [out]
high_idHighest GI value in database. [out]
countNumber of GI values in database. [out]

Definition at line 74 of file seqdbexpert.cpp.

References count, CSeqDBImpl::GetGiBounds(), and CSeqDB::m_Impl.

Referenced by BOOST_AUTO_TEST_CASE().

◆ GetPigBounds()

void CSeqDBExpert::GetPigBounds ( int low_id,
int high_id,
int count 
)

Get PIG Bounds.

Fetch the lowest, highest, and total number of PIGs. A value is returned for each non-null argument. If the operation fails, an exception will be thrown, which probably indicates a missing index file.

Parameters
low_idLowest PIG value in database. [out]
high_idHighest PIG value in database. [out]
countNumber of PIG values in database. [out]

Definition at line 83 of file seqdbexpert.cpp.

References count, CSeqDBImpl::GetPigBounds(), and CSeqDB::m_Impl.

Referenced by BOOST_AUTO_TEST_CASE().

◆ GetRawSeqAndAmbig()

void CSeqDBExpert::GetRawSeqAndAmbig ( int  oid,
const char **  buffer,
int seq_length,
int ambig_length 
) const

Raw Sequence and Ambiguity Data.

Get a pointer to the raw sequence and ambiguity data, and the length of each. The encoding for these is not defined here and should not be relied on to be compatible between different database format versions. NULL can be supplied for parameters that are not needed (except oid). RetSequence() must be called with the pointer returned by 'buffer' if and only if that pointer is supplied as non-null by the user. Protein sequences will never have ambiguity data. Ambiguity data will be packed in the returned buffer at offset *seq_length.

Parameters
oidOrdinal id of the sequence.
bufferBuffer of raw data.
seq_lengthReturned length of the sequence data.
ambig_lengthReturned length of the ambiguity data.

Definition at line 64 of file seqdbexpert.cpp.

References buf, CSeqDBImpl::GetRawSeqAndAmbig(), and CSeqDB::m_Impl.

Referenced by BOOST_AUTO_TEST_CASE(), CRawSeqDBSource::GetNext(), CClusterDBSource::GetNext(), s_FetchRawData(), and CBuildDatabase::x_DupLocal().

◆ GetSequenceHash()

unsigned CSeqDBExpert::GetSequenceHash ( int  oid)

Get the sequence hash for a given OID.

The sequence data is fetched and the sequence hash is computed and returned.

Parameters
oidThe sequence to compute the hash of. [in]
Returns
The sequence hash.

Definition at line 106 of file seqdbexpert.cpp.

References CSeqDBImpl::GetSequenceHash(), and CSeqDB::m_Impl.

Referenced by BOOST_AUTO_TEST_CASE().

◆ GetStringBounds()

void CSeqDBExpert::GetStringBounds ( string low_id,
string high_id,
int count 
)

Get String Bounds.

Fetch the lowest, highest, and total number of string keys in the database index. A value is returned for each non-null argument. If the operation fails, an exception will be thrown, which probably indicates a missing index file. Note that the number of string keys does not directly correspond to the number of deflines, Seq-ids, or accessions.

Parameters
low_idLowest string value in database. [out]
high_idHighest string value in database. [out]
countNumber of string values in database. [out]

Definition at line 92 of file seqdbexpert.cpp.

References count, CSeqDBImpl::GetStringBounds(), and CSeqDB::m_Impl.

◆ HashToOids()

void CSeqDBExpert::HashToOids ( unsigned  hash,
vector< int > &  oids 
)

Get the OIDs for a given sequence hash.

The OIDs corresponding to a hash value are found and returned.

Parameters
hashThe sequence hash to look up. [in]
oidsOIDs of sequences with this hash. [out]
Returns
True if the hash value was found, false otherwise.

Definition at line 115 of file seqdbexpert.cpp.

References CSeqDBImpl::HashToOids(), and CSeqDB::m_Impl.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Verify()

void CSeqDBExpert::Verify ( )

Verify internal SeqDB data structures for consistency.

Definition at line 101 of file seqdbexpert.cpp.


The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:38 2024 by modify_doxy.py rev. 669887