Skip to main content
`Ctrl`+`K`

# skbio.embedding.ProteinVector

class skbio.embedding.ProteinVector(vector, sequence: str, **kwargs)

  Vector representation for a protein sequence.

  Parameters:
    vector 1D or 2D array_like

      The vector representation of the protein sequence. Typically a 1D array. Can also be a 2D array with only one row.

    sequence str, Sequence, or 1D ndarray

      Characters representing the protein sequence itself.

  See also

  `SequenceVector`
  `skbio.sequence.Protein`

  Examples

      >>> from skbio.embedding import ProteinVector
      >>> import numpy as np
      >>> vector = np.random.rand(10)
      >>> sequence = "ACDEFGHIKL"
      >>> ProteinVector(vector, sequence)
      ProteinVector
      --------------------------
      Stats:
          length: 10
          vector dimension: 10
          has gaps: False
          has degenerates: False
          has definites: True
          has stops: False
      --------------------------
      0 ACDEFGHIKL

  Attributes

  `default_write_format` |

  Attributes (inherited)

  `embedding` | The embedding tensor.
  `ids` | IDs corresponding to each row of the embedding.
  `sequence` | String representation of the underlying sequence.
  `vector` | Vector representation for the biological entity.

  Methods (inherited)

  `bytes`() | Bytes representation of string encoding.
  `read`([format]) | Create a new `ProteinVector` instance from a file.
  `write`(file[, format]) | Write an instance of `ProteinVector` to a file.

  Special methods (inherited)

  `__eq__`(value, /) | Return self==value.
  `__ge__`(value, /) | Return self>=value.
  `__getstate__`(/) | Helper for pickle.
  `__gt__`(value, /) | Return self>value.
  `__hash__`(/) | Return hash(self).
  `__le__`(value, /) | Return self<=value.
  `__lt__`(value, /) | Return self<value.
  `__ne__`(value, /) | Return self!=value.
  `__str__`() | Return str(self).

  Details

  default_write_format = 'embed'