|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.biojava3.alignment.SimpleSubstitutionMatrix<C>
C - each element of the matrix corresponds to a pair of Compounds of type Cpublic class SimpleSubstitutionMatrix<C extends Compound>
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.
| Constructor Summary | |
|---|---|
SimpleSubstitutionMatrix()
Creates a substitution matrix using the defaults (BLOSUM 62). |
|
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,
short match,
short replace)
Creates an identity substitution matrix from match and replace values. |
|
SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
String matrixInput,
String name)
Creates a substitution matrix by parsing a String. |
|
| Method Summary | |
|---|---|
CompoundSet<C> |
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 |
getMaxValue()
Returns the maximum value in this matrix. |
short |
getMinValue()
Returns the minimum value in this matrix. |
String |
getName()
Returns the name (short description) of this matrix. |
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(String description)
Sets the description of this matrix. |
void |
setName(String name)
Sets the name (short description) of this matrix. |
String |
toString()
Returns in a format similar to the standard NCBI files. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleSubstitutionMatrix()
ClassCastException - if type parameter C is not AminoAcidCompound
public SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
File fileInput)
throws FileNotFoundException
compoundSet - the CompoundSet on which the matrix is definedfileInput - file parsed for a substitution matrix
FileNotFoundException - if fileInput parameter cannot be read
public SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
Reader input,
String name)
compoundSet - the CompoundSet on which the matrix is definedinput - input parsed for a substitution matrixname - the name (short description) of this matrix
public SimpleSubstitutionMatrix(CompoundSet<C> compoundSet,
String matrixInput,
String name)
compoundSet - the CompoundSet on which the matrix is definedmatrixInput - String parsed for a substitution matrixname - the name (short description) of this matrix
public 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 Compounds| Method Detail |
|---|
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 String getDescription()
SubstitutionMatrix
getDescription in interface SubstitutionMatrix<C extends Compound>public short[][] getMatrix()
SubstitutionMatrix
getMatrix in interface SubstitutionMatrix<C extends Compound>public String getMatrixAsString()
SubstitutionMatrixCompound labels along the axes.
getMatrixAsString in interface SubstitutionMatrix<C extends Compound>public short getMaxValue()
SubstitutionMatrix
getMaxValue in interface SubstitutionMatrix<C extends Compound>public short getMinValue()
SubstitutionMatrix
getMinValue in interface SubstitutionMatrix<C extends Compound>public String getName()
SubstitutionMatrix
getName 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().
getValue in interface SubstitutionMatrix<C extends Compound>from - original Compoundto - replacement Compound
Compound to the secondpublic 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(String description)
SubstitutionMatrix
setDescription in interface SubstitutionMatrix<C extends Compound>description - new descriptionpublic void setName(String name)
SubstitutionMatrix
setName in interface SubstitutionMatrix<C extends Compound>name - new namepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||