Interface ScoringMatrix
-
- All Known Implementing Classes:
ScoringMatrixImpl
public interface ScoringMatrixRepresentation of the scoring matrix of an dp algorithm.
-
-
Field Summary
Fields Modifier and Type Field Description static intDIAGONALstatic intHORIZONTALstatic intNO_STEPstatic intVERTICAL
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MatrixPathbacktrackFrom(int queryIdx, int caseIdx)Create the alignment path of this scoring matrix.MatrixPathbacktrackFrom(MatrixPath.MatrixCellPair cell)Create the alignment path of this scoring matrix.doubleget(int queryIdx, int caseIdx)Get the value of a cell.doubleget(MatrixPath.MatrixCellPair pair)Get the value of a cell.doublegetHighestScore()Get the highest score in the last row of the matrix.MatrixPath.MatrixCellPairgetPair(int queryIdx, int caseIdx)Get the NESTTaskPair object at the specified position.MatrixPath.MatrixCellPairgetSourceOf(int queryIdx, int caseIdx)Get the source of a cell.intgetSourceStepOf(int queryIdx, int caseIdx)Get the source step of a cell.MatrixPath.MatrixCellPairgetStartCell(boolean onlyLastRow)Get the start cell of the alignment path.voidinitialize()Initialize the first row and first column to value zero.booleanisInBounds(int queryIdx, int caseIdx)Whether or not the indices are in bounds.voidset(int queryIdx, int caseIdx, int stepToSource, double value)Set a cell of the matrix to a given value and also provide the direction to the source cell.voidset(int queryIdx, int caseIdx, MatrixPath.MatrixCellPair source, double value)Set a cell of the matrix to a given value and also provide a reference to the source cell.voidset(MatrixPath.MatrixCellPair pair)Set a cell of the matrix to the given pair.
-
-
-
Field Detail
-
DIAGONAL
static final int DIAGONAL
- See Also:
- Constant Field Values
-
VERTICAL
static final int VERTICAL
- See Also:
- Constant Field Values
-
HORIZONTAL
static final int HORIZONTAL
- See Also:
- Constant Field Values
-
NO_STEP
static final int NO_STEP
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
void initialize()
Initialize the first row and first column to value zero.
-
set
void set(int queryIdx, int caseIdx, int stepToSource, double value)Set a cell of the matrix to a given value and also provide the direction to the source cell.- Parameters:
queryIdx- Index of the query task to set.caseIdx- Index of the case task to set.stepToSource- Either DIAGONAL, VERTICAL or HORIZONTAL.value- The value to set this cell to.
-
set
void set(int queryIdx, int caseIdx, MatrixPath.MatrixCellPair source, double value)Set a cell of the matrix to a given value and also provide a reference to the source cell.- Parameters:
queryIdx- Index of the query task to set.caseIdx- Index of the case task to set.source- The source cell.value- The value to set this cell to.
-
set
void set(MatrixPath.MatrixCellPair pair)
Set a cell of the matrix to the given pair.- Parameters:
pair- The new cell entry containing also the indices.
-
get
double get(int queryIdx, int caseIdx)Get the value of a cell.- Parameters:
queryIdx- The query task index.caseIdx- The case task index.- Returns:
- The value at the given position.
-
get
double get(MatrixPath.MatrixCellPair pair)
Get the value of a cell.- Parameters:
pair- Specifies the cell's position in the matrix.- Returns:
- The value at the given position.
-
getPair
MatrixPath.MatrixCellPair getPair(int queryIdx, int caseIdx)
Get the NESTTaskPair object at the specified position.- Parameters:
queryIdx-caseIdx-- Returns:
-
getSourceOf
MatrixPath.MatrixCellPair getSourceOf(int queryIdx, int caseIdx)
Get the source of a cell.- Parameters:
queryIdx- The query task index of the cell.caseIdx- The case task index of the dell.- Returns:
- A pair representing the source cell.
-
getSourceStepOf
int getSourceStepOf(int queryIdx, int caseIdx)Get the source step of a cell.- Parameters:
queryIdx- The query task index of the cell.caseIdx- The case task index of the dell.- Returns:
- Either DIAGONAL, VERTICAL or HORIZONTAL.
-
getHighestScore
double getHighestScore()
Get the highest score in the last row of the matrix.- Returns:
- The score.
-
getStartCell
MatrixPath.MatrixCellPair getStartCell(boolean onlyLastRow)
Get the start cell of the alignment path. Always returns the cell with the highest value in the last row of the matrix.- Parameters:
onlyLastRow- Depicts whether only to search in last row of matrix.- Returns:
- A pair representing the start cell.
-
backtrackFrom
MatrixPath backtrackFrom(MatrixPath.MatrixCellPair cell)
Create the alignment path of this scoring matrix. Backtracks to a cell of value 0 (not included).- Parameters:
cell- The cell to start the backtrack from.- Returns:
- The found path.
-
backtrackFrom
MatrixPath backtrackFrom(int queryIdx, int caseIdx)
Create the alignment path of this scoring matrix. Backtracks to a cell of value 0 (not included).- Parameters:
queryIdx- The query task index of the starting cell.caseIdx- The case task index of the starting cell.- Returns:
- The found path.
-
isInBounds
boolean isInBounds(int queryIdx, int caseIdx)Whether or not the indices are in bounds.- Parameters:
queryIdx-caseIdx-- Returns:
- True, if the indices are in bounds.
-
-