extract_region
Extract the content of a named region as a new pool. The flanking sequence is discarded and the result contains only the bases inside the region tags.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
Input pool or sequence string containing the named region. |
|
|
(required) |
Name of the region whose content will be extracted. |
|
|
|
If |
|
|
|
Enumeration order when combined with other pools. |
|
|
|
Prefix for the operation node name in the pool graph. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see extract_region() in the
API Reference.
Examples
Extract a tagged region
Pull the content of the cre region out of a flanked sequence.
bg = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
content = pp.extract_region(bg, "cre")
content.print_library()
Extract and reverse-complement
Use rc=True to get the reverse complement of the region content — useful
for antisense constructs.
bg = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
content_rc = pp.extract_region(bg, "cre", rc=True)
content_rc.print_library()
Extract from a multi-state pool
When the parent pool has multiple states, each state’s region content is extracted independently.
bg = pp.from_seq("AAAA<ins>NNNN</ins>TTTT")
filled = pp.replace_region(bg, pp.from_iupac("NNNN", mode="sequential"),
region_name="ins", sync=False, keep_tags=True)
content = pp.extract_region(filled, "ins")
content.print_library()
AAAC
AAAG
AAAT
AACA
... (256 total)
See extract_region().