region_scan =========== Insert a named region tag at successive positions within a sequence, producing one variant per window position. Combine with :func:`~poolparty.replace_region` or other operations to act on the tagged window. Use ``mode='sequential'`` to enumerate every position deterministically. .. 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 scan. Can also be a plain sequence string. * - ``tag_name`` - ``str`` - ``'region'`` - Name for the scanning region tag inserted at each position. * - ``positions`` - ``list[int] | None`` - ``None`` - Explicit list of 0-based positions to visit. ``None`` = all valid positions. * - ``region`` - ``str | list | None`` - ``None`` - Restrict the scan to a named region (string) or a ``[start, stop]`` coordinate pair. * - ``remove_tags`` - ``bool | None`` - ``None`` - When ``True`` and ``region`` is a region name, strip the constraint region tags from the output. * - ``region_length`` - ``int`` - ``0`` - Number of bases the scanning window spans. ``0`` = zero-length point tag; positive = spanning tags enclosing that many bases. * - ``mode`` - ``str`` - ``'random'`` - ``'sequential'`` enumerates every valid position as a separate state; ``'random'`` samples one position per draw. * - ``num_states`` - ``int | None`` - ``None`` - Override the automatically-computed state count. * - ``iter_order`` - ``int | None`` - ``None`` - Dimension-name ordering for downstream multi-pool iteration. * - ``prefix`` - ``str | None`` - ``None`` - Prefix for the operation node name in the pool graph. * - ``cards`` - ``dict | list | None`` - ``None`` - Design card columns to include in library output. ---- .. note:: Only the most commonly used parameters are shown above. For the full parameter list, see :func:`~poolparty.region_scan` in the :doc:`API Reference `. Examples -------- Point tags across every inter-base position (region_length=0) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``region_length=0`` places a zero-length tag at each of the 9 valid positions in an 8-mer (between and at the ends of every base). .. code-block:: python wt = pp.from_seq("ATCGATCG") scan = pp.region_scan(wt, tag_name="ins", region_length=0, mode="sequential") scan.print_library() .. raw:: html