41 #ifndef ALGO_BLAST_CORE__BLAST_SEQSRC__H
42 #define ALGO_BLAST_CORE__BLAST_SEQSRC__H
203 #define BLAST_SEQSRC_MINGAP 1024
204 #define BLAST_SEQSRC_OVERHANG 1024
205 #define BLAST_SEQSRC_MINLENGTH 10
290 #define BLAST_SEQSRC_EXCLUDED -3
291 #define BLAST_SEQSRC_ERROR -2
292 #define BLAST_SEQSRC_EOF -1
293 #define BLAST_SEQSRC_SUCCESS 0
338 #ifdef KAPPA_PRINT_DIAGNOSTICS
341 typedef struct Blast_GiList {
343 size_t num_allocated;
349 Blast_GiList* Blast_GiListNew(
void);
355 Blast_GiList* Blast_GiListNewEx(
size_t list_size);
361 Blast_GiList* Blast_GiListFree(Blast_GiList* gilist);
375 Int2 Blast_GiList_Append(Blast_GiList* gilist,
Int4 gi);
387 BlastSeqSrcGetGis(
const BlastSeqSrc* seq_src,
void* oid);
Definitions used throughout BLAST.
Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...
Defines to provide correct exporting from BLAST DLL in Windows.
#define NCBI_XBLAST_EXPORT
NULL operations for other cases.
Structures for BLAST messages.
Int2 BlastSeqSrcSetRangesArgAddRange(BlastSeqSrcSetRangesArg *arg, Int4 begin, Int4 end, Int4 len)
add new range
Int4 BlastSeqSrcIteratorNext(const BlastSeqSrc *seq_src, BlastSeqSrcIterator *itr)
Increments the BlastSeqSrcIterator.
Int8 BlastSeqSrcGetTotLenStats(const BlastSeqSrc *seq_src)
Get the total length of all sequences for calculation of expect value etc.
BlastSeqSrcIterator * BlastSeqSrcIteratorFree(BlastSeqSrcIterator *itr)
Frees the BlastSeqSrcIterator structure.
BlastSeqSrcIterator * BlastSeqSrcIteratorNewEx(unsigned int chunk_sz)
Allocate and initialize an iterator over a BlastSeqSrc.
Int4 BlastSeqSrcGetSeqLen(const BlastSeqSrc *seq_src, void *oid)
Retrieve sequence length (number of residues/bases)
Boolean BlastSeqSrcGetIsProt(const BlastSeqSrc *seq_src)
Find if the Blast Sequence Source contains protein or nucleotide sequences.
BlastSeqSrc * BlastSeqSrcNew(const BlastSeqSrcNewInfo *bssn_info)
Allocates memory for a BlastSeqSrc structure and then invokes the constructor function defined in its...
void BlastSeqSrcSetRangesArgBuild(BlastSeqSrcSetRangesArg *arg)
build BlastSeqSrcSetRangesArg from range list
void BlastSeqSrcReleaseSequence(const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
Deallocate individual sequence.
BlastSeqSrcIterator * BlastSeqSrcIteratorNew(void)
Allocate and initialize an iterator over a BlastSeqSrc with a default chunk size for MT-safe iteratio...
BlastSeqSrc * BlastSeqSrcCopy(const BlastSeqSrc *seq_src)
Copy function: needed to guarantee thread safety.
void BlastSeqSrcSetSeqRanges(const BlastSeqSrc *seq_src, BlastSeqSrcSetRangesArg *setranges_arg)
Setting the ranges for partial fetching.
Int4 BlastSeqSrcGetAvgSeqLen(const BlastSeqSrc *seq_src)
Get the average length of all sequences in the sequence source.
char * BlastSeqSrcGetInitError(const BlastSeqSrc *seq_src)
Function to retrieve NULL terminated string containing the description of an initialization error or ...
Int4 BlastSeqSrcGetNumSeqs(const BlastSeqSrc *seq_src)
Get the number of sequences contained in the sequence source.
struct BlastSeqSrcSetRangesArg BlastSeqSrcSetRangesArg
Structure used as the argument to function SetRanges.
Int8 BlastSeqSrcGetTotLen(const BlastSeqSrc *seq_src)
Get the total length of all sequences in the sequence source.
BlastSeqSrc * BlastSeqSrcFree(BlastSeqSrc *seq_src)
Frees the BlastSeqSrc structure by invoking the destructor function set by the user-defined construct...
Int4 BlastSeqSrcGetNumSeqsStats(const BlastSeqSrc *seq_src)
Get the number of sequences used for calculation of expect values etc.
BlastSeqSrcSetRangesArg * BlastSeqSrcSetRangesArgNew(Int4 num_ranges)
new setrangearg
const unsigned int kBlastSeqSrcDefaultChunkSize
How many database sequences to process in one database chunk.
struct BlastSeqSrcGetSeqArg BlastSeqSrcGetSeqArg
Structure used as the second argument to functions satisfying the GetSeqBlkFnPtr signature,...
void BlastSeqSrcSetNumberOfThreads(BlastSeqSrc *seq_src, int nthreads)
Set the number of threads for MT mode.
Int4 BlastSeqSrcGetMaxSeqLen(const BlastSeqSrc *seq_src)
Get the length of the longest sequence in the sequence source.
Boolean BlastSeqSrcGetSupportsPartialFetching(const BlastSeqSrc *seq_src)
Find if the Blast Sequence Source supports partial fetching.
const char * BlastSeqSrcGetName(const BlastSeqSrc *seq_src)
Get the Blast Sequence source name (e.g.
Int2 BlastSeqSrcGetSequence(const BlastSeqSrc *seq_src, BlastSeqSrcGetSeqArg *getseq_arg)
Retrieve an individual sequence.
BlastSeqSrcSetRangesArg * BlastSeqSrcSetRangesArgFree(BlastSeqSrcSetRangesArg *arg)
free setrangearg
Int4 BlastSeqSrcGetMinSeqLen(const BlastSeqSrc *seq_src)
Get the length of the longest sequence in the sequence source.
void BlastSeqSrcResetChunkIterator(BlastSeqSrc *seq_src)
Reset the internal "bookmark" of the last chunk for iteration provided by this object.
EBlastEncoding
Different types of sequence encodings for sequence retrieval from the BLAST database.
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
int64_t Int8
8-byte (64-bit) signed integer
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Uint1 Boolean
bool replacment for C
const Int2 kOutOfMemory
Failure due to out-of-memory condition.
const Int2 kBadParameter
Invalid parameter used in a function call.
Structure to hold a sequence.
Structure used as the second argument to functions satisfying the GetSeqBlkFnPtr signature,...
Int4 oid
Oid in BLAST database, index in an array of sequences, etc [in].
Boolean reset_ranges
This option allows the BLAST engine to communicate with the BlastSeqSrc that the offset ranges for a ...
EBlastEncoding encoding
Encoding of sequence, i.e.
Boolean check_oid_exclusion
Check whether an OID is excluded due to overlapping filtering.
BlastSeqSrcSetRangesArg * ranges
BLAST_SequenceBlk * seq
Sequence to return, if NULL, it should allocated by GetSeqBlkFnPtr (using BlastSeqBlkNew or BlastSetU...
Complete type definition of Blast Sequence Source Iterator.
Complete type definition of the structure used to create a new BlastSeqSrc.
Structure used as the argument to function SetRanges.
Int4 capacity
initial allocation
Int4 * ranges
Ranges in sorted order [in].
Int4 num_ranges
Number of actual ranges contained.
Int4 oid
Oid in BLAST database, index in an array of sequences, etc [in].
Complete type definition of Blast Sequence Source ADT.