NCBI C++ ToolKit
Classes | Macros | Functions | Variables
blast_seqsrc.c File Reference

Definition of ADT to retrieve sequences for the BLAST engine and low level details of the implementation of the BlastSeqSrc framework. More...

#include <algo/blast/core/blast_seqsrc.h>
#include <algo/blast/core/blast_seqsrc_impl.h>
+ Include dependency graph for blast_seqsrc.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  BlastSeqSrc
 Complete type definition of Blast Sequence Source ADT. More...
 

Macros

#define DEFINE_BLAST_SEQ_SRC_MEMBER_FUNCTIONS(member_type, member)
 
#define DEFINE_BLAST_SEQ_SRC_ACCESSOR(member_type, member)
 
#define DEFINE_BLAST_SEQ_SRC_MUTATOR(member_type, member)
 

Functions

BlastSeqSrcBlastSeqSrcNew (const BlastSeqSrcNewInfo *bssn_info)
 Allocates memory for a BlastSeqSrc structure and then invokes the constructor function defined in its first argument, passing the ctor_argument member of that same structure. More...
 
BlastSeqSrcBlastSeqSrcFree (BlastSeqSrc *seq_src)
 Frees the BlastSeqSrc structure by invoking the destructor function set by the user-defined constructor function when the structure is initialized (indirectly, by BlastSeqSrcNew). More...
 
BlastSeqSrcBlastSeqSrcCopy (const BlastSeqSrc *seq_src)
 Copy function: needed to guarantee thread safety. More...
 
char * BlastSeqSrcGetInitError (const BlastSeqSrc *seq_src)
 Function to retrieve NULL terminated string containing the description of an initialization error or NULL. More...
 
void BlastSeqSrcSetNumberOfThreads (BlastSeqSrc *seq_src, int n_threads)
 Set the number of threads for MT mode. More...
 
Int4 BlastSeqSrcGetNumSeqs (const BlastSeqSrc *seq_src)
 Get the number of sequences contained in the sequence source. More...
 
Int4 BlastSeqSrcGetNumSeqsStats (const BlastSeqSrc *seq_src)
 Get the number of sequences used for calculation of expect values etc. More...
 
Int4 BlastSeqSrcGetMaxSeqLen (const BlastSeqSrc *seq_src)
 Get the length of the longest sequence in the sequence source. More...
 
Int4 BlastSeqSrcGetMinSeqLen (const BlastSeqSrc *seq_src)
 Get the length of the longest sequence in the sequence source. More...
 
Int4 BlastSeqSrcGetAvgSeqLen (const BlastSeqSrc *seq_src)
 Get the average length of all sequences in the sequence source. More...
 
Int8 BlastSeqSrcGetTotLen (const BlastSeqSrc *seq_src)
 Get the total length of all sequences in the sequence source. More...
 
Int8 BlastSeqSrcGetTotLenStats (const BlastSeqSrc *seq_src)
 Get the total length of all sequences for calculation of expect value etc. More...
 
const char * BlastSeqSrcGetName (const BlastSeqSrc *seq_src)
 Get the Blast Sequence source name (e.g. More...
 
Boolean BlastSeqSrcGetIsProt (const BlastSeqSrc *seq_src)
 Find if the Blast Sequence Source contains protein or nucleotide sequences. More...
 
Boolean BlastSeqSrcGetSupportsPartialFetching (const BlastSeqSrc *seq_src)
 Find if the Blast Sequence Source supports partial fetching. More...
 
void BlastSeqSrcSetSeqRanges (const BlastSeqSrc *seq_src, BlastSeqSrcSetRangesArg *arg)
 Setting the ranges for partial fetching. More...
 
Int2 BlastSeqSrcGetSequence (const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
 Retrieve an individual sequence. More...
 
Int4 BlastSeqSrcGetSeqLen (const BlastSeqSrc *seq_src, void *oid)
 Retrieve sequence length (number of residues/bases) More...
 
void BlastSeqSrcReleaseSequence (const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
 Deallocate individual sequence. More...
 
BlastSeqSrcIteratorBlastSeqSrcIteratorNew ()
 Allocate and initialize an iterator over a BlastSeqSrc with a default chunk size for MT-safe iteration. More...
 
BlastSeqSrcIteratorBlastSeqSrcIteratorNewEx (unsigned int chunk_sz)
 Allocate and initialize an iterator over a BlastSeqSrc. More...
 
BlastSeqSrcIteratorBlastSeqSrcIteratorFree (BlastSeqSrcIterator *itr)
 Frees the BlastSeqSrcIterator structure. More...
 
Int4 BlastSeqSrcIteratorNext (const BlastSeqSrc *seq_src, BlastSeqSrcIterator *itr)
 Increments the BlastSeqSrcIterator. More...
 
void BlastSeqSrcResetChunkIterator (BlastSeqSrc *seq_src)
 Reset the internal "bookmark" of the last chunk for iteration provided by this object. More...
 
BlastSeqSrcSetRangesArgBlastSeqSrcSetRangesArgNew (Int4 num_ranges)
 new setrangearg More...
 
BlastSeqSrcSetRangesArgBlastSeqSrcSetRangesArgFree (BlastSeqSrcSetRangesArg *arg)
 free setrangearg More...
 
Int2 BlastSeqSrcSetRangesArgAddRange (BlastSeqSrcSetRangesArg *arg, Int4 begin, Int4 end, Int4 len)
 add new range More...
 
static int BeginCompareHSPs (const void *x, const void *y)
 
void BlastSeqSrcSetRangesArgBuild (BlastSeqSrcSetRangesArg *arg)
 build BlastSeqSrcSetRangesArg from range list More...
 
BlastSeqSrcConstructor _BlastSeqSrcImpl_GetNewFnPtr (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetNewFnPtr (BlastSeqSrc *var, BlastSeqSrcConstructor arg)
 
BlastSeqSrcDestructor _BlastSeqSrcImpl_GetDeleteFnPtr (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetDeleteFnPtr (BlastSeqSrc *var, BlastSeqSrcDestructor arg)
 
BlastSeqSrcCopier _BlastSeqSrcImpl_GetCopyFnPtr (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetCopyFnPtr (BlastSeqSrc *var, BlastSeqSrcCopier arg)
 
void * _BlastSeqSrcImpl_GetDataStructure (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetDataStructure (BlastSeqSrc *var, void *arg)
 
char * _BlastSeqSrcImpl_GetInitErrorStr (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetInitErrorStr (BlastSeqSrc *var, char *arg)
 
SetInt4FnPtr _BlastSeqSrcImpl_GetSetNumberOfThreads (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetSetNumberOfThreads (BlastSeqSrc *var, SetInt4FnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetNumSeqs (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetNumSeqs (BlastSeqSrc *var, GetInt4FnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetNumSeqsStats (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetNumSeqsStats (BlastSeqSrc *var, GetInt4FnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetMaxSeqLen (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetMaxSeqLen (BlastSeqSrc *var, GetInt4FnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetMinSeqLen (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetMinSeqLen (BlastSeqSrc *var, GetInt4FnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetAvgSeqLen (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetAvgSeqLen (BlastSeqSrc *var, GetInt4FnPtr arg)
 
GetInt8FnPtr _BlastSeqSrcImpl_GetGetTotLen (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetTotLen (BlastSeqSrc *var, GetInt8FnPtr arg)
 
GetInt8FnPtr _BlastSeqSrcImpl_GetGetTotLenStats (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetTotLenStats (BlastSeqSrc *var, GetInt8FnPtr arg)
 
GetStrFnPtr _BlastSeqSrcImpl_GetGetName (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetName (BlastSeqSrc *var, GetStrFnPtr arg)
 
GetBoolFnPtr _BlastSeqSrcImpl_GetGetIsProt (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetIsProt (BlastSeqSrc *var, GetBoolFnPtr arg)
 
GetBoolFnPtr _BlastSeqSrcImpl_GetGetSupportsPartialFetching (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetSupportsPartialFetching (BlastSeqSrc *var, GetBoolFnPtr arg)
 
SetSeqRangeFnPtr _BlastSeqSrcImpl_GetSetSeqRange (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetSetSeqRange (BlastSeqSrc *var, SetSeqRangeFnPtr arg)
 
GetSeqBlkFnPtr _BlastSeqSrcImpl_GetGetSequence (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetSequence (BlastSeqSrc *var, GetSeqBlkFnPtr arg)
 
GetInt4FnPtr _BlastSeqSrcImpl_GetGetSeqLen (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetGetSeqLen (BlastSeqSrc *var, GetInt4FnPtr arg)
 
ReleaseSeqBlkFnPtr _BlastSeqSrcImpl_GetReleaseSequence (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetReleaseSequence (BlastSeqSrc *var, ReleaseSeqBlkFnPtr arg)
 
AdvanceIteratorFnPtr _BlastSeqSrcImpl_GetIterNext (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetIterNext (BlastSeqSrc *var, AdvanceIteratorFnPtr arg)
 
ResetChunkIteratorFnPtr _BlastSeqSrcImpl_GetResetChunkIterator (const BlastSeqSrc *var)
 
void _BlastSeqSrcImpl_SetResetChunkIterator (BlastSeqSrc *var, ResetChunkIteratorFnPtr arg)
 

Variables

const unsigned int kBlastSeqSrcDefaultChunkSize = 1024
 How many database sequences to process in one database chunk. More...
 

Detailed Description

Definition of ADT to retrieve sequences for the BLAST engine and low level details of the implementation of the BlastSeqSrc framework.

Definition in file blast_seqsrc.c.

Macro Definition Documentation

◆ DEFINE_BLAST_SEQ_SRC_ACCESSOR

#define DEFINE_BLAST_SEQ_SRC_ACCESSOR (   member_type,
  member 
)
Value:
member_type \
_BlastSeqSrcImpl_Get##member(const BlastSeqSrc* var) \
{ \
if (var) \
return var->member; \
else \
return (member_type) NULL; \
}
#define NULL
Definition: ncbistd.hpp:225
Complete type definition of Blast Sequence Source ADT.
Definition: blast_seqsrc.c:43

Definition at line 533 of file blast_seqsrc.c.

◆ DEFINE_BLAST_SEQ_SRC_MEMBER_FUNCTIONS

#define DEFINE_BLAST_SEQ_SRC_MEMBER_FUNCTIONS (   member_type,
  member 
)
Value:
DEFINE_BLAST_SEQ_SRC_ACCESSOR(member_type, member) \
DEFINE_BLAST_SEQ_SRC_MUTATOR(member_type, member)
#define DEFINE_BLAST_SEQ_SRC_ACCESSOR(member_type, member)
Definition: blast_seqsrc.c:533

Definition at line 529 of file blast_seqsrc.c.

◆ DEFINE_BLAST_SEQ_SRC_MUTATOR

#define DEFINE_BLAST_SEQ_SRC_MUTATOR (   member_type,
  member 
)
Value:
void \
_BlastSeqSrcImpl_Set##member(BlastSeqSrc* var, member_type arg) \
{ if (var) var->member = arg; }

Definition at line 543 of file blast_seqsrc.c.

Function Documentation

◆ _BlastSeqSrcImpl_GetCopyFnPtr()

BlastSeqSrcCopier _BlastSeqSrcImpl_GetCopyFnPtr ( const BlastSeqSrc var)

Definition at line 553 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetDataStructure()

void* _BlastSeqSrcImpl_GetDataStructure ( const BlastSeqSrc var)

◆ _BlastSeqSrcImpl_GetDeleteFnPtr()

BlastSeqSrcDestructor _BlastSeqSrcImpl_GetDeleteFnPtr ( const BlastSeqSrc var)

Definition at line 552 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetAvgSeqLen()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetAvgSeqLen ( const BlastSeqSrc var)

Definition at line 562 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetIsProt()

GetBoolFnPtr _BlastSeqSrcImpl_GetGetIsProt ( const BlastSeqSrc var)

Definition at line 567 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetMaxSeqLen()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetMaxSeqLen ( const BlastSeqSrc var)

Definition at line 560 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetMinSeqLen()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetMinSeqLen ( const BlastSeqSrc var)

Definition at line 561 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetName()

GetStrFnPtr _BlastSeqSrcImpl_GetGetName ( const BlastSeqSrc var)

Definition at line 566 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetNumSeqs()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetNumSeqs ( const BlastSeqSrc var)

Definition at line 558 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetNumSeqsStats()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetNumSeqsStats ( const BlastSeqSrc var)

Definition at line 559 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetSeqLen()

GetInt4FnPtr _BlastSeqSrcImpl_GetGetSeqLen ( const BlastSeqSrc var)

Definition at line 573 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetSequence()

GetSeqBlkFnPtr _BlastSeqSrcImpl_GetGetSequence ( const BlastSeqSrc var)

Definition at line 572 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetSupportsPartialFetching()

GetBoolFnPtr _BlastSeqSrcImpl_GetGetSupportsPartialFetching ( const BlastSeqSrc var)

Definition at line 569 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetTotLen()

GetInt8FnPtr _BlastSeqSrcImpl_GetGetTotLen ( const BlastSeqSrc var)

Definition at line 563 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetGetTotLenStats()

GetInt8FnPtr _BlastSeqSrcImpl_GetGetTotLenStats ( const BlastSeqSrc var)

Definition at line 564 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetInitErrorStr()

char* _BlastSeqSrcImpl_GetInitErrorStr ( const BlastSeqSrc var)

Definition at line 556 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetIterNext()

AdvanceIteratorFnPtr _BlastSeqSrcImpl_GetIterNext ( const BlastSeqSrc var)

Definition at line 576 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetNewFnPtr()

BlastSeqSrcConstructor _BlastSeqSrcImpl_GetNewFnPtr ( const BlastSeqSrc var)

Definition at line 551 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetReleaseSequence()

ReleaseSeqBlkFnPtr _BlastSeqSrcImpl_GetReleaseSequence ( const BlastSeqSrc var)

Definition at line 574 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetResetChunkIterator()

ResetChunkIteratorFnPtr _BlastSeqSrcImpl_GetResetChunkIterator ( const BlastSeqSrc var)

Definition at line 581 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetSetNumberOfThreads()

SetInt4FnPtr _BlastSeqSrcImpl_GetSetNumberOfThreads ( const BlastSeqSrc var)

Definition at line 557 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_GetSetSeqRange()

SetSeqRangeFnPtr _BlastSeqSrcImpl_GetSetSeqRange ( const BlastSeqSrc var)

Definition at line 570 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_SetCopyFnPtr()

void _BlastSeqSrcImpl_SetCopyFnPtr ( BlastSeqSrc var,
BlastSeqSrcCopier  arg 
)

◆ _BlastSeqSrcImpl_SetDataStructure()

void _BlastSeqSrcImpl_SetDataStructure ( BlastSeqSrc var,
void *  arg 
)

◆ _BlastSeqSrcImpl_SetDeleteFnPtr()

void _BlastSeqSrcImpl_SetDeleteFnPtr ( BlastSeqSrc var,
BlastSeqSrcDestructor  arg 
)

◆ _BlastSeqSrcImpl_SetGetAvgSeqLen()

void _BlastSeqSrcImpl_SetGetAvgSeqLen ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetIsProt()

void _BlastSeqSrcImpl_SetGetIsProt ( BlastSeqSrc var,
GetBoolFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetMaxSeqLen()

void _BlastSeqSrcImpl_SetGetMaxSeqLen ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetMinSeqLen()

void _BlastSeqSrcImpl_SetGetMinSeqLen ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

Definition at line 561 of file blast_seqsrc.c.

Referenced by s_InitNewSeqDbSrc(), s_MultiSeqSrcNew(), and s_QueryFactorySrcNew().

◆ _BlastSeqSrcImpl_SetGetName()

void _BlastSeqSrcImpl_SetGetName ( BlastSeqSrc var,
GetStrFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetNumSeqs()

void _BlastSeqSrcImpl_SetGetNumSeqs ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetNumSeqsStats()

void _BlastSeqSrcImpl_SetGetNumSeqsStats ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetSeqLen()

void _BlastSeqSrcImpl_SetGetSeqLen ( BlastSeqSrc var,
GetInt4FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetSequence()

void _BlastSeqSrcImpl_SetGetSequence ( BlastSeqSrc var,
GetSeqBlkFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetSupportsPartialFetching()

void _BlastSeqSrcImpl_SetGetSupportsPartialFetching ( BlastSeqSrc var,
GetBoolFnPtr  arg 
)

Definition at line 569 of file blast_seqsrc.c.

Referenced by s_InitNewSeqDbSrc(), and s_InitVDBBlastSeqSrcFields().

◆ _BlastSeqSrcImpl_SetGetTotLen()

void _BlastSeqSrcImpl_SetGetTotLen ( BlastSeqSrc var,
GetInt8FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetGetTotLenStats()

void _BlastSeqSrcImpl_SetGetTotLenStats ( BlastSeqSrc var,
GetInt8FnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetInitErrorStr()

void _BlastSeqSrcImpl_SetInitErrorStr ( BlastSeqSrc var,
char *  arg 
)

◆ _BlastSeqSrcImpl_SetIterNext()

void _BlastSeqSrcImpl_SetIterNext ( BlastSeqSrc var,
AdvanceIteratorFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetNewFnPtr()

void _BlastSeqSrcImpl_SetNewFnPtr ( BlastSeqSrc var,
BlastSeqSrcConstructor  arg 
)

Definition at line 551 of file blast_seqsrc.c.

◆ _BlastSeqSrcImpl_SetReleaseSequence()

void _BlastSeqSrcImpl_SetReleaseSequence ( BlastSeqSrc var,
ReleaseSeqBlkFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetResetChunkIterator()

void _BlastSeqSrcImpl_SetResetChunkIterator ( BlastSeqSrc var,
ResetChunkIteratorFnPtr  arg 
)

◆ _BlastSeqSrcImpl_SetSetNumberOfThreads()

void _BlastSeqSrcImpl_SetSetNumberOfThreads ( BlastSeqSrc var,
SetInt4FnPtr  arg 
)

Definition at line 557 of file blast_seqsrc.c.

Referenced by s_InitNewSeqDbSrc().

◆ _BlastSeqSrcImpl_SetSetSeqRange()

void _BlastSeqSrcImpl_SetSetSeqRange ( BlastSeqSrc var,
SetSeqRangeFnPtr  arg 
)

Definition at line 570 of file blast_seqsrc.c.

Referenced by s_InitNewSeqDbSrc(), and s_InitVDBBlastSeqSrcFields().

◆ BeginCompareHSPs()

static int BeginCompareHSPs ( const void *  x,
const void *  y 
)
static

Definition at line 488 of file blast_seqsrc.c.

Referenced by BlastSeqSrcSetRangesArgBuild().

◆ BlastSeqSrcCopy()

BlastSeqSrc* BlastSeqSrcCopy ( const BlastSeqSrc seq_src)

Copy function: needed to guarantee thread safety.

Copies the contents of an input BlastSeqSrc, then calls a copier function, provided by the implementation, to achieve multi-thread safety.

Parameters
seq_srcBlastSeqSrc to copy [in]
Returns
An MT-safe copy of the structure passed in, NULL in case of memory allocation failure, or, if no copy function was provided by the implementation, a bitwise copy of the input.

Definition at line 138 of file blast_seqsrc.c.

References BlastMemDup(), BlastSeqSrc::CopyFnPtr, and NULL.

Referenced by Blast_RedoAlignmentCore_MT(), BOOST_AUTO_TEST_CASE(), CPrelimSearchThread::CPrelimSearchThread(), NaHashLookupThreadDataNew(), SplitQuery_CreateChunkData(), and SThreadLocalDataArraySetup().

◆ BlastSeqSrcFree()

BlastSeqSrc* BlastSeqSrcFree ( BlastSeqSrc seq_src)

Frees the BlastSeqSrc structure by invoking the destructor function set by the user-defined constructor function when the structure is initialized (indirectly, by BlastSeqSrcNew).

If the destructor function pointer is not set, a memory leak could occur. Note that it is the implementation's destructor responsibility to free the BlastSeqSrc structure by calling sfree.

Parameters
seq_srcBlastSeqSrc to free [in]
Returns
NULL

Definition at line 112 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DeleteFnPtr, BlastSeqSrc::InitErrorStr, NULL, and sfree.

Referenced by Blast_RedoAlignmentCore_MT(), BOOST_AUTO_TEST_CASE(), CBlastPrelimSearch::CBlastPrelimSearch(), CPrelimSearchThread::CPrelimSearchThread(), CSetupFactory::CreateBlastSeqSrc(), NaHashLookupThreadDataFree(), CBlastKmerSearch::Run(), SplitQuery_CreateChunkData(), SThreadLocalDataFree(), CVDBBlastUtil::x_MakeVDBSeqSrc(), CLocalDbAdapter::~CLocalDbAdapter(), CVDBBlastUtil::~CVDBBlastUtil(), and FailingMockSeqSrcTestFixture::~FailingMockSeqSrcTestFixture().

◆ BlastSeqSrcGetAvgSeqLen()

Int4 BlastSeqSrcGetAvgSeqLen ( const BlastSeqSrc seq_src)

Get the average length of all sequences in the sequence source.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 211 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetAvgSeqLen, and NULL.

Referenced by BLAST_PreliminarySearchEngine(), BOOST_AUTO_TEST_CASE(), and s_checkDbSeqSrcFunctions().

◆ BlastSeqSrcGetInitError()

char* BlastSeqSrcGetInitError ( const BlastSeqSrc seq_src)

Function to retrieve NULL terminated string containing the description of an initialization error or NULL.

This function MUST ALWAYS be called after calling one of the client implementation's Init functions. If the return value is not NULL, invoking any other functionality from the BlastSeqSrc will result in undefined behavior. Caller is responsible for deallocating the return value.

Parameters
seq_srcBlastSeqSrc from which to get an error [in]
Returns
error message or NULL

Definition at line 159 of file blast_seqsrc.c.

References BlastSeqSrc::InitErrorStr, NULL, and strdup.

Referenced by BOOST_AUTO_TEST_CASE(), TestUtil::CheckForBlastSeqSrcErrors(), CSetupFactory::CreateBlastSeqSrc(), s_CheckForBlastSeqSrcErrors(), and CVDBBlastUtil::x_MakeVDBSeqSrc().

◆ BlastSeqSrcGetIsProt()

Boolean BlastSeqSrcGetIsProt ( const BlastSeqSrc seq_src)

Find if the Blast Sequence Source contains protein or nucleotide sequences.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 243 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetIsProt, and NULL.

Referenced by BOOST_AUTO_TEST_CASE(), CLocalDbAdapter::IsProtein(), s_checkDbSeqSrcFunctions(), and s_InitSeqInfoSrc().

◆ BlastSeqSrcGetMaxSeqLen()

Int4 BlastSeqSrcGetMaxSeqLen ( const BlastSeqSrc seq_src)

Get the length of the longest sequence in the sequence source.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 193 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetMaxSeqLen, and NULL.

Referenced by BLAST_GapAlignSetUp(), Blast_RedoAlignmentCore_MT(), BOOST_AUTO_TEST_CASE(), and s_checkDbSeqSrcFunctions().

◆ BlastSeqSrcGetMinSeqLen()

Int4 BlastSeqSrcGetMinSeqLen ( const BlastSeqSrc seq_src)

Get the length of the longest sequence in the sequence source.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 201 of file blast_seqsrc.c.

References ASSERT, BLAST_SEQSRC_MINLENGTH, BlastSeqSrc::DataStructure, BlastSeqSrc::GetMinSeqLen, and NULL.

Referenced by BLAST_GapAlignSetUp().

◆ BlastSeqSrcGetName()

const char* BlastSeqSrcGetName ( const BlastSeqSrc seq_src)

Get the Blast Sequence source name (e.g.

: BLAST database name). Here the full name (path and file name) should be returned. If an alias file is present the return value should be the full name of the alias file.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 235 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetName, and NULL.

Referenced by BlastSetupPreliminarySearchEx(), BOOST_AUTO_TEST_CASE(), CBlastTracebackSearch::CBlastTracebackSearch(), CVDBBlastUtil::FillVDBInfo(), s_checkDbSeqSrcFunctions(), and s_InitSeqInfoSrc().

◆ BlastSeqSrcGetNumSeqs()

Int4 BlastSeqSrcGetNumSeqs ( const BlastSeqSrc seq_src)

◆ BlastSeqSrcGetNumSeqsStats()

Int4 BlastSeqSrcGetNumSeqsStats ( const BlastSeqSrc seq_src)

Get the number of sequences used for calculation of expect values etc.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 185 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetNumSeqsStats, and NULL.

Referenced by BLAST_GapAlignSetUp(), BLAST_GetSubjectTotals(), and SplitQuery_SetEffectiveSearchSpace().

◆ BlastSeqSrcGetSeqLen()

Int4 BlastSeqSrcGetSeqLen ( const BlastSeqSrc seq_src,
void *  oid 
)

Retrieve sequence length (number of residues/bases)

Parameters
seq_srcthe BLAST sequence source [in]
oidordinal id of the sequence desired (should be Uint4) [in]

Definition at line 281 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, and BlastSeqSrc::GetSeqLen.

Referenced by BLAST_GapAlignSetUp(), BLAST_GetSubjectTotals(), BLAST_SetupPartialFetching(), BOOST_AUTO_TEST_CASE(), CVDBSeqInfoSrc::GetLength(), s_checkDbSeqSrcFunctions(), and s_MatchingSequenceInitialize().

◆ BlastSeqSrcGetSequence()

Int2 BlastSeqSrcGetSequence ( const BlastSeqSrc seq_src,
BlastSeqSrcGetSeqArg getseq_arg 
)

Retrieve an individual sequence.

Parameters
seq_srcthe BLAST sequence source [in]
getseq_argarguments to aid retrieval of sequence data from the BlastSeqSrc [in|out]
Returns
one of the BLAST_SEQSRC_* defined in blast_seqsrc.h

Definition at line 271 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, and BlastSeqSrc::GetSequence.

Referenced by BLAST_ComputeTraceback_MT(), Blast_HSPListReevaluateUngapped(), BLAST_PreliminarySearchEngine(), BOOST_AUTO_TEST_CASE(), CSeedTop::Run(), s_checkDbSeqSrcFunctions(), s_ComputeNumIdentities(), s_MatchingSequenceInitialize(), s_NaHashLookupScanSubjectForWordCounts(), s_RPSComputeTraceback(), and s_ScanSubjectForWordCounts().

◆ BlastSeqSrcGetSupportsPartialFetching()

Boolean BlastSeqSrcGetSupportsPartialFetching ( const BlastSeqSrc seq_src)

Find if the Blast Sequence Source supports partial fetching.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 251 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, FALSE, BlastSeqSrc::GetSupportsPartialFetching, and NULL.

Referenced by BLAST_ComputeTraceback_MT(), Blast_RedoAlignmentCore_MT(), and BLAST_SetupPartialFetching().

◆ BlastSeqSrcGetTotLen()

Int8 BlastSeqSrcGetTotLen ( const BlastSeqSrc seq_src)

◆ BlastSeqSrcGetTotLenStats()

Int8 BlastSeqSrcGetTotLenStats ( const BlastSeqSrc seq_src)

Get the total length of all sequences for calculation of expect value etc.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 227 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, BlastSeqSrc::GetTotLenStats, and NULL.

Referenced by BLAST_GapAlignSetUp(), BLAST_GetSubjectTotals(), and SplitQuery_SetEffectiveSearchSpace().

◆ BlastSeqSrcIteratorFree()

BlastSeqSrcIterator* BlastSeqSrcIteratorFree ( BlastSeqSrcIterator itr)

◆ BlastSeqSrcIteratorNew()

BlastSeqSrcIterator* BlastSeqSrcIteratorNew ( void  )

Allocate and initialize an iterator over a BlastSeqSrc with a default chunk size for MT-safe iteration.

Returns
pointer to initialized iterator for BlastSeqSrc

Definition at line 380 of file blast_seqsrc.c.

References BlastSeqSrcIteratorNewEx().

Referenced by BOOST_AUTO_TEST_CASE(), PrintSAMHeader(), and s_checkDbSeqSrcFunctions().

◆ BlastSeqSrcIteratorNewEx()

BlastSeqSrcIterator* BlastSeqSrcIteratorNewEx ( unsigned int  chunk_sz)

Allocate and initialize an iterator over a BlastSeqSrc.

Parameters
chunk_szsets the chunk size of the iterator, if zero use kBlastSeqSrcDefaultChunkSize (above). [in]
Returns
pointer to initialized iterator for BlastSeqSrc

Definition at line 387 of file blast_seqsrc.c.

References calloc(), BlastSeqSrcIterator::chunk_sz, BlastSeqSrcIterator::current_pos, kBlastSeqSrcDefaultChunkSize, malloc(), NULL, BlastSeqSrcIterator::oid_list, sfree, and UINT4_MAX.

Referenced by BLAST_PreliminarySearchEngine(), BlastSeqSrcIteratorNew(), CVdbFastaExtractor::DumpAll(), NaHashLookupThreadDataNew(), CSeedTop::Run(), and s_ScanSubjectForWordCounts().

◆ BlastSeqSrcIteratorNext()

Int4 BlastSeqSrcIteratorNext ( const BlastSeqSrc seq_src,
BlastSeqSrcIterator itr 
)

◆ BlastSeqSrcNew()

BlastSeqSrc* BlastSeqSrcNew ( const BlastSeqSrcNewInfo bssn_info)

Allocates memory for a BlastSeqSrc structure and then invokes the constructor function defined in its first argument, passing the ctor_argument member of that same structure.

If the constructor function pointer is not set or there is a memory allocation failure, NULL is returned.

Note
This function need not be called directly by client code as all the implementations of the BlastSeqSrc interface provide a function(s) which call this function (MultiSeqBlastSeqSrcInit, SeqDbBlastSeqSrcInit)
Parameters
bssn_infoStructure defining constructor and its argument to be invoked from this function [in]
Returns
a properly initialized BlastSeqSrc structure or NULL.

Definition at line 90 of file blast_seqsrc.c.

References calloc(), BlastSeqSrcNewInfo::constructor, BlastSeqSrcNewInfo::ctor_argument, BlastSeqSrc::NewFnPtr, NULL, and sfree.

Referenced by MockBlastSeqSrcInit(), MultiSeqBlastSeqSrcInit(), s_QueryFactoryBlastSeqSrcInit(), SeqDbBlastSeqSrcInit(), and SRABlastSeqSrcInit().

◆ BlastSeqSrcReleaseSequence()

void BlastSeqSrcReleaseSequence ( const BlastSeqSrc seq_src,
BlastSeqSrcGetSeqArg getseq_arg 
)

◆ BlastSeqSrcResetChunkIterator()

void BlastSeqSrcResetChunkIterator ( BlastSeqSrc seq_src)

Reset the internal "bookmark" of the last chunk for iteration provided by this object.

Parameters
seq_srcthe BLAST sequence source [in]

Definition at line 436 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, and BlastSeqSrc::ResetChunkIterator.

Referenced by PrintSAMHeader(), CLocalDbAdapter::ResetBlastSeqSrcIteration(), CBlastPrelimSearch::Run(), s_NaHashLookupScanSubjectForWordCounts(), s_ScanSubjectForWordCounts(), and SplitQuery_CreateChunkData().

◆ BlastSeqSrcSetNumberOfThreads()

void BlastSeqSrcSetNumberOfThreads ( BlastSeqSrc seq_src,
int  nthreads 
)

Set the number of threads for MT mode.

Parameters
nthreadsthe number of threads [in]

Definition at line 168 of file blast_seqsrc.c.

References BlastSeqSrc::DataStructure, and BlastSeqSrc::SetNumberOfThreads.

Referenced by CBlastPrelimSearch::x_LaunchMultiThreadedSearch().

◆ BlastSeqSrcSetRangesArgAddRange()

Int2 BlastSeqSrcSetRangesArgAddRange ( BlastSeqSrcSetRangesArg arg,
Int4  begin,
Int4  end,
Int4  len 
)

add new range

Returns
0 in case of success, otherwise 1

Definition at line 467 of file blast_seqsrc.c.

References ASSERT, BLAST_SEQSRC_OVERHANG, BlastSeqSrcSetRangesArg::capacity, len, MAX, MIN, BlastSeqSrcSetRangesArg::num_ranges, and BlastSeqSrcSetRangesArg::ranges.

Referenced by BLAST_SetupPartialFetching().

◆ BlastSeqSrcSetRangesArgBuild()

void BlastSeqSrcSetRangesArgBuild ( BlastSeqSrcSetRangesArg arg)

◆ BlastSeqSrcSetRangesArgFree()

BlastSeqSrcSetRangesArg* BlastSeqSrcSetRangesArgFree ( BlastSeqSrcSetRangesArg arg)

◆ BlastSeqSrcSetRangesArgNew()

BlastSeqSrcSetRangesArg* BlastSeqSrcSetRangesArgNew ( Int4  num_ranges)

◆ BlastSeqSrcSetSeqRanges()

void BlastSeqSrcSetSeqRanges ( const BlastSeqSrc seq_src,
BlastSeqSrcSetRangesArg arg 
)

Setting the ranges for partial fetching.

Definition at line 261 of file blast_seqsrc.c.

References ASSERT, BlastSeqSrc::DataStructure, and BlastSeqSrc::SetSeqRange.

Variable Documentation

◆ kBlastSeqSrcDefaultChunkSize

const unsigned int kBlastSeqSrcDefaultChunkSize = 1024

How many database sequences to process in one database chunk.

this value is overriden in seqdb implementation, where the number of sequences is determined by the mmaped slice size

Definition at line 385 of file blast_seqsrc.c.

Referenced by BlastSeqSrcIteratorNewEx().

Modified on Fri May 24 14:50:41 2024 by modify_doxy.py rev. 669887