subseq_scan =========== Slide a window across the sequence and extract the subsequence at each position. Unlike ``deletion_scan`` (which removes the window) or ``replacement_scan`` (which replaces it), ``subseq_scan`` returns only the window content — producing a pool of short subsequences tiling across the input. .. code-block:: python import poolparty as pp pp.init() ---- Parameters ---------- .. list-table:: :widths: auto :header-rows: 1 * - Parameter - Type - Default - Description * - ``pool`` - ``Pool | str`` - *(required)* - Input pool or sequence string. * - ``subseq_length`` - ``int`` - *(required)* - Length of the subsequence window to extract at each position. * - ``positions`` - ``list[int] | None`` - ``None`` - Explicit window start positions. ``None`` uses all valid positions. * - ``region`` - ``str | list | None`` - ``None`` - Restrict the scan to a named region or ``[start, stop]`` interval. * - ``prefix`` - ``str | None`` - ``None`` - Prefix for the operation node name in the pool graph. * - ``mode`` - ``str`` - ``"random"`` - ``"sequential"`` iterates positions left-to-right; ``"random"`` samples one position per draw. * - ``num_states`` - ``int | None`` - ``None`` - Override the automatically-computed state count. * - ``iter_order`` - ``float | None`` - ``None`` - Iteration priority for downstream multi-pool iteration. * - ``cards`` - ``dict | list | None`` - ``None`` - Design card columns to include in library output. Available keys: ``"position_index"``, ``"start"``, ``"end"``, ``"name"``, ``"region_seq"``. ---- .. note:: Only the most commonly used parameters are shown above. For the full parameter list, see :func:`~poolparty.subseq_scan` in the :doc:`API Reference `. Examples -------- Extract all 4-mers from an 8-mer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ A window of length 4 over an 8-base sequence yields 5 subsequences. .. code-block:: python import poolparty as pp pp.init() pool = pp.from_seq("ACGTACGT") submers = pool.subseq_scan(subseq_length=4, mode="sequential") submers.print_library() .. raw:: html