DIAlign
|
Includes functions for the affine-alignment through a score-matrix using gap-opening and gap-closing penalties. More...
Functions | |
void | doAffineAlignment (AffineAlignObj &, const SimMatrix &s, double go, double ge, bool OverlapAlignment) |
Performs affine alignment on similarity-score matrix DIAlign::SimMatrix and fills M, A, B and corresponding Traceback matrices in AffineAlignObj. More... | |
void | getAffineAlignedIndices (AffineAlignObj &affineAlignObj, int bandwidth=0) |
Calculates aligned indices for source signal A and B, additionaly, builds an alignment path matrix with true-hot encoding. More... | |
double | getOlapAffineAlignStartIndices (double *MatrixM, double *MatrixA, double *MatrixB, int ROW_SIZE, int COL_SIZE, int &OlapStartRow, int &OlapStartCol, Traceback::tbJump &MatrixName) |
Calculates the start indices and matrix for the alignment path and returns associated score. More... | |
void | fillSimPath (bool *simPath, int bandwidth, int ROW_IDX, int COL_IDX, int ROW_SIZE, int COL_SIZE) |
Not needed will be removed. | |
double | getForwardSim (const SimMatrix &s, bool *simPath) |
Not needed will be removed. | |
Includes functions for the affine-alignment through a score-matrix using gap-opening and gap-closing penalties.
void DIAlign::AffineAlignment::doAffineAlignment | ( | AffineAlignObj & | , |
const SimMatrix & | s, | ||
double | go, | ||
double | ge, | ||
bool | OverlapAlignment | ||
) |
Performs affine alignment on similarity-score matrix DIAlign::SimMatrix and fills M, A, B and corresponding Traceback matrices in AffineAlignObj.
Affine alignment uses gap-opening and gap-extension penalties to control number of consecutive gaps. It uses three cumulative score matrices M, A and B. At start, the first row and column of these matrices are initialized. Afterward, remaining cells of the matrices are filled using method described in [Paste the link to the main page with equations.] As cumulative score is calculated for each cell, movement is captured in Traceback with its direction (Top, Left, Diagonal) and the source matrix (M, A, B).
affineAlignObj | An object of class AffineAlignObj. It must be initialized with appropriate ROW_SIZE and COL_SIZE. |
s | similarity score matrix must be of size (ROW_SIZE - 1) * (COL_SIZE - 1). |
go | gap opening penalty in alignment path. |
ge | gap extension penalty in alignment path. |
OverlapAlignment | If true, end gaps are not penalized. For a global-alignment, OverlapAlignment is set false which penalizes end-gaps as regular gaps. |
void DIAlign::AffineAlignment::getAffineAlignedIndices | ( | AffineAlignObj & | affineAlignObj, |
int | bandwidth = 0 |
||
) |
Calculates aligned indices for source signal A and B, additionaly, builds an alignment path matrix with true-hot encoding.
For finding the alignment path it uses cumulative scores and Traceback matrices. For non-overlap alignment, cell with the highest score is identified across rightmost cells of M, A and B. For overlap alignment, last column and row of the matrices are searched for the highest score cell. After identifying highest-score cell, Traceback is used to find the path. Simultaneously, number of gaps are calculated and path matrix is filled with true-hot encoding.
affineAlignObj | An object of class AffineAlignObj. Must have been operated by doAffineAlignment() function before. |
bandwidth | Not needed. Will be removed. |
Overlap Alignment
Maximum score and corresponding indices along the last column and last row is searched across all three matrices. Matrix name and maximum score indices are passed by reference.
double DIAlign::AffineAlignment::getOlapAffineAlignStartIndices | ( | double * | MatrixM, |
double * | MatrixA, | ||
double * | MatrixB, | ||
int | ROW_SIZE, | ||
int | COL_SIZE, | ||
int & | OlapStartRow, | ||
int & | OlapStartCol, | ||
Traceback::tbJump & | MatrixName | ||
) |
Calculates the start indices and matrix for the alignment path and returns associated score.
Initially, the maximum score is searched along the last row and column of the three matrices. The highest-scoring cell is passed-by-reference.
MatrixM | pointer for matrix of type AffineAlignObj::M. |
MatrixA | pointer for matrix of type AffineAlignObj::A. |
MatrixB | pointer for matrix of type AffineAlignObj::B. |
ROW_SIZE | number of rows in each matrix. |
COL_SIZE | number of columns in each matrix. |
OlapStartRow | row-index of the start-cell. |
OlapStartCol | column-index of the start-cell. |
MatrixName | Name of the matrix from which start-cell is selected. |