Class SimpleSubstitutionMatrix<C extends Compound>
java.lang.Object
org.biojava.nbio.core.alignment.matrices.SimpleSubstitutionMatrix<C>
- Type Parameters:
C- each element of the matrix corresponds to a pair ofCompounds of type C
- All Implemented Interfaces:
Serializable,SubstitutionMatrix<C>
public class SimpleSubstitutionMatrix<C extends Compound>
extends Object
implements SubstitutionMatrix<C>, Serializable
Implements a data structure which holds the score (penalty or bonus) given during alignment for the exchange of one
Compound in a sequence for another.- Author:
- Mark Chapman, Daniel Cameron, Paolo Pavan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleSubstitutionMatrix(CompoundSet<C> compoundSet, short match, short replace) Creates an identity substitution matrix from match and replace values.SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, File fileInput) Creates a substitution matrix by reading in a file.SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, Reader input, String name) Creates a substitution matrix by parsing some input.SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, String matrixInput, String name) Creates a substitution matrix by parsing a String. -
Method Summary
Modifier and TypeMethodDescriptionstatic SubstitutionMatrix<AminoAcidCompound> Returns 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.shortReturns the maximum value in this matrix.shortReturns the minimum value in this matrix.getName()Returns the name (short description) of this matrix.shortReturns value in matrix for conversion from firstCompoundto the second.normalizeMatrix(short scale) Rescales the matrix so that toSubstitutionMatrix.getMaxValue()-SubstitutionMatrix.getMinValue()= scale.voidsetDescription(String description) Sets the description of this matrix.voidSets the name (short description) of this matrix.toString()Returns in a format similar to the standard NCBI files.
-
Constructor Details
-
SimpleSubstitutionMatrix
public SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, File fileInput) throws FileNotFoundException Creates a substitution matrix by reading in a file.- Parameters:
compoundSet- theCompoundSeton which the matrix is definedfileInput- file parsed for a substitution matrix- Throws:
FileNotFoundException- if fileInput parameter cannot be read
-
SimpleSubstitutionMatrix
Creates a substitution matrix by parsing some input.- Parameters:
compoundSet- theCompoundSeton which the matrix is definedinput- input parsed for a substitution matrixname- the name (short description) of this matrix
-
SimpleSubstitutionMatrix
Creates a substitution matrix by parsing a String.- Parameters:
compoundSet- theCompoundSeton which the matrix is definedmatrixInput- String parsed for a substitution matrixname- the name (short description) of this matrix
-
SimpleSubstitutionMatrix
Creates an identity substitution matrix from match and replace values.- Parameters:
compoundSet- theCompoundSeton which the matrix is definedmatch- matrix value used for equivalentCompoundsreplace- matrix value used for differingCompounds
-
-
Method Details
-
getBlosum62
-
getCompoundSet
Description copied from interface:SubstitutionMatrixReturns theCompoundSeton which the matrix is defined.- Specified by:
getCompoundSetin interfaceSubstitutionMatrix<C extends Compound>- Returns:
- the
CompoundSeton which the matrix is defined
-
getDescription
Description copied from interface:SubstitutionMatrixReturns the description of this matrix.- Specified by:
getDescriptionin interfaceSubstitutionMatrix<C extends Compound>- Returns:
- description
-
getMatrix
Description copied from interface:SubstitutionMatrixReturns entire matrix.- Specified by:
getMatrixin interfaceSubstitutionMatrix<C extends Compound>- Returns:
- matrix
-
getMatrixAsString
Description copied from interface:SubstitutionMatrixReturns this matrix as a formatted String withCompoundlabels along the axes.- Specified by:
getMatrixAsStringin interfaceSubstitutionMatrix<C extends Compound>- Returns:
- this matrix as a formatted String
-
getMaxValue
Description copied from interface:SubstitutionMatrixReturns the maximum value in this matrix.- Specified by:
getMaxValuein interfaceSubstitutionMatrix<C extends Compound>- Returns:
- the maximum value in this matrix
-
getMinValue
Description copied from interface:SubstitutionMatrixReturns the minimum value in this matrix.- Specified by:
getMinValuein interfaceSubstitutionMatrix<C extends Compound>- Returns:
- the minimum value in this matrix
-
getName
Description copied from interface:SubstitutionMatrixReturns the name (short description) of this matrix.- Specified by:
getNamein interfaceSubstitutionMatrix<C extends Compound>- Returns:
- name
-
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(). -
normalizeMatrix
Description copied from interface:SubstitutionMatrixRescales the matrix so that toSubstitutionMatrix.getMaxValue()-SubstitutionMatrix.getMinValue()= scale.- Specified by:
normalizeMatrixin interfaceSubstitutionMatrix<C extends Compound>- Parameters:
scale- new normalization scale of this matrix
-
setDescription
Description copied from interface:SubstitutionMatrixSets the description of this matrix.- Specified by:
setDescriptionin interfaceSubstitutionMatrix<C extends Compound>- Parameters:
description- new description
-
setName
Description copied from interface:SubstitutionMatrixSets the name (short description) of this matrix.- Specified by:
setNamein interfaceSubstitutionMatrix<C extends Compound>- Parameters:
name- new name
-
toString
Returns in a format similar to the standard NCBI files. -
getRow
- Specified by:
getRowin interfaceSubstitutionMatrix<C extends Compound>
-
getColumn
- Specified by:
getColumnin interfaceSubstitutionMatrix<C extends Compound>
-