NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions | Variables
blast_def.h File Reference

Definitions used throughout BLAST. More...

#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/blast_export.h>
#include <algo/blast/core/blast_program.h>
+ Include dependency graph for blast_def.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

union  BlastOffsetPair
 This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applications, as well as the option to submit searches to the test server in NCBI for remote BLAST searches #define _BLAST_DEBUG 1. More...
 
struct  SSeqRange
 A structure containing two integers, used e.g. More...
 
struct  BlastSeqLoc
 Used to hold a set of positions, mostly used for filtering. More...
 
struct  BlastMaskLoc
 Structure for keeping the query masking information. More...
 
struct  BLAST_SequenceBlk
 Structure to hold a sequence. More...
 
struct  SPHIPatternInfo
 Information about a single pattern occurence in the query. More...
 
struct  SPHIQueryInfo
 In PHI BLAST, structure containing information about all pattern occurrences in query. More...
 
struct  SBlastTargetTranslation
 Information about target translations. More...
 
struct  SBlastProgress
 Progress monitoring structure. More...
 

Macros

#define CODON_LENGTH   3
 Codons are always of length 3. More...
 
#define DEFAULT_LONGEST_INTRON   122
 For translated gapped searches, this is the default value in nucleotides of longest_intron (for ungapped translated searches, the default value of longest_intron is zero, which causes a legacy method of HSP linking that does not use longest_intron to be invoked). More...
 
#define COMPRESSION_RATIO   4
 Compression ratio of nucleotide bases (4 bases in 1 byte) More...
 
#define NUM_FRAMES   6
 Number of frames to which we translate in translating searches. More...
 
#define NUM_STRANDS   2
 Number of frames in a nucleotide sequence. More...
 
#define GENCODE_STRLEN   64
 Length of the genetic code string. More...
 
#define BLAST_CMP(a, b)   ((a)>(b) ? 1 : ((a)<(b) ? -1 : 0))
 A macro expression that returns 1, 0, -1 if a is greater than, equal to or less than b, respectively. More...
 
#define sfree(x)   __sfree((void**)(void*)&(x))
 Safe free a pointer: belongs to a higher level header. More...
 

Typedefs

typedef union BlastOffsetPair BlastOffsetPair
 This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applications, as well as the option to submit searches to the test server in NCBI for remote BLAST searches #define _BLAST_DEBUG 1. More...
 
typedef struct SSeqRange SSeqRange
 A structure containing two integers, used e.g. More...
 
typedef struct BlastSeqLoc BlastSeqLoc
 Used to hold a set of positions, mostly used for filtering. More...
 
typedef struct BlastMaskLoc BlastMaskLoc
 Structure for keeping the query masking information. More...
 
typedef enum ESubjectMaskingType ESubjectMaskingType
 Define the possible subject masking types. More...
 
typedef struct BLAST_SequenceBlk BLAST_SequenceBlk
 Structure to hold a sequence. More...
 
typedef struct SPHIPatternInfo SPHIPatternInfo
 Information about a single pattern occurence in the query. More...
 
typedef struct SPHIQueryInfo SPHIQueryInfo
 In PHI BLAST, structure containing information about all pattern occurrences in query. More...
 
typedef struct SBlastTargetTranslation SBlastTargetTranslation
 Information about target translations. More...
 
typedef enum EBlastStage EBlastStage
 Enumeration for the stages in the BLAST search. More...
 
typedef struct SBlastProgress SBlastProgress
 Progress monitoring structure. More...
 
typedef Boolean(* TInterruptFnPtr) (SBlastProgress *progress_info)
 Prototype for function pointer to determine whether the BLAST search should proceed or be interrupted. More...
 

Enumerations

enum  ESubjectMaskingType { eNoSubjMasking , eSoftSubjMasking , eHardSubjMasking }
 Define the possible subject masking types. More...
 
enum  EBlastStage { eNone = 0x0 , ePrelimSearch = 0x1 << 0 , eTracebackSearch = 0x1 << 1 , eBoth = (ePrelimSearch | eTracebackSearch) }
 Enumeration for the stages in the BLAST search. More...
 

Functions

void __sfree (void **x)
 Implemented in blast_util.c. More...
 
SSeqRange SSeqRangeNew (Int4 start, Int4 stop)
 Create a new SSeqRange structure with both fields initialized. More...
 
static NCBI_INLINE Boolean SSeqRangeIntersectsWith (const SSeqRange *a, const SSeqRange *b)
 Determine if two ranges intersect. More...
 
Int4 SSeqRangeArrayLessThanOrEqual (const SSeqRange *ranges, Int4 num_ranges, Int4 target)
 Returns the index of the range, such that this element is the first range that either contains the target or if no such range exists, the index of the first range, such that the target is less than this range. More...
 
SBlastProgressSBlastProgressNew (void *user_data)
 Allocates and initializes a new SBlastProgress structure. More...
 
SBlastProgressSBlastProgressFree (SBlastProgress *progress_info)
 Deallocates a SBlastProgress structure. More...
 
void SBlastProgressReset (SBlastProgress *progress_info)
 Resets the progress structure to its original state (as if newly allocated) for a fresh start without touching the user_data field. More...
 

Variables

const int kDustLevel
 Level parameter used by dust. More...
 
const int kDustWindow
 Window parameter used by dust. More...
 
const int kDustLinker
 Parameter used by dust to link together close low-complexity segments. More...
 
const int kSegWindow
 Window that SEG examines at once. More...
 
const double kSegLocut
 Locut parameter for SEG. More...
 
const double kSegHicut
 Hicut parameter for SEG. More...
 
const int kUngappedHSPNumMax
 Maximum number of HPSs to be saved in an ungapped search. More...
 

Detailed Description

Definitions used throughout BLAST.

Definition in file blast_def.h.

Macro Definition Documentation

◆ BLAST_CMP

#define BLAST_CMP (   a,
  b 
)    ((a)>(b) ? 1 : ((a)<(b) ? -1 : 0))

A macro expression that returns 1, 0, -1 if a is greater than, equal to or less than b, respectively.

This macro evaluates its arguments more than once.

Definition at line 107 of file blast_def.h.

◆ CODON_LENGTH

#define CODON_LENGTH   3

Codons are always of length 3.

Definition at line 63 of file blast_def.h.

◆ COMPRESSION_RATIO

#define COMPRESSION_RATIO   4

Compression ratio of nucleotide bases (4 bases in 1 byte)

Definition at line 83 of file blast_def.h.

◆ DEFAULT_LONGEST_INTRON

#define DEFAULT_LONGEST_INTRON   122

For translated gapped searches, this is the default value in nucleotides of longest_intron (for ungapped translated searches, the default value of longest_intron is zero, which causes a legacy method of HSP linking that does not use longest_intron to be invoked).

The value 122 corresponds to 40 amino acids: 40 codons * 3 nucleotides per codon + up to 2 frame shifts. 40 amino acids is the maximum gap size in the untranslated sequence, so DEFAULT_LONGEST_INTRON makes these two gap sizes equal.

Definition at line 78 of file blast_def.h.

◆ GENCODE_STRLEN

#define GENCODE_STRLEN   64

Length of the genetic code string.

Definition at line 98 of file blast_def.h.

◆ NUM_FRAMES

#define NUM_FRAMES   6

Number of frames to which we translate in translating searches.

Definition at line 88 of file blast_def.h.

◆ NUM_STRANDS

#define NUM_STRANDS   2

Number of frames in a nucleotide sequence.

Definition at line 93 of file blast_def.h.

◆ sfree

#define sfree (   x)    __sfree((void**)(void*)&(x))

Safe free a pointer: belongs to a higher level header.

Definition at line 112 of file blast_def.h.

Typedef Documentation

◆ BLAST_SequenceBlk

Structure to hold a sequence.

◆ BlastMaskLoc

typedef struct BlastMaskLoc BlastMaskLoc

Structure for keeping the query masking information.

◆ BlastOffsetPair

This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applications, as well as the option to submit searches to the test server in NCBI for remote BLAST searches #define _BLAST_DEBUG 1.

Structure holding a pair of offsets. Used for storing offsets for the initial seeds. In most programs the offsets are query offset and subject offset of an initial word match. For PHI BLAST, the offsets are start and end of the pattern occurrence in subject, with no query information, because all pattern occurrences in subjects are aligned to all pattern occurrences in query.

◆ BlastSeqLoc

typedef struct BlastSeqLoc BlastSeqLoc

Used to hold a set of positions, mostly used for filtering.

oid holds the index of the query sequence.

◆ EBlastStage

typedef enum EBlastStage EBlastStage

Enumeration for the stages in the BLAST search.

◆ ESubjectMaskingType

Define the possible subject masking types.

◆ SBlastProgress

Progress monitoring structure.

This is updated by the engine to provided to the user as an argument to the user-supplied callback function (TInterruptFnPtr). This function then can assess whether the search should proceed or exit prematurely.

See also
TInterruptFnPtr

◆ SBlastTargetTranslation

Information about target translations.

◆ SPHIPatternInfo

Information about a single pattern occurence in the query.

◆ SPHIQueryInfo

typedef struct SPHIQueryInfo SPHIQueryInfo

In PHI BLAST, structure containing information about all pattern occurrences in query.

◆ SSeqRange

typedef struct SSeqRange SSeqRange

A structure containing two integers, used e.g.

for locations for the lookup table.

◆ TInterruptFnPtr

typedef Boolean(* TInterruptFnPtr) (SBlastProgress *progress_info)

Prototype for function pointer to determine whether the BLAST search should proceed or be interrupted.

If this function returns true, all processing must stop and the search must discard all interim results

Note
In order to avoid undue overhead, this function should not perform any time consuming operations and should always return (i.e.: it should never block)

Definition at line 354 of file blast_def.h.

Enumeration Type Documentation

◆ EBlastStage

Enumeration for the stages in the BLAST search.

Enumerator
eNone 

None specified.

ePrelimSearch 

Preliminary stage.

eTracebackSearch 

Traceback stage.

eBoth 

Both preliminary and traceback stages.

Definition at line 324 of file blast_def.h.

◆ ESubjectMaskingType

Define the possible subject masking types.

Enumerator
eNoSubjMasking 
eSoftSubjMasking 
eHardSubjMasking 

Definition at line 235 of file blast_def.h.

Function Documentation

◆ __sfree()

void __sfree ( void **  x)

Implemented in blast_util.c.

See also
sfree

Definition at line 40 of file blast_util.c.

References free(), and NULL.

◆ SBlastProgressFree()

SBlastProgress* SBlastProgressFree ( SBlastProgress progress_info)

Deallocates a SBlastProgress structure.

Implemented in blast_util.c

Definition at line 1397 of file blast_util.c.

References NULL, and sfree.

◆ SBlastProgressNew()

SBlastProgress* SBlastProgressNew ( void *  user_data)

Allocates and initializes a new SBlastProgress structure.

Parameters
user_datauser-provided data (not owned by the resulting structure) [in] Implemented in blast_util.c

Definition at line 1387 of file blast_util.c.

References calloc(), NULL, and SBlastProgress::user_data.

Referenced by CPrelimSearchThread::CPrelimSearchThread(), CBlastPrelimSearch::SetInterruptCallback(), and SplitQuery_CreateChunkData().

◆ SBlastProgressReset()

void SBlastProgressReset ( SBlastProgress progress_info)

Resets the progress structure to its original state (as if newly allocated) for a fresh start without touching the user_data field.

Definition at line 1406 of file blast_util.c.

References ePrelimSearch, and SBlastProgress::stage.

Referenced by CPrelimSearchRunner::operator()().

◆ SSeqRangeArrayLessThanOrEqual()

Int4 SSeqRangeArrayLessThanOrEqual ( const SSeqRange ranges,
Int4  num_ranges,
Int4  target 
)

Returns the index of the range, such that this element is the first range that either contains the target or if no such range exists, the index of the first range, such that the target is less than this range.

Precondition
ranges array is sorted on the starting coordinates (i.e.: SSeqRange::left)
Parameters
rangesarray of SSeqRange structures to search [in]
num_rangesnumber of elements in the ranges array [in]
targetelement to look for [in]
Returns
the index of interest in the ranges array or -1 if the function was called with invalid parameters

Definition at line 56 of file blast_util.c.

References b, and NULL.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SSeqRangeIntersectsWith()

static NCBI_INLINE Boolean SSeqRangeIntersectsWith ( const SSeqRange a,
const SSeqRange b 
)
static

Determine if two ranges intersect.

Parameters
afirst range to compare [in]
bsecond range to compare [in]
Returns
TRUE if they intersect, otherwise FALSE

Definition at line 173 of file blast_def.h.

References a, b, FALSE, and TRUE.

Referenced by BOOST_AUTO_TEST_CASE().

◆ SSeqRangeNew()

SSeqRange SSeqRangeNew ( Int4  start,
Int4  stop 
)

Create a new SSeqRange structure with both fields initialized.

Parameters
startthe start of the range [in]
stopthe end of the range [in]

Definition at line 47 of file blast_util.c.

References SSeqRange::left, and SSeqRange::right.

Referenced by BOOST_AUTO_TEST_CASE().

Variable Documentation

◆ kDustLevel

const int kDustLevel
extern

Level parameter used by dust.

Level parameter used by dust.

Definition at line 46 of file blast_options.c.

Referenced by BlastFilteringOptionsToString(), s_MergeDustOptions(), and SDustOptionsNew().

◆ kDustLinker

const int kDustLinker
extern

Parameter used by dust to link together close low-complexity segments.

Definition at line 48 of file blast_options.c.

Referenced by BlastFilteringOptionsToString(), s_MergeDustOptions(), and SDustOptionsNew().

◆ kDustWindow

const int kDustWindow
extern

Window parameter used by dust.

Definition at line 47 of file blast_options.c.

Referenced by BlastFilteringOptionsToString(), s_MergeDustOptions(), and SDustOptionsNew().

◆ kSegHicut

const double kSegHicut
extern

◆ kSegLocut

const double kSegLocut
extern

◆ kSegWindow

const int kSegWindow
extern

Window that SEG examines at once.

Window that SEG examines at once.

Definition at line 45 of file blast_seg.c.

Referenced by BlastFilteringOptionsToString(), SegMaskerApplication::Init(), s_MergeSegOptions(), SegParametersNewAa(), and SSegOptionsNew().

◆ kUngappedHSPNumMax

const int kUngappedHSPNumMax
extern

Maximum number of HPSs to be saved in an ungapped search.

Value defined in blast_options.c

Modified on Fri Sep 20 14:57:27 2024 by modify_doxy.py rev. 669887