annotate_orf
============
Register a region as an ``OrfRegion`` so that downstream operations such as
``mutagenize_orf``, ``stylize_orf``, and ``translate`` can look up the reading
frame automatically. If the region does not yet exist, ``extent=`` sets its
boundaries. Optionally apply codon-based styling at the same time via
``style_codons=`` or ``style_frames=``.
.. code-block:: python
import poolparty as pp
pp.init()
----
Parameters
----------
.. list-table::
:header-rows: 1
:widths: auto
* - Parameter
- Type
- Default
- Description
* - ``pool``
- ``Pool``
- *(required)*
- The Pool to annotate.
* - ``region_name``
- ``str``
- *(required)*
- Name for the ORF region.
* - ``extent``
- ``tuple[int, int] | None``
- ``None``
- ``(start, stop)`` half-open interval defining the region boundaries.
If ``None`` and the region doesn't exist, the entire sequence is used.
Must be ``None`` if the region already exists.
* - ``frame``
- ``int``
- ``1``
- Reading frame (+1..+3 or -1..-3). Positive = 5'->3', negative =
3'->5'. Determines which codon grid is used by downstream ORF
operations.
* - ``style``
- ``str | None``
- ``None``
- A single display style applied uniformly to the ORF region. Mutually
exclusive with ``style_codons`` and ``style_frames``.
* - ``style_codons``
- ``list[str] | None``
- ``None``
- List of style names cycled across whole codons within the ORF.
Mutually exclusive with ``style`` and ``style_frames``.
* - ``style_frames``
- ``list[str] | None``
- ``None``
- List of style names (length a multiple of 3) applied per base
position within each codon. Mutually exclusive with ``style`` and
``style_codons``.
* - ``iter_order``
- ``float | None``
- ``None``
- Enumeration order when combined with other pools.
* - ``prefix``
- ``str | None``
- ``None``
- Prefix for the operation node name in the pool graph.
----
.. note::
Only the most commonly used parameters are shown above. For the full
parameter list, see :func:`~poolparty.annotate_orf` in the
:doc:`API Reference `.
Examples
--------
Annotate a pre-tagged ORF
~~~~~~~~~~~~~~~~~~~~~~~~~
When the region already exists as XML tags in the sequence, just pass the
region name. ``annotate_orf`` registers it as an ``OrfRegion`` (with reading
frame) without changing the sequence.
.. code-block:: python
wt = pp.from_seq("