NCBI C++ ToolKit
Functions | Variables
pattern_priv.h File Reference

Auxiliary functions for finding pattern matches in sequence (PHI-BLAST), that are used in multiple source files. More...

#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/pattern.h>
+ Include dependency graph for pattern_priv.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.

Functions

Int4 _PHIBlastFindHitsShort (Int4 *hitArray, const Uint1 *seq, Int4 len1, const SPHIPatternSearchBlk *pattern_blk)
 Routine to find hits of pattern to sequence when sequence is proteins. More...
 
void _PHIPatternWordsLeftShift (Int4 *a, Uint1 b, Int4 numWords)
 Shift each word in the array left by 1 bit and add bit b. More...
 
void _PHIPatternWordsBitwiseOr (Int4 *a, Int4 *b, Int4 numWords)
 Do a word-by-word bit-wise or of two integer arrays and put the result back in the first array. More...
 
Int4 _PHIPatternWordsBitwiseAnd (Int4 *result, Int4 *a, Int4 *b, Int4 numWords)
 Do a word-by-word bit-wise and of two integer arrays and put the result in a new array. More...
 
void _PHIGetRightOneBits (Int4 s, Int4 mask, Int4 *rightOne, Int4 *rightMaskOnly)
 Looks for 1 bits in the same position of s and mask Let R be the rightmost position where s and mask both have a 1. More...
 

Variables

const int kMaskAaAlphabetBits
 Masks all bits corresponding to the aminoacid alphabet, i.e. More...
 

Detailed Description

Auxiliary functions for finding pattern matches in sequence (PHI-BLAST), that are used in multiple source files.

Definition in file pattern_priv.h.

Function Documentation

◆ _PHIBlastFindHitsShort()

Int4 _PHIBlastFindHitsShort ( Int4 hitArray,
const Uint1 seq,
Int4  len1,
const SPHIPatternSearchBlk pattern_blk 
)

Routine to find hits of pattern to sequence when sequence is proteins.

Parameters
hitArrayAn array of matches to pass back [out]
seqThe input sequence [in]
len1Length of the input sequence. [in]
pattern_blkCarries variables that keep track of search parameters. [in]
Returns
the number of matches found.

Definition at line 104 of file pattern.c.

References i, mask, SShortPatternItems::match_mask, SPHIPatternSearchBlk::one_word_items, PHI_MAX_HIT, s_LenOf(), and SShortPatternItems::whichPositionPtr.

Referenced by s_FindHitsShortHead(), and s_PHIGetExtraLongPattern().

◆ _PHIGetRightOneBits()

void _PHIGetRightOneBits ( Int4  s,
Int4  mask,
Int4 rightOne,
Int4 rightMaskOnly 
)

Looks for 1 bits in the same position of s and mask Let R be the rightmost position where s and mask both have a 1.

Let L < R be the rightmost position where mask has a 1, if any, or -1 otherwise.

Parameters
sNumber to check bits in [in]
maskMask to apply [in]
rightOneThe rightmost position where s and mask both have a 1 [out]
rightMaskOnlyThe rightmost position < rightOne, where mask has a 1, if any, or -1 otherwise [out]

Definition at line 61 of file pattern.c.

References mask, and PHI_BITS_PACKED_PER_WORD.

Referenced by s_LenOf(), and s_PHIGetShortPattern().

◆ _PHIPatternWordsBitwiseAnd()

Int4 _PHIPatternWordsBitwiseAnd ( Int4 result,
Int4 a,
Int4 b,
Int4  numWords 
)

Do a word-by-word bit-wise and of two integer arrays and put the result in a new array.

Parameters
resultResult of the operation [out]
aFirst array [in]
bSecond array [in]
numWordsSize of the two input arrays [in]
Returns
1 if there are any non-zero words, otherwize 0.

Definition at line 265 of file pattern.c.

References a, b, i, and result.

Referenced by s_FindHitsLong(), and s_PHIGetLongPattern().

◆ _PHIPatternWordsBitwiseOr()

void _PHIPatternWordsBitwiseOr ( Int4 a,
Int4 b,
Int4  numWords 
)

Do a word-by-word bit-wise or of two integer arrays and put the result back in the first array.

Parameters
aFirst array [in] [out]
bSecond array [in]
numWordsNumber of words in a and b [in]

Definition at line 257 of file pattern.c.

References a, b, and i.

Referenced by s_FindHitsLong(), and s_PHIGetLongPattern().

◆ _PHIPatternWordsLeftShift()

void _PHIPatternWordsLeftShift ( Int4 a,
Uint1  b,
Int4  numWords 
)

Shift each word in the array left by 1 bit and add bit b.

If the new values is bigger than an overflow threshold, then subtract the overflow threshold.

Parameters
aArray of integers, representing words in a pattern [in] [out]
bbit to add [in]
numWordsNumber of words to process [in]

Definition at line 236 of file pattern.c.

References a, b, i, and PHI_BITS_PACKED_PER_WORD.

Referenced by s_FindHitsLong(), and s_PHIGetLongPattern().

Variable Documentation

◆ kMaskAaAlphabetBits

const int kMaskAaAlphabetBits
extern

Masks all bits corresponding to the aminoacid alphabet, i.e.

the first 26 bits of an integer number.

Definition at line 41 of file phi_lookup.c.

Referenced by s_ExpandPattern(), s_PHIBlastAlignPatterns(), and SPHIPatternSearchBlkNew().

Modified on Wed May 22 11:29:16 2024 by modify_doxy.py rev. 669887