QueryManager/MatchAligner.h File Reference

#include "MatchStore.h"
#include "SequenceEncoder.h"
#include <cassert>

Include dependency graph for MatchAligner.h:

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

Go to the source code of this file.

Classes

class  MatchTaskAlign
struct  AlignInfo
struct  Alignment
class  StaticScoreTable
class  MatchAligner
class  MatchAlignerDNA
class  MatchAlignerProtein
class  MatchAlignerTranslated
class  MatchAlignerTranslatedProtein
class  MatchAlignerTranslatedDNA
class  PathMatrix< PATH_TYPE >
class  ScoreMaker
class  CellFiller
class  ColumnFillerBasic
class  TraceBackerBasic
class  Array2D< T >
class  Array3D< T >
class  CellFiller3D
class  ColumnFiller3D
class  TraceBacker3D

Typedefs

typedef unsigned char uchar
typedef unsigned char AlignBreakType
typedef int ScoreType
typedef ScoreType ScoreTable [65536]
typedef unsigned char PathType
typedef Array3D< ScoreTypeScoreType3D
typedef Array3D< PathTypePathType3D

Functions

void makeScoreTableDNA (ScoreTable &table)
void makeScoreTableBlosum62 (ScoreTable &table)

Variables

const AlignBreakType alignBreakNull = 0
const AlignBreakType alignBreakMismatch = 1
const AlignBreakType alignBreakGapQuery = 2
const AlignBreakType alignBreakGapSubject = 3
const AlignBreakType alignBreakFrameShiftQuery = 4
const AlignBreakType alignBreakFrameShiftSubject = 5
const ScoreType matchScoreDNA = 1
const ScoreType mismatchScoreDNA = -2
const ScoreType gapStartScoreDNA = -4
const ScoreType gapExtendScoreDNA = -3
const ScoreType nScoreDNA = 0
const ScoreType veryBadScoreIndeed = -1000000000
const ScoreType stopCodonScoreBLOSUM = -4
const ScoreType gapStartScoreBLOSUM = -16
const ScoreType gapExtendScoreBLOSUM = -1
const ScoreType frameShiftScoreBLOSUM = -5
const PathType fromN = (PathType)0x1
const PathType fromW = (PathType)0x2
const PathType fromSW = (PathType)0x4
const PathType fromPrevFrame1 = (PathType)0x8
const PathType fromPrevFrame2 = (PathType)0x10
const PathType fromFinished = (PathType)0x20
static const char blosumResidues [] = "ARNDCQEGHILKMFPSTWYVBZX"
static const ScoreType blosumScores []
static const int numBlosumResidues = 23
const Array2D< ScoreTypeveryBadScore2D (veryBadScoreIndeed, veryBadScoreIndeed, veryBadScoreIndeed)
const Array3D< ScoreTypeveryBadScore3D (veryBadScore2D, veryBadScore2D, veryBadScore2D)


Typedef Documentation

typedef unsigned char AlignBreakType

Definition at line 50 of file MatchAligner.h.

typedef unsigned char PathType

Definition at line 95 of file MatchAligner.h.

typedef Array3D<PathType> PathType3D

Definition at line 723 of file MatchAligner.h.

typedef ScoreType ScoreTable[65536]

Definition at line 60 of file MatchAligner.h.

typedef int ScoreType

Definition at line 59 of file MatchAligner.h.

typedef Array3D<ScoreType> ScoreType3D

Definition at line 722 of file MatchAligner.h.

typedef unsigned char uchar

Definition at line 48 of file MatchAligner.h.


Function Documentation

void makeScoreTableBlosum62 ( ScoreTable table  ) 

Definition at line 461 of file MatchAligner.cpp.

References blosumResidues, blosumScores, gapExtendScoreBLOSUM, gapStartScoreBLOSUM, numBlosumResidues, and stopCodonScoreBLOSUM.

00462 {
00463 
00464   uchar a[2];
00465   unsigned short* b = (unsigned short*) &a[0];
00466 
00467   const ScoreType* pScore = blosumScores;
00468 
00469 
00470   for (int i(0); i < numBlosumResidues; i++ )
00471   {
00472     for (int j(0); j < i; j++ )
00473     {
00474       //      cout << i << " " << j << endl; 
00475 
00476       // a[0] = uc, a[1] = uc
00477       a[0]=blosumResidues[i]; a[1]=blosumResidues[j]; table[ *b ] = *pScore;
00478       //      cout << a[0] << a[1] << " " table[ *b ] << endl;
00479       // a[0] = uc, a[1] = lc
00480       a[1]=tolower(a[1]); table[ *b ] = *pScore;
00481       // a[0] = lc, a[1] = lc
00482       a[0]=tolower(a[0]); table[ *b ] = *pScore;
00483       // a[0] = lc, a[1] = uc
00484       a[1]=toupper(a[1]); table[ *b ] = *pScore;
00485 
00486       a[0]=blosumResidues[j]; a[1]=blosumResidues[i]; table[ *b ] = *pScore;
00487       a[1]=tolower(a[1]); table[ *b ] = *pScore;
00488       a[0]=tolower(a[0]); table[ *b ] = *pScore;
00489       a[1]=toupper(a[1]); table[ *b ] = *pScore;
00490      
00491       ++pScore;
00492     } // ~for j
00493 
00494     a[0] = blosumResidues[i];
00495     a[1] = blosumResidues[i]; table[ *b ] = (*pScore); // a0=uc, a1=uc
00496     a[1] = tolower(a[1]); table[ *b ] = (*pScore);  // a0=uc, a1=lc
00497     a[1] = '*'; table[ *b ] = stopCodonScoreBLOSUM; // a0=uc, a1=*
00498     a[1] = '-'; table[ *b ] = gapStartScoreBLOSUM;  // a0=uc, a1=-
00499 
00500     a[0] = tolower(a[0]); 
00501     a[1] = blosumResidues[i]; table[ *b ] = (*pScore); // a0=lc, a1=uc
00502     a[1] = tolower(a[1]); table[ *b ] = (*pScore);  // a0=lc, a1=lc
00503     a[1] = '*'; table[ *b ] = stopCodonScoreBLOSUM; // a0=lc, a1=*
00504     a[1] = '-'; table[ *b ] = gapStartScoreBLOSUM;  // a0=lc, a1=-
00505 
00506     a[1] = blosumResidues[i];
00507     a[0] = '*'; table[ *b ] = stopCodonScoreBLOSUM; // a0=*, a1=uc
00508     a[0] = '-'; table[ *b ] = gapStartScoreBLOSUM;  // a0=-, a1=uc
00509 
00510     a[1] = tolower(a[1]);
00511     a[0] = '*'; table[ *b ] = stopCodonScoreBLOSUM; // a0=*, a1=lc
00512     a[0] = '-'; table[ *b ] = gapStartScoreBLOSUM;  // a0=-, a1=lc
00513 
00514     ++pScore;
00515   } // ~for i
00516 
00517   a[0] = '*'; a[1] = '*'; table[ *b ] = 1;
00518   a[0] = '*'; a[1] = '-'; table[ *b ] = gapStartScoreBLOSUM;
00519   a[0] = '-'; a[1] = '*'; table[ *b ] = gapStartScoreBLOSUM;
00520   a[0] = '-'; a[1] = '-'; table[ *b ] = gapExtendScoreBLOSUM;
00521 
00522 } // ~void makeScoreTableBlosum62( ScoreTable& table )

void makeScoreTableDNA ( ScoreTable table  ) 

Definition at line 401 of file MatchAligner.cpp.

References gapExtendScoreDNA, gapStartScoreDNA, matchScoreDNA, mismatchScoreDNA, and nScoreDNA.

00402 {
00403 
00404   uchar a[2];
00405   unsigned short* b = (unsigned short*) &a[0];
00406   //  a[0]=0; a[1]=0;
00407 
00408   const char base[] = {"agct"};
00409 
00410   ScoreType thisScore;
00411   for (int i(0); i < 4; i++ )
00412   {
00413     for (int j(0); j < 4; j++ )
00414     {
00415       thisScore = ((i==j) ? matchScoreDNA: mismatchScoreDNA);
00416       a[0]=base[i]; a[1] = base[j]; table[ *b ] = thisScore;
00417       a[1] = toupper(base[j]); table[ *b ] = thisScore;
00418       a[0]=toupper(base[i]); a[1] = base[j]; table[ *b ] = thisScore;
00419       a[1] = toupper(base[j]); table[ *b ] = thisScore;
00420     } // ~for j
00421 
00422     a[0]=base[i];  
00423     a[1] = 'n'; table[ *b ] = nScoreDNA;
00424     a[1] = 'N'; table[ *b ] = nScoreDNA;
00425     a[1] = '-'; table[ *b ] = gapStartScoreDNA;
00426 
00427     a[0]=toupper(base[i]);  
00428     a[1] = 'n'; table[ *b ] = nScoreDNA;
00429     a[1] = 'N'; table[ *b ] = nScoreDNA;
00430     a[1] = '-'; table[ *b ] = gapStartScoreDNA;
00431 
00432     a[1]=base[i];  
00433     a[0] = 'n'; table[ *b ] = nScoreDNA;
00434     a[0] = 'N'; table[ *b ] = nScoreDNA;
00435     a[0] = '-'; table[ *b ] = gapStartScoreDNA;
00436 
00437     a[1]=toupper(base[i]);  
00438     a[0] = 'n'; table[ *b ] = nScoreDNA;
00439     a[0] = 'N'; table[ *b ] = nScoreDNA;
00440     a[0] = '-'; table[ *b ] = gapStartScoreDNA;
00441     
00442 
00443 
00444   } // ~for i;
00445 
00446     a[0]='n'; a[1] = 'n'; table[ *b ] = nScoreDNA;
00447     a[0]='n'; a[1] = 'N'; table[ *b ] = nScoreDNA;
00448     a[0]='N'; a[1] = 'n'; table[ *b ] = nScoreDNA;
00449     a[0]='N'; a[1] = 'N'; table[ *b ] = nScoreDNA;
00450 
00451     a[0]='-'; a[1] = 'n'; table[ *b ] = gapStartScoreDNA;
00452     a[0]='-'; a[1] = 'N'; table[ *b ] = gapStartScoreDNA;
00453     a[0]='n'; a[1] = '-'; table[ *b ] = gapStartScoreDNA;
00454     a[0]='N'; a[1] = '-'; table[ *b ] = gapStartScoreDNA;
00455 
00456     a[0]='-'; a[1] = '-'; table[ *b ] = gapExtendScoreDNA;
00457 
00458 } // ~void makeScoreTableDNA( ScoreTable& table )


Variable Documentation

const AlignBreakType alignBreakFrameShiftQuery = 4

Definition at line 56 of file MatchAligner.h.

Referenced by MatchAlignerTranslatedDNA::formatAlignment(), and MatchAlignerTranslatedProtein::formatAlignment().

const AlignBreakType alignBreakFrameShiftSubject = 5

Definition at line 57 of file MatchAligner.h.

Referenced by MatchAlignerTranslatedDNA::formatAlignment(), and MatchAlignerTranslatedProtein::formatAlignment().

const AlignBreakType alignBreakGapQuery = 2

Definition at line 54 of file MatchAligner.h.

Referenced by MatchAligner::createAlignment(), MatchAlignerTranslatedProtein::formatAlignment(), and MatchAligner::formatAlignment().

const AlignBreakType alignBreakGapSubject = 3

Definition at line 55 of file MatchAligner.h.

Referenced by MatchAligner::createAlignment(), MatchAlignerTranslatedProtein::formatAlignment(), and MatchAligner::formatAlignment().

const AlignBreakType alignBreakMismatch = 1

Definition at line 53 of file MatchAligner.h.

Referenced by MatchAlignerTranslatedDNA::formatAlignment(), MatchAlignerTranslatedProtein::formatAlignment(), and MatchAligner::formatAlignment().

const AlignBreakType alignBreakNull = 0

Definition at line 52 of file MatchAligner.h.

Referenced by TraceBacker3D::operator()(), and TraceBackerBasic::operator()().

const char blosumResidues[] = "ARNDCQEGHILKMFPSTWYVBZX" [static]

Definition at line 429 of file MatchAligner.h.

Referenced by makeScoreTableBlosum62().

const ScoreType blosumScores[] [static]

Initial value:

{
4, 
-1, 5, 
-2, 0, 6, 
-2, -2, 1, 6, 
0, -3, -3, -3, 9,
-1, 1, 0, 0, -3, 5,
-1, 0, 0, 2, -4, 2, 5,
0, -2, 0, -1, -3, -2, -2, 6, 
-2, 0, 1, -1, -3, 0, 0, -2, 8, 
-1, -3, -3, -3, -1, -3, -3, -4, -3, 4, 
-1, -2, -3, -4, -1, -2, -3, -4, -3, 2, 4, 
-1, 2, 0, -1, -3, 1, 1, -2, -1, -3, -2, 5, 
-1, -1, -2, -3, -1, 0, -2, -3, -2, 1, 2, -1, 5, 
-2, -3, -3, -3, -2, -3, -3, -3, -1, 0, 0, -3, 0, 6, 
-1, -2, -2, -1, -3, -1, -1, -2, -2, -3, -3, -1, -2, -4, 7, 
1, -1, 1, 0, -1, 0, 0, 0, -1, -2, -2, 0, -1, -2, -1, 4, 
0, -1, 0, -1, -1, -1, -1, -2, -2, -1, -1, -1, -1, -2, -1, 1, 5, 
-3, -3, -4, -4, -2, -2, -3, -2, -2, -3, -2, -3, -1, 1, -4, -3, -2, 11, 
-2, -2, -2, -3, -2, -1, -2, -3, 2, -1, -1, -2, -1, 3, -3, -2, -2, 2, 7,
0, -3, -3, -3, -1, -2, -2, -3, -3, 3, 1, -2, 1, -1, -2, -2, 0, -3, -1, 4,
-2, -1, 3, 4, -3, 0, 1, -1, 0, -3, -4, 0, -3, -3, -2, 0, -1, -4, -3, -3, 4,
-1, 0, 0, 1, -3, 3, 4, -2, 0, -3, -3, 1, -1, -3, -1, 0, -1, -3, -2, -2, 1, 4, 
0, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, 0, 0, -2, -1, -1, -1, -1, -1 
}

Definition at line 432 of file MatchAligner.h.

Referenced by makeScoreTableBlosum62().

const ScoreType frameShiftScoreBLOSUM = -5

Definition at line 86 of file MatchAligner.h.

Referenced by ColumnFiller3D::fillCell3D().

const PathType fromFinished = (PathType)0x20

Definition at line 101 of file MatchAligner.h.

Referenced by TraceBacker3D::operator()(), TraceBackerBasic::operator()(), and ColumnFillerBasic::operator()().

const PathType fromN = (PathType)0x1

Definition at line 96 of file MatchAligner.h.

Referenced by CellFiller3D::operator()(), CellFiller::operator()(), TraceBacker3D::operator()(), TraceBackerBasic::operator()(), and print().

const PathType fromPrevFrame1 = (PathType)0x8

Definition at line 99 of file MatchAligner.h.

Referenced by CellFiller3D::operator()(), and TraceBacker3D::operator()().

const PathType fromPrevFrame2 = (PathType)0x10

Definition at line 100 of file MatchAligner.h.

Referenced by CellFiller3D::operator()(), and TraceBacker3D::operator()().

const PathType fromSW = (PathType)0x4

Definition at line 98 of file MatchAligner.h.

Referenced by CellFiller3D::operator()(), CellFiller::operator()(), TraceBacker3D::operator()(), TraceBackerBasic::operator()(), and print().

const PathType fromW = (PathType)0x2

Definition at line 97 of file MatchAligner.h.

Referenced by CellFiller3D::operator()(), CellFiller::operator()(), TraceBacker3D::operator()(), TraceBackerBasic::operator()(), and print().

const ScoreType gapExtendScoreBLOSUM = -1

Definition at line 73 of file MatchAligner.h.

Referenced by makeScoreTableBlosum62().

const ScoreType gapExtendScoreDNA = -3

Definition at line 65 of file MatchAligner.h.

Referenced by makeScoreTableDNA().

const ScoreType gapStartScoreBLOSUM = -16

Definition at line 72 of file MatchAligner.h.

Referenced by ColumnFiller3D::fillCell3D(), and makeScoreTableBlosum62().

const ScoreType gapStartScoreDNA = -4

Definition at line 64 of file MatchAligner.h.

Referenced by makeScoreTableDNA().

const ScoreType matchScoreDNA = 1

Definition at line 62 of file MatchAligner.h.

Referenced by makeScoreTableDNA().

const ScoreType mismatchScoreDNA = -2

Definition at line 63 of file MatchAligner.h.

Referenced by makeScoreTableDNA().

const ScoreType nScoreDNA = 0

Definition at line 66 of file MatchAligner.h.

Referenced by makeScoreTableDNA().

const int numBlosumResidues = 23 [static]

Definition at line 459 of file MatchAligner.h.

Referenced by makeScoreTableBlosum62().

const ScoreType stopCodonScoreBLOSUM = -4

Definition at line 71 of file MatchAligner.h.

Referenced by makeScoreTableBlosum62().

const Array2D<ScoreType> veryBadScore2D(veryBadScoreIndeed, veryBadScoreIndeed, veryBadScoreIndeed)

const Array3D<ScoreType> veryBadScore3D(veryBadScore2D, veryBadScore2D, veryBadScore2D)

const ScoreType veryBadScoreIndeed = -1000000000

Definition at line 67 of file MatchAligner.h.

Referenced by ColumnFiller3D::getScorePrevFrame1(), ColumnFiller3D::getScorePrevFrame2(), and ColumnFillerBasic::operator()().


Generated on Fri Dec 21 13:14:14 2007 for ssaha by  doxygen 1.5.2