public class ScaledSubstitutionMatrix extends 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 |
---|---|
List<AminoAcidCompound> |
getCols() |
Map<AminoAcidCompound,Short> |
getColumn(AminoAcidCompound column) |
static String |
getComment() |
CompoundSet<AminoAcidCompound> |
getCompoundSet()
Returns the
CompoundSet on which the matrix is defined. |
String |
getDescription()
Returns the description of this matrix.
|
short[][] |
getMatrix()
Returns entire matrix.
|
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.
|
String |
getName()
Returns the name (short description) of this matrix.
|
Map<AminoAcidCompound,Short> |
getRow(AminoAcidCompound row) |
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(List<AminoAcidCompound> cols) |
void |
setDescription(String description)
Sets the description of this matrix.
|
void |
setMatrix(short[][] matrix) |
void |
setMax(short max) |
void |
setMin(short min) |
void |
setName(String name)
Sets the name (short description) of this matrix.
|
void |
setRows(List<AminoAcidCompound> rows) |
void |
setScale(int scale) |
String |
toString()
Returns in a format similar to the standard NCBI files.
|
public int getScale()
public void setScale(int scale)
public String getDescription()
SubstitutionMatrix
getDescription
in interface SubstitutionMatrix<AminoAcidCompound>
public void setDescription(String description)
SubstitutionMatrix
setDescription
in interface SubstitutionMatrix<AminoAcidCompound>
description
- new descriptionpublic String getName()
SubstitutionMatrix
getName
in interface SubstitutionMatrix<AminoAcidCompound>
public void setName(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 List<AminoAcidCompound> getRows()
public void setRows(List<AminoAcidCompound> rows)
public List<AminoAcidCompound> getCols()
public void setCols(List<AminoAcidCompound> cols)
public static String getComment()
public String toString()
public CompoundSet<AminoAcidCompound> getCompoundSet()
SubstitutionMatrix
CompoundSet
on which the matrix is defined.getCompoundSet
in interface SubstitutionMatrix<AminoAcidCompound>
CompoundSet
on which the matrix is definedpublic 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 matrixpublic Map<AminoAcidCompound,Short> getRow(AminoAcidCompound row)
getRow
in interface SubstitutionMatrix<AminoAcidCompound>
public Map<AminoAcidCompound,Short> getColumn(AminoAcidCompound column)
getColumn
in interface SubstitutionMatrix<AminoAcidCompound>
Copyright © 2000–2016 BioJava. All rights reserved.