Skip to main content
`Ctrl`+`K`

# skbio.sequence.SubstitutionMatrix.identity

classmethod SubstitutionMatrix.identity(alphabet, match, mismatch)

  Create an identity substitution matrix.

  All matches and mismatches will have the identical scores, respectively, regardless of the character.

  Parameters:
    alphabet iterable

      Characters that constitute the alphabet.

    match int or float

      Score assigned to all matches.

    mismatch int or float

      Score assigned to all mismatches.

  Returns:
    SubstitutionMatrix

      Substitution matrix constructed from the alphabet and scores.

  Examples

      >>> from skbio import SubstitutionMatrix
      >>> mat = SubstitutionMatrix.identity('ACGT', 1, -2)
      >>> mat.alphabet
      ('A', 'C', 'G', 'T')
      >>> mat.scores
      array([[ 1., -2., -2., -2.],
             [-2.,  1., -2., -2.],
             [-2., -2.,  1., -2.],
             [-2., -2., -2.,  1.]])