region_multiscan
Insert multiple named region tags into a sequence simultaneously,
producing one variant per combination of non-overlapping tag positions.
Use mode='sequential' to enumerate every valid arrangement
deterministically; mode='random' samples one arrangement per draw.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
The Pool to scan. Can also be a plain sequence string. |
|
|
(required) |
Tag name(s) to insert. A single string is reused for every insertion; a list assigns one name per insertion. |
|
|
(required) |
Number of region tags to insert simultaneously. |
|
|
|
Valid insertion positions (0-based, nontag-relative). A flat
list or |
|
|
|
Restrict the scan to a named region (string) or a
|
|
|
|
When |
|
|
|
Number of bases each scanning window spans. |
|
|
|
|
|
|
|
Minimum gap (in bases) between adjacent region tags. |
|
|
|
Maximum gap (in bases) between adjacent region tags. |
|
|
|
Prefix for the operation node name in the pool graph. |
|
|
|
|
|
|
|
Override the automatically-computed state count. |
|
|
|
Enumeration order when combined with other pools. |
|
|
|
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_multiscan() in the
API Reference.
Examples
Unordered insertion mode (insertion_mode)
By default (insertion_mode='ordered'), a is always placed to the
left of b. Setting insertion_mode='unordered' allows either tag
to appear at any position, doubling the state count (10 ordered vs 20
unordered on a 4-mer).
wt = pp.from_seq("ATCG")
scan = pp.region_multiscan(wt, tag_names=["a", "b"],
num_insertions=2, region_length=0,
insertion_mode="unordered",
mode="sequential")
scan.print_library()
<a/>AT<b/>CG
<a/>ATC<b/>G
<a/>ATCG<b/>
<b/>A<a/>TCG
A<a/>T<b/>CG
A<a/>TC<b/>G
A<a/>TCG<b/>
<b/>AT<a/>CG
A<b/>T<a/>CG
AT<a/>C<b/>G
AT<a/>CG<b/>
<b/>ATC<a/>G
A<b/>TC<a/>G
AT<b/>C<a/>G
ATC<a/>G<b/>
<b/>ATCG<a/>
A<b/>TCG<a/>
AT<b/>CG<a/>
ATC<b/>G<a/>
Multiscan within a named region
Restrict both tag insertions to within the cre region; flanking
bases are never modified.
wt = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
scan = pp.region_multiscan(wt, tag_names=["a", "b"],
num_insertions=2, region_length=0,
region="cre", mode="sequential")
scan.print_library()
AAAA<cre><a/>AT<b/>CGATCG</cre>TTTT
AAAA<cre><a/>ATC<b/>GATCG</cre>TTTT
AAAA<cre><a/>ATCG<b/>ATCG</cre>TTTT
AAAA<cre><a/>ATCGA<b/>TCG</cre>TTTT
... (36 total)
See region_multiscan().