Interface SubstitutionMatrix<C extends Compound>

  • Type Parameters:
    C - each element of the matrix corresponds to a pair of Compounds of type C
    All Known Implementing Classes:
    ScaledSubstitutionMatrix, SimpleSubstitutionMatrix

    public interface SubstitutionMatrix<C extends Compound>
    Defines 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, Paolo Pavan
    • Method Detail

      • getDescription

        java.lang.String getDescription()
        Returns the description of this matrix.
        Returns:
        description
      • getMatrix

        short[][] getMatrix()
        Returns entire matrix.
        Returns:
        matrix
      • getMatrixAsString

        java.lang.String getMatrixAsString()
        Returns this matrix as a formatted String with Compound labels along the axes.
        Returns:
        this matrix as a formatted String
      • getMaxValue

        short getMaxValue()
        Returns the maximum value in this matrix.
        Returns:
        the maximum value in this matrix
      • getMinValue

        short getMinValue()
        Returns the minimum value in this matrix.
        Returns:
        the minimum value in this matrix
      • getName

        java.lang.String getName()
        Returns the name (short description) of this matrix.
        Returns:
        name
      • getValue

        short getValue​(C from,
                       C to)
        Returns value in matrix for conversion from first Compound to the second. If an argument does not belong to the CompoundSet, this could either throw an IllegalArgumentException or it could return getMinValue().
        Parameters:
        from - original Compound
        to - replacement Compound
        Returns:
        value in matrix for conversion from first Compound to the second
        Throws:
        java.lang.IllegalArgumentException - possibly, if an argument does not belong to the CompoundSet
      • normalizeMatrix

        SubstitutionMatrix<C> normalizeMatrix​(short scale)
        Rescales the matrix so that to getMaxValue() - getMinValue() = scale.
        Parameters:
        scale - new normalization scale of this matrix
        Throws:
        java.lang.IllegalArgumentException - if scale < 1
      • setDescription

        void setDescription​(java.lang.String description)
        Sets the description of this matrix.
        Parameters:
        description - new description
      • setName

        void setName​(java.lang.String name)
        Sets the name (short description) of this matrix.
        Parameters:
        name - new name
      • getRow

        java.util.Map<C,​java.lang.Short> getRow​(C row)
      • getColumn

        java.util.Map<C,​java.lang.Short> getColumn​(C column)