:py:mod:`alhambra.glues`
========================

.. py:module:: alhambra.glues


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   alhambra.glues.Use
   alhambra.glues.Glue
   alhambra.glues.GlueFactory
   alhambra.glues.SSGlue
   alhambra.glues.DXGlue
   alhambra.glues.GlueList



Functions
~~~~~~~~~

.. autoapisummary::

   alhambra.glues.merge_items
   alhambra.glues._ensure_glue_name



Attributes
~~~~~~~~~~

.. autoapisummary::

   alhambra.glues.T
   alhambra.glues.GlueA
   alhambra.glues.GlueB
   alhambra.glues.glue_factory


.. py:data:: T

   

.. py:data:: GlueA

   

.. py:data:: GlueB

   

.. py:class:: Use


   Bases: :py:obj:`int`, :py:obj:`enum.Enum`

   int([x]) -> integer
   int(x, base=10) -> integer

   Convert a number or string to an integer, or return 0 if no arguments
   are given.  If x is a number, return x.__int__().  For floating point
   numbers, this truncates towards zero.

   If x is not a number or if base is given, then x must be a string,
   bytes, or bytearray instance representing an integer literal in the
   given base.  The literal can be preceded by '+' or '-' and be surrounded
   by whitespace.  The base defaults to 10.  Valid bases are 0 and 2-36.
   Base 0 means to interpret the base from the string as an integer literal.
   >>> int('0b100', base=0)
   4

   .. py:attribute:: UNUSED
      :value: 0

      

   .. py:attribute:: NULL
      :value: 1

      

   .. py:attribute:: INPUT
      :value: 2

      

   .. py:attribute:: OUTPUT
      :value: 3

      

   .. py:attribute:: BOTH
      :value: 4

      

   .. py:attribute:: PERMANENT
      :value: 5

      

   .. py:attribute:: UNSET
      :value: 6

      

   .. py:method:: from_any(other: str | Use | int) -> Use
      :classmethod:


   .. py:method:: invert() -> Use


   .. py:method:: merge(other: Use) -> Use


   .. py:method:: __or__(other: Any) -> Use
      :abstractmethod:

      Return self|value.


   .. py:method:: __ror__(other: Any) -> Use
      :abstractmethod:

      Return value|self.



.. py:function:: merge_items(a: Optional[T], b: Optional[T]) -> Optional[T]


.. py:function:: _ensure_glue_name(n: str | None) -> str | None

   Ensure the glue name uses *, not /, and is reasonable.


.. py:class:: Glue


   .. py:property:: etype
      :type: str
      :abstractmethod:


   .. py:property:: type
      :type: str


   .. py:property:: is_complement
      :type: bool


   .. py:property:: complement
      :type: GlueA


   .. py:attribute:: name
      :type: Optional[str]

      

   .. py:attribute:: note
      :type: Optional[str]

      

   .. py:attribute:: use
      :type: Use

      

   .. py:attribute:: abstractstrength
      :type: Optional[int]

      The stickydesign type of the glue.

   .. py:method:: _into_complement()


   .. py:method:: copy() -> T


   .. py:method:: ident() -> str


   .. py:method:: basename() -> str


   .. py:method:: update(other: Glue)


   .. py:method:: merge(other: Glue) -> Glue


   .. py:method:: __or__(other: Glue) -> Glue


   .. py:method:: __ior__(other: Glue)


   .. py:method:: __ror__(other: Glue) -> Glue


   .. py:method:: __eq__(other: object) -> bool

      Return self==value.


   .. py:method:: to_dict() -> dict[str, Any]


   .. py:method:: from_dict(d: dict[str, Any]) -> Glue
      :staticmethod:



.. py:class:: GlueFactory


   .. py:attribute:: types
      :type: dict[str, Type[Glue]]

      

   .. py:method:: register(c: Type[Glue])


   .. py:method:: from_dict(d: str | dict[str, Any]) -> Glue



.. py:data:: glue_factory

   

.. py:class:: SSGlue(name: Optional[str] = None, length: Union[None, int, str, alhambra.seq.Seq] = None, sequence: Union[None, str, alhambra.seq.Seq] = None, note: Optional[str] = None, use: Optional[Use] = None)


   Bases: :py:obj:`Glue`

   .. py:property:: dna_length
      :type: int


   .. py:property:: sequence
      :type: alhambra.seq.Seq


   .. py:property:: _shortdesc
      :type: str


   .. py:attribute:: etype
      :type: str
      :value: 'S'

      

   .. py:attribute:: _sequence
      :type: alhambra.seq.Seq

      

   .. py:method:: ident() -> str


   .. py:method:: _into_complement()


   .. py:method:: update(other: Glue | str)


   .. py:method:: merge(other: Glue | str) -> SSGlue


   .. py:method:: to_dict() -> dict[str, Any]



.. py:class:: DXGlue(etype, name=None, length=None, sequence: alhambra.seq.Seq | str | None = None, fullseq=None, use=None, abstractstrength=None, note=None)


   Bases: :py:obj:`Glue`

   .. py:property:: fseq
      :type: Optional[str]


   .. py:property:: seq
      :type: Optional[str]


   .. py:property:: comp

      The complement end sequences of the End, as a string.

   .. py:attribute:: etype
      :type: Literal[TD, DT]

      

   .. py:attribute:: fullseq
      :type: alhambra.seq.Seq

      

   .. py:method:: _into_complement()


   .. py:method:: merge(other: Glue) -> DXGlue


   .. py:method:: __str__()

      Return str(self).



.. py:class:: GlueList(initial: Iterable[T_NMI] = tuple())


   Bases: :py:obj:`Generic`\ [\ :py:obj:`GlueA`\ ], :py:obj:`alhambra.classes.UpdateListD`\ [\ :py:obj:`GlueA`\ ]

   Abstract base class for generic types.

   A generic type is typically declared by inheriting from
   this class parameterized with one or more type variables.
   For example, a generic mapping type might be defined as::

     class Mapping(Generic[KT, VT]):
         def __getitem__(self, key: KT) -> VT:
             ...
         # Etc.

   This class can then be used as follows::

     def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
         try:
             return mapping[key]
         except KeyError:
             return default

   .. py:method:: merge_complements() -> None


   .. py:method:: merge_glue(g: GlueA) -> GlueA


   .. py:method:: merge_glue_and_update_list(g: GlueA) -> GlueA


   .. py:method:: to_endarrays() -> Any
      :abstractmethod:



