# Bio.Align.substitution_matrices package

## Module contents

Substitution matrices.

class Bio.Align.substitution_matrices.Array(alphabet=None, dims=None, data=None, dtype=float)

  Bases: `ndarray`

  numpy array subclass indexed by integers and by letters.

  static __new__(cls, alphabet=None, dims=None, data=None, dtype=float)

    Create a new Array instance.

  __array_finalize__(obj, /)

    Present so subclasses can call super. Does nothing.

  __getitem__(key)

    Return self[key].

  __setitem__(key, value)

    Set self[key] to value.

  __contains__(key)

    Return bool(key in self).

  __array_prepare__(out_arr, context=None)
  __array_wrap__(array, [context, ]/)

    Returns a view of array with the same type as self.

  __array_ufunc__(ufunc, method, *inputs, **kwargs)
  __reduce__()

    For pickling.

  __setstate__(state, /)

    For unpickling.

    The state argument must be a sequence that contains the following elements:

    Parameters:
      version int

        optional pickle version. If omitted defaults to 0.

      shape tuple
      dtype data-type
      isFortran bool
      rawdata string or list

        a binary string with the data (or a list if ‘a’ is an object array)

  transpose(axes=None)

    Transpose the array.

  property alphabet

    Return the alphabet property.

  get(key, value=None)

    Return the value of the key if found; return value otherwise.

  items()

    Return an iterator of (key, value) pairs in the array.

  keys()

    Return a tuple with the keys associated with the array.

  values()

    Return a tuple with the values stored in the array.

  update(E=None, **F)

    Update the array from dict/iterable E and F.

  select(alphabet)

    Subset the array by selecting the letters from the specified alphabet.

  __format__(fmt)

    Default object formatter.

    Return str(self) if format_spec is empty. Raise TypeError otherwise.

  format(fmt='')

    Return a string representation of the array.

    The argument `fmt` specifies the number format to be used. By default, the number format is “%i” if the array contains integer numbers, and “%.1f” otherwise.

  __str__()

    Return str(self).

  __repr__()

    Return repr(self).

  __firstlineno__ = 18
  __static_attributes__ = ('_alphabet',)

Bio.Align.substitution_matrices.read(handle, dtype=float)

  Parse the file and return an Array object.

Bio.Align.substitution_matrices.load(name=None)

  Load and return a precalculated substitution matrix.

      >>> from Bio.Align import substitution_matrices
      >>> names = substitution_matrices.load()

Biopython v: 1.85

Versions
  Previous
  Latest
  Develop

Biopython Project
  Homepage
  On GitHub