region_scan
Insert a named region tag at successive positions within a sequence,
producing one variant per window position. Combine with
replace_region() or other operations to act on the tagged
window. Use mode='sequential' to enumerate every position
deterministically.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
The Pool to scan. Can also be a plain sequence string. |
|
|
|
Name for the scanning region tag inserted at each position. |
|
|
|
Explicit list of 0-based positions to visit. |
|
|
|
Restrict the scan to a named region (string) or a
|
|
|
|
When |
|
|
|
Number of bases the scanning window spans. |
|
|
|
|
|
|
|
Override the automatically-computed state count. |
|
|
|
Dimension-name ordering for downstream multi-pool iteration. |
|
|
|
Prefix for the operation node name in the pool graph. |
|
|
|
Design card columns to include in library output. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see region_scan() in the
API Reference.
Examples
2-base spanning window (region_length=2)
A positive region_length creates spanning tags that enclose that many
bases at each scan position.
wt = pp.from_seq("ATCGATCG")
scan = pp.region_scan(wt, tag_name="win", region_length=2,
mode="sequential")
scan.print_library()
A<win>TC</win>GATCG
AT<win>CG</win>ATCG
ATC<win>GA</win>TCG
ATCG<win>AT</win>CG
ATCGA<win>TC</win>G
ATCGAT<win>CG</win>
Scan constrained to a named region (region)
Restrict the window scan to the cre region; flanks are fixed.
wt = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
scan = pp.region_scan(wt, tag_name="win", region_length=2,
region="cre", mode="sequential")
scan.print_library()
AAAA<cre>A<win>TC</win>GATCG</cre>TTTT
AAAA<cre>AT<win>CG</win>ATCG</cre>TTTT
... (7 total)
Scan only specific positions (positions parameter)
Pass an explicit list to positions to visit only chosen window starts.
wt = pp.from_seq("ATCGATCG")
scan = pp.region_scan(wt, tag_name="win", region_length=2,
positions=[0, 3, 6], mode="sequential")
scan.print_library()
ATC<win>GA</win>TCG
ATCGAT<win>CG</win>
See region_scan().