Interface SubstitutionMatrix<C extends Compound>
- 
- Type Parameters:
 C- each element of the matrix corresponds to a pair ofCompounds of type C
- All Known Implementing Classes:
 ScaledSubstitutionMatrix,SimpleSubstitutionMatrix
public interface SubstitutionMatrix<C extends Compound>
Defines a data structure which holds the score (penalty or bonus) given during alignment for the exchange of oneCompoundin a sequence for another.- Author:
 - Mark Chapman, Paolo Pavan
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Map<C,Short>getColumn(C column)CompoundSet<C>getCompoundSet()Returns theCompoundSeton which the matrix is defined.StringgetDescription()Returns the description of this matrix.short[][]getMatrix()Returns entire matrix.StringgetMatrixAsString()Returns this matrix as a formatted String withCompoundlabels along the axes.shortgetMaxValue()Returns the maximum value in this matrix.shortgetMinValue()Returns the minimum value in this matrix.StringgetName()Returns the name (short description) of this matrix.Map<C,Short>getRow(C row)shortgetValue(C from, C to)Returns value in matrix for conversion from firstCompoundto the second.SubstitutionMatrix<C>normalizeMatrix(short scale)Rescales the matrix so that togetMaxValue()-getMinValue()= scale.voidsetDescription(String description)Sets the description of this matrix.voidsetName(String name)Sets the name (short description) of this matrix. 
 - 
 
- 
- 
Method Detail
- 
getCompoundSet
CompoundSet<C> getCompoundSet()
Returns theCompoundSeton which the matrix is defined.- Returns:
 - the 
CompoundSeton which the matrix is defined 
 
- 
getDescription
String getDescription()
Returns the description of this matrix.- Returns:
 - description
 
 
- 
getMatrix
short[][] getMatrix()
Returns entire matrix.- Returns:
 - matrix
 
 
- 
getMatrixAsString
String getMatrixAsString()
Returns this matrix as a formatted String withCompoundlabels along the axes.- Returns:
 - this matrix as a formatted String
 
 
- 
getMaxValue
short getMaxValue()
Returns the maximum value in this matrix.- Returns:
 - the maximum value in this matrix
 
 
- 
getMinValue
short getMinValue()
Returns the minimum value in this matrix.- Returns:
 - the minimum value in this matrix
 
 
- 
getValue
short getValue(C from, C to)
Returns value in matrix for conversion from firstCompoundto the second. If an argument does not belong to theCompoundSet, this could either throw anIllegalArgumentExceptionor it could returngetMinValue().- Parameters:
 from- originalCompoundto- replacementCompound- Returns:
 - value in matrix for conversion from first 
Compoundto the second - Throws:
 IllegalArgumentException- possibly, if an argument does not belong to theCompoundSet
 
- 
normalizeMatrix
SubstitutionMatrix<C> normalizeMatrix(short scale)
Rescales the matrix so that togetMaxValue()-getMinValue()= scale.- Parameters:
 scale- new normalization scale of this matrix- Throws:
 IllegalArgumentException- if scale < 1
 
- 
setDescription
void setDescription(String description)
Sets the description of this matrix.- Parameters:
 description- new description
 
- 
setName
void setName(String name)
Sets the name (short description) of this matrix.- Parameters:
 name- new name
 
 - 
 
 -