stylize_orf =========== Apply codon-aware inline styling to sequences without modifying them. Pass ``style_codons=`` to cycle a list of styles across whole codons, or ``style_frames=`` (length a multiple of 3) to style each base position within a codon independently. Use ``region=`` to restrict coloring to a named ORF segment. Use ``mode='sequential'`` to preserve all upstream states. .. code-block:: python import poolparty as pp pp.init() ---- Parameters ---------- .. list-table:: :header-rows: 1 :widths: auto * - Parameter - Type - Default - Description * - ``pool`` - ``Pool | str`` - *(required)* - The Pool to style. * - ``region`` - ``str | list | None`` - ``None`` - Restrict styling to a named ORF region or a ``[start, stop]`` coordinate pair. The region must be an ``OrfRegion`` (created by ``annotate_orf``) or ``frame`` must be specified explicitly. * - ``style_codons`` - ``list[str] | None`` - ``None`` - List of style names cycled across whole codons. At least one of ``style_codons`` or ``style_frames`` must be provided. * - ``style_frames`` - ``list[str] | None`` - ``None`` - List of style names (length a multiple of 3) applied per base position within each codon. At least one of ``style_codons`` or ``style_frames`` must be provided. * - ``frame`` - ``int | None`` - ``None`` - Reading frame (1, 2, or 3). Auto-detected from an ``OrfRegion`` if ``region`` is set; must be specified otherwise. * - ``prefix`` - ``str | None`` - ``None`` - Prefix for the operation node name in the pool graph. * - ``iter_order`` - ``float | None`` - ``None`` - Iteration priority for downstream multi-pool iteration. ---- .. note:: Only the most commonly used parameters are shown above. For the full parameter list, see :func:`~poolparty.stylize_orf` in the :doc:`API Reference `. Examples -------- Alternating codon colours (style_codons) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cycle two colours across the 5 codons of ``ATGAAATTTGGGCCC`` so the reading frame is immediately visible. .. code-block:: python cds = pp.from_seq("ATGAAATTTGGGCCC") styled = pp.stylize_orf(cds, style_codons=["blue", "red"]) styled.print_library() .. raw:: html