.. oe:namespace:: OEBio

.. meta::
   :keywords: OESequenceAlignment, SequenceAlignment


.. _OEBio_OESequenceAlignment:

.. oe:class:: OESequenceAlignment

   .. oe:api::

      class OESequenceAlignment

   This class contains information regarding a sequence alignment
   between two molecules that have residue information. The class
   includes information concerning the methods used to generate the
   alignment as well as :ref:`OEMatchBase <OEChem_OEMatchBase>` information for either the alpha
   carbons or all the backbone atoms that are paired by the
   alignment. The :ref:`OESequenceAlignment <OEBio_OESequenceAlignment>` class can be passed to an
   an :oe:func:`OEBio::OERMSD` function to generate
   3D alignment based on the
   sequence alignment, and can also be passed to the
   :oe:func:`OEBio::OEWriteAlignment`
   function to generate a standard sequence alignment text output.


   .. oe:method:: Constructors

      .. oe:language:: c++ java csharp

         .. oe:api::

            OESequenceAlignment()
            OESequenceAlignment(const OESequenceAlignment& rhs)

      .. oe:language:: python

         .. oe:api:: python

            OESequenceAlignment() -> OESequenceAlignment
            OESequenceAlignment(rhs: OESequenceAlignment) -> OESequenceAlignment

      Default and copy constructors.

   .. oe:method:: operator=
      :language: c++

      .. oe:api::

         OESequenceAlignment &operator=(const OESequenceAlignment &rhs)

      Default assignment operator

      Assignment operator.


   .. oe:method:: operator bool

      .. oe:language:: c++ java csharp

         .. oe:api::

            operator bool() const

      .. oe:language:: python

         .. oe:api:: python

            IsValid() -> bool

      An :ref:`OESequenceAlignment <OEBio_OESequenceAlignment>` object is considered invalid
      until its implementation is set.

   .. oe:method:: Clear

      .. oe:language:: c++ java csharp

         .. oe:api::

            void Clear()

      .. oe:language:: python

         .. oe:api:: python

            Clear() -> None

      Resets the object to the state in which it is default constructed.

   .. oe:method:: GetBackboneMatch

      .. oe:language:: c++ java csharp

         .. oe:api::

            const OEChem::OEMatchBase& GetBackboneMatch(unsigned idx1 = 0,
                                                        unsigned idx2 = 1)

      .. oe:language:: python

         .. oe:api:: python

            GetBackboneMatch(idx1: int = 0, idx2: int = 1) -> OEMatchBase

      Returns an :ref:`OEMatchBase <OEChem_OEMatchBase>` that is the alignment of backbone atoms
      between the sequences indicated by 'idx1' and 'idx2'. By default, the
      indices are `0` and `1` respectively, corresponding to a simple
      pairwise alignment.

   .. oe:method:: GetCAlphaMatch

      .. oe:language:: c++ java csharp

         .. oe:api::

            const OEChem::OEMatchBase& GetCAlphaMatch(unsigned idx1 = 0,
                                                      unsigned idx2 = 1)

      .. oe:language:: python

         .. oe:api:: python

            GetCAlphaMatch(idx1: int = 0, idx2: int = 1) -> OEMatchBase

      Returns an :ref:`OEMatchBase <OEChem_OEMatchBase>` that is the alignment of alpha
      carbon atoms between the sequences indicated by 'idx1' and
      'idx2'. By default, the indices are `0` and `1` respectively,
      corresponding to a simple pairwise alignment.

   .. oe:method:: GetChainID

      .. oe:language:: c++ java csharp

         .. oe:api::

            char GetChainID(unsigned int idx) const

      .. oe:language:: python

         .. oe:api:: python

            GetChainID(idx: int) -> str

     Returns the chain id of the given sequence.

     *idx*
        The index of the sequence. In a simple pairwise alignment this should be
        either `0` or `1`.

   .. oe:method:: GetExtend

      .. oe:language:: c++ java csharp

         .. oe:api::

            int GetExtend() const

      .. oe:language:: python

         .. oe:api:: python

            GetExtend() -> int

      Returns an integer that is the extension penalty used in creating
      the sequence alignment.

   .. oe:method:: GetGap

      .. oe:language:: c++ java csharp

         .. oe:api::

            int GetGap() const

      .. oe:language:: python

         .. oe:api:: python

            GetGap() -> int

      Returns an integer that is the gap penalty used in creating the
      sequence alignment.

   .. oe:method:: GetMaxSeqIdx

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned GetMaxSeqIdx() const

      .. oe:language:: python

         .. oe:api:: python

            GetMaxSeqIdx() -> int

      Returns a pointer that is the maximum index of any of the sequences
      used in the alignment.

   .. oe:method:: GetMethod

      .. oe:language:: c++ java csharp

         .. oe:api::

            unsigned GetMethod() const

      .. oe:language:: python

         .. oe:api:: python

            GetMethod() -> int

      Returns the unsigned integer that corresponds to one of the
      constants in the namespace :oe:constns:`OEBio::OESeqAlignmentMethod`.
      This is the method that was used to create the alignment.

   .. oe:method:: GetScore

      .. oe:language:: c++ java csharp

         .. oe:api::

            int GetScore() const

      .. oe:language:: python

         .. oe:api:: python

            GetScore() -> int

      Returns an integer that is the score of the sequence alignment.

   .. oe:method:: GetSequenceIdentity

      .. oe:language:: c++ java csharp

         .. oe:api::

            double GetSequenceIdentity() const

      .. oe:language:: python

         .. oe:api:: python

            GetSequenceIdentity() -> float

      Returns the percentage identity between the two sequences.


   .. oe:method:: GetSequenceSimilarity

      .. oe:language:: c++ java csharp

         .. oe:api::

            double GetSequenceSimilarity() const

      .. oe:language:: python

         .. oe:api:: python

            GetSequenceSimilarity() -> float

      Returns the percentage similarity between the two sequences based
      on the given method.

      .. seealso::

         * :oe:constns:`OEBio::OESeqAlignmentMethod` namespace

