include/hitMatrix.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void hitMatrix_initialize (int4 queryLength, int4 maximumSubjectLength, unsigned char *startAddress)
void hitMatrix_reinitialize (int4 queryLength, int4 maximumSubjectLength, unsigned char *startAddress)
void hitMatrix_free ()

Variables

unsigned char ** hitMatrix_furthest
int4 hitMatrix_queryLength
uint4 hitMatrix_diagonalMask


Function Documentation

void hitMatrix_free (  ) 

Definition at line 101 of file hitMatrix.c.

References encoding_alphabetType, encoding_protein, hitMatrix_furthest, and hitMatrix_queryLength.

Referenced by blast_search().

Here is the caller graph for this function:

void hitMatrix_initialize ( int4  queryLength,
int4  maximumSubjectLength,
unsigned char *  startAddress 
)

Definition at line 13 of file hitMatrix.c.

References encoding_alphabetType, encoding_nucleotide, global_malloc(), hitMatrix_diagonalMask, hitMatrix_furthest, hitMatrix_queryLength, int4, and parameters_wordSize.

Referenced by blast_search().

00014 {
00015         int4 numDiagonals;
00016         unsigned char **minOffset, **offset, **maxOffset;
00017 
00018     // Use more memory efficient but slower hit matrix for nucleotide
00019     if (encoding_alphabetType == encoding_nucleotide)
00020     {
00021         // Calculate number of diagonals that will be required during search
00022         numDiagonals = 1;
00023         while (numDiagonals < queryLength + parameters_wordSize)
00024         {
00025             numDiagonals <<= 1;
00026         }
00027 
00028         // Construct mask
00029         hitMatrix_diagonalMask = numDiagonals - 1;
00030 
00031         // Declare memory for diagonal slots
00032         hitMatrix_furthest = (unsigned char**)global_malloc(sizeof(unsigned char*) * numDiagonals);
00033         minOffset = hitMatrix_furthest;
00034         }
00035     // Use less memory efficient but faster hit matrix for protein
00036     else
00037     {
00038         // Maximum number of diagonals that will be required during search
00039         numDiagonals = queryLength + maximumSubjectLength - parameters_wordSize + 1;
00040         minOffset = (unsigned char**)global_malloc(sizeof(unsigned char*) * numDiagonals);
00041 
00042         // Advance array pointer to allow offset values ranging from
00043         // -queryLength to subjectLength - wordSize
00044         hitMatrix_furthest = minOffset + queryLength;
00045     }
00046 
00047         // Record query length
00048         hitMatrix_queryLength = queryLength;
00049 
00050         // Start from smallest possible offset value and iterate through to largest
00051         offset = minOffset;
00052         maxOffset = minOffset + numDiagonals;
00053 
00054         // For each diagonal, reset furthest to address at start of file
00055         while (offset < maxOffset)
00056         {
00057                 *offset = startAddress;
00058                 offset++;
00059         }
00060 }

Here is the call graph for this function:

Here is the caller graph for this function:

void hitMatrix_reinitialize ( int4  queryLength,
int4  maximumSubjectLength,
unsigned char *  startAddress 
)

Definition at line 63 of file hitMatrix.c.

References encoding_alphabetType, encoding_nucleotide, hitMatrix_furthest, int4, and parameters_wordSize.

Referenced by alignments_expandCluster(), and blast_search().

00064 {
00065         int4 numDiagonals;
00066         unsigned char **minOffset, **offset, **maxOffset;
00067 
00068     if (encoding_alphabetType == encoding_nucleotide)
00069     {
00070         // Calculate number of diagonals that will be required during search
00071         numDiagonals = 1;
00072         while (numDiagonals < queryLength + parameters_wordSize)
00073         {
00074             numDiagonals <<= 1;
00075         }
00076 
00077         minOffset = hitMatrix_furthest;
00078         }
00079     // Use less memory efficient but faster hit matrix for protein
00080     else
00081     {
00082         // Maximum number of diagonals that will be required during search
00083         numDiagonals = queryLength + maximumSubjectLength - parameters_wordSize + 1;
00084 
00085         minOffset = hitMatrix_furthest - queryLength;
00086     }
00087 
00088         // Start from smallest possible offset value and iterate through to largest
00089         offset = minOffset;
00090         maxOffset = minOffset + numDiagonals;
00091 
00092         // For each diagonal, reset furthest to address at start of file
00093         while (offset < maxOffset)
00094         {
00095                 *offset = startAddress;
00096                 offset++;
00097         }
00098 }

Here is the caller graph for this function:


Variable Documentation

uint4 hitMatrix_diagonalMask

Definition at line 6 of file hitMatrix.h.

Referenced by hitMatrix_initialize(), search_nucleotide(), search_nucleotide_largeTable(), and search_nucleotide_longWord().

unsigned char** hitMatrix_furthest

Definition at line 4 of file hitMatrix.h.

Referenced by hitMatrix_free(), hitMatrix_initialize(), hitMatrix_reinitialize(), search_nucleotide(), search_nucleotide_largeTable(), search_nucleotide_longWord(), search_protein1hit(), and search_protein2hit().

int4 hitMatrix_queryLength

Definition at line 5 of file hitMatrix.h.

Referenced by hitMatrix_free(), hitMatrix_initialize(), search_nucleotide(), search_nucleotide_largeTable(), and search_nucleotide_longWord().


Generated on Wed Dec 19 20:49:34 2007 for fsa-blast by  doxygen 1.5.2