C - each element of the matrix corresponds to a pair of Compounds of type Cpublic class SimpleSubstitutionMatrix<C extends Compound> extends java.lang.Object implements SubstitutionMatrix<C>, java.io.Serializable
Compound in a sequence for another.| Constructor and Description |
|---|
SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
java.io.File fileInput)
Creates a substitution matrix by reading in a file.
|
SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
java.io.Reader input,
java.lang.String name)
Creates a substitution matrix by parsing some input.
|
SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
short match,
short replace)
Creates an identity substitution matrix from match and replace values.
|
SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
java.lang.String matrixInput,
java.lang.String name)
Creates a substitution matrix by parsing a String.
|
| Modifier and Type | Method and Description |
|---|---|
static SubstitutionMatrix<AminoAcidCompound> |
getBlosum62() |
java.util.Map<C,java.lang.Short> |
getColumn(C column) |
CompoundSet<C> |
getCompoundSet()
Returns the
CompoundSet on which the matrix is defined. |
java.lang.String |
getDescription()
Returns the description of this matrix.
|
short[][] |
getMatrix()
Returns entire matrix.
|
java.lang.String |
getMatrixAsString()
Returns this matrix as a formatted String with
Compound labels along the axes. |
short |
getMaxValue()
Returns the maximum value in this matrix.
|
short |
getMinValue()
Returns the minimum value in this matrix.
|
java.lang.String |
getName()
Returns the name (short description) of this matrix.
|
java.util.Map<C,java.lang.Short> |
getRow(C row) |
short |
getValue(C from,
C to)
Returns value in matrix for conversion from first
Compound to the second. |
SubstitutionMatrix<C> |
normalizeMatrix(short scale)
Rescales the matrix so that to
SubstitutionMatrix.getMaxValue() - SubstitutionMatrix.getMinValue() = scale. |
void |
setDescription(java.lang.String description)
Sets the description of this matrix.
|
void |
setName(java.lang.String name)
Sets the name (short description) of this matrix.
|
java.lang.String |
toString()
Returns in a format similar to the standard NCBI files.
|
public SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, java.io.File fileInput) throws java.io.FileNotFoundException
compoundSet - the CompoundSet on which the matrix is definedfileInput - file parsed for a substitution matrixjava.io.FileNotFoundException - if fileInput parameter cannot be readpublic SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, java.io.Reader input, java.lang.String name)
compoundSet - the CompoundSet on which the matrix is definedinput - input parsed for a substitution matrixname - the name (short description) of this matrixpublic SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, java.lang.String matrixInput, java.lang.String name)
compoundSet - the CompoundSet on which the matrix is definedmatrixInput - String parsed for a substitution matrixname - the name (short description) of this matrixpublic SimpleSubstitutionMatrix(CompoundSet<C> compoundSet, short match, short replace)
compoundSet - the CompoundSet on which the matrix is definedmatch - matrix value used for equivalent Compoundsreplace - matrix value used for differing Compoundspublic static SubstitutionMatrix<AminoAcidCompound> getBlosum62()
public CompoundSet<C> getCompoundSet()
SubstitutionMatrixCompoundSet on which the matrix is defined.getCompoundSet in interface SubstitutionMatrix<C extends Compound>CompoundSet on which the matrix is definedpublic java.lang.String getDescription()
SubstitutionMatrixgetDescription in interface SubstitutionMatrix<C extends Compound>public short[][] getMatrix()
SubstitutionMatrixgetMatrix in interface SubstitutionMatrix<C extends Compound>public java.lang.String getMatrixAsString()
SubstitutionMatrixCompound labels along the axes.getMatrixAsString in interface SubstitutionMatrix<C extends Compound>public short getMaxValue()
SubstitutionMatrixgetMaxValue in interface SubstitutionMatrix<C extends Compound>public short getMinValue()
SubstitutionMatrixgetMinValue in interface SubstitutionMatrix<C extends Compound>public java.lang.String getName()
SubstitutionMatrixgetName in interface SubstitutionMatrix<C extends Compound>public short getValue(C from, C to)
SubstitutionMatrixCompound to the second. If an argument does not
belong to the CompoundSet, this could either throw an IllegalArgumentException or it could
return SubstitutionMatrix.getMinValue().public SubstitutionMatrix<C> normalizeMatrix(short scale)
SubstitutionMatrixSubstitutionMatrix.getMaxValue() - SubstitutionMatrix.getMinValue() = scale.normalizeMatrix in interface SubstitutionMatrix<C extends Compound>scale - new normalization scale of this matrixpublic void setDescription(java.lang.String description)
SubstitutionMatrixsetDescription in interface SubstitutionMatrix<C extends Compound>description - new descriptionpublic void setName(java.lang.String name)
SubstitutionMatrixsetName in interface SubstitutionMatrix<C extends Compound>name - new namepublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Map<C,java.lang.Short> getRow(C row)
getRow in interface SubstitutionMatrix<C extends Compound>