Class ScaledSubstitutionMatrix
java.lang.Object
org.biojava.nbio.core.alignment.matrices.ScaledSubstitutionMatrix
- All Implemented Interfaces:
SubstitutionMatrix<AminoAcidCompound>
public class ScaledSubstitutionMatrix
extends Object
implements SubstitutionMatrix<AminoAcidCompound>
The biojava-alignment module represents substitution matrices with short
values. This is for performance reasons. Some substitution matrices, however,
are provided as float values with up to 2 decimal places.
In order to be able to use them in the alignment module these are scaled in
order to be able to represent as short values.
The method getScale() provides access to the scaling factor.
- Author:
- Andreas Prlic
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCols()getColumn(AminoAcidCompound column) static StringReturns theCompoundSeton which the matrix is defined.Returns the description of this matrix.short[][]Returns entire matrix.Returns this matrix as a formatted String withCompoundlabels along the axes.shortgetMax()shortReturns the maximum value in this matrix.shortgetMin()shortReturns the minimum value in this matrix.getName()Returns the name (short description) of this matrix.getRow(AminoAcidCompound row) getRows()intgetScale()shortgetValue(AminoAcidCompound from, AminoAcidCompound to) Returns value in matrix for conversion from firstCompoundto the second.normalizeMatrix(short scale) Rescales the matrix so that toSubstitutionMatrix.getMaxValue()-SubstitutionMatrix.getMinValue()= scale.voidsetCols(List<AminoAcidCompound> cols) voidsetDescription(String description) Sets the description of this matrix.voidsetMatrix(short[][] matrix) voidsetMax(short max) voidsetMin(short min) voidSets the name (short description) of this matrix.voidsetRows(List<AminoAcidCompound> rows) voidsetScale(int scale) toString()Returns in a format similar to the standard NCBI files.
-
Constructor Details
-
ScaledSubstitutionMatrix
public ScaledSubstitutionMatrix()
-
-
Method Details
-
getScale
-
setScale
-
getDescription
Description copied from interface:SubstitutionMatrixReturns the description of this matrix.- Specified by:
getDescriptionin interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- description
-
setDescription
Description copied from interface:SubstitutionMatrixSets the description of this matrix.- Specified by:
setDescriptionin interfaceSubstitutionMatrix<AminoAcidCompound>- Parameters:
description- new description
-
getName
Description copied from interface:SubstitutionMatrixReturns the name (short description) of this matrix.- Specified by:
getNamein interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- name
-
setName
Description copied from interface:SubstitutionMatrixSets the name (short description) of this matrix.- Specified by:
setNamein interfaceSubstitutionMatrix<AminoAcidCompound>- Parameters:
name- new name
-
getMatrix
Description copied from interface:SubstitutionMatrixReturns entire matrix.- Specified by:
getMatrixin interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- matrix
-
setMatrix
-
getMax
-
setMax
-
getMin
-
setMin
-
getRows
-
setRows
-
getCols
-
setCols
-
getComment
-
toString
Returns in a format similar to the standard NCBI files. -
getCompoundSet
Description copied from interface:SubstitutionMatrixReturns theCompoundSeton which the matrix is defined.- Specified by:
getCompoundSetin interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- the
CompoundSeton which the matrix is defined
-
getMatrixAsString
Description copied from interface:SubstitutionMatrixReturns this matrix as a formatted String withCompoundlabels along the axes.- Specified by:
getMatrixAsStringin interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- this matrix as a formatted String
-
getMaxValue
Description copied from interface:SubstitutionMatrixReturns the maximum value in this matrix.- Specified by:
getMaxValuein interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- the maximum value in this matrix
-
getMinValue
Description copied from interface:SubstitutionMatrixReturns the minimum value in this matrix.- Specified by:
getMinValuein interfaceSubstitutionMatrix<AminoAcidCompound>- Returns:
- the minimum value in this matrix
-
getValue
Description copied from interface:SubstitutionMatrixReturns value in matrix for conversion from firstCompoundto the second. If an argument does not belong to theCompoundSet, this could either throw anIllegalArgumentExceptionor it could returnSubstitutionMatrix.getMinValue().- Specified by:
getValuein interfaceSubstitutionMatrix<AminoAcidCompound>- Parameters:
from- originalCompoundto- replacementCompound- Returns:
- value in matrix for conversion from first
Compoundto the second
-
normalizeMatrix
Description copied from interface:SubstitutionMatrixRescales the matrix so that toSubstitutionMatrix.getMaxValue()-SubstitutionMatrix.getMinValue()= scale.- Specified by:
normalizeMatrixin interfaceSubstitutionMatrix<AminoAcidCompound>- Parameters:
scale- new normalization scale of this matrix
-
getRow
- Specified by:
getRowin interfaceSubstitutionMatrix<AminoAcidCompound>
-
getColumn
- Specified by:
getColumnin interfaceSubstitutionMatrix<AminoAcidCompound>
-