org.biojava3.alignment.aaindex
public class ScaledSubstitutionMatrix extends java.lang.Object implements SubstitutionMatrix<AminoAcidCompound>
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.
Constructor and Description |
---|
ScaledSubstitutionMatrix() |
Modifier and Type | Method and Description |
---|---|
java.util.List<AminoAcidCompound> |
getCols() |
static java.lang.String |
getComment() |
CompoundSet<AminoAcidCompound> |
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 |
getMax() |
short |
getMaxValue()
Returns the maximum value in this matrix.
|
short |
getMin() |
short |
getMinValue()
Returns the minimum value in this matrix.
|
java.lang.String |
getName()
Returns the name (short description) of this matrix.
|
java.util.List<AminoAcidCompound> |
getRows() |
int |
getScale() |
short |
getValue(AminoAcidCompound from,
AminoAcidCompound to)
Returns value in matrix for conversion from first
Compound to the second. |
SubstitutionMatrix<AminoAcidCompound> |
normalizeMatrix(short scale)
Rescales the matrix so that to
SubstitutionMatrix.getMaxValue() - SubstitutionMatrix.getMinValue() = scale. |
void |
setCols(java.util.List<AminoAcidCompound> cols) |
void |
setDescription(java.lang.String description)
Sets the description of this matrix.
|
void |
setMatrix(short[][] matrix) |
void |
setMax(short max) |
void |
setMin(short min) |
void |
setName(java.lang.String name)
Sets the name (short description) of this matrix.
|
void |
setRows(java.util.List<AminoAcidCompound> rows) |
void |
setScale(int scale) |
java.lang.String |
toString()
Returns in a format similar to the standard NCBI files.
|
public int getScale()
public void setScale(int scale)
public java.lang.String getDescription()
SubstitutionMatrix
getDescription
in interface SubstitutionMatrix<AminoAcidCompound>
public void setDescription(java.lang.String description)
SubstitutionMatrix
setDescription
in interface SubstitutionMatrix<AminoAcidCompound>
description
- new descriptionpublic java.lang.String getName()
SubstitutionMatrix
getName
in interface SubstitutionMatrix<AminoAcidCompound>
public void setName(java.lang.String name)
SubstitutionMatrix
setName
in interface SubstitutionMatrix<AminoAcidCompound>
name
- new namepublic short[][] getMatrix()
SubstitutionMatrix
getMatrix
in interface SubstitutionMatrix<AminoAcidCompound>
public void setMatrix(short[][] matrix)
public short getMax()
public void setMax(short max)
public short getMin()
public void setMin(short min)
public java.util.List<AminoAcidCompound> getRows()
public void setRows(java.util.List<AminoAcidCompound> rows)
public java.util.List<AminoAcidCompound> getCols()
public void setCols(java.util.List<AminoAcidCompound> cols)
public static java.lang.String getComment()
public java.lang.String toString()
toString
in class java.lang.Object
public CompoundSet<AminoAcidCompound> getCompoundSet()
SubstitutionMatrix
CompoundSet
on which the matrix is defined.getCompoundSet
in interface SubstitutionMatrix<AminoAcidCompound>
CompoundSet
on which the matrix is definedpublic java.lang.String getMatrixAsString()
SubstitutionMatrix
Compound
labels along the axes.getMatrixAsString
in interface SubstitutionMatrix<AminoAcidCompound>
public short getMaxValue()
SubstitutionMatrix
getMaxValue
in interface SubstitutionMatrix<AminoAcidCompound>
public short getMinValue()
SubstitutionMatrix
getMinValue
in interface SubstitutionMatrix<AminoAcidCompound>
public short getValue(AminoAcidCompound from, AminoAcidCompound to)
SubstitutionMatrix
Compound
to the second. If an argument does not
belong to the CompoundSet
, this could either throw an IllegalArgumentException
or it could
return SubstitutionMatrix.getMinValue()
.getValue
in interface SubstitutionMatrix<AminoAcidCompound>
from
- original Compound
to
- replacement Compound
Compound
to the secondpublic SubstitutionMatrix<AminoAcidCompound> normalizeMatrix(short scale)
SubstitutionMatrix
SubstitutionMatrix.getMaxValue()
- SubstitutionMatrix.getMinValue()
= scale.normalizeMatrix
in interface SubstitutionMatrix<AminoAcidCompound>
scale
- new normalization scale of this matrix