remove_tags
Remove XML-style region tags from sequences, either keeping or discarding the enclosed bases. After removal the region is no longer tracked by the pool.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
The Pool to remove tags from. Can also be a plain sequence string. |
|
|
(required) |
Name of the region whose tags should be removed. |
|
|
|
When |
|
|
|
Dimension-name ordering for downstream multi-pool iteration. |
|
|
|
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 remove_tags() in the
API Reference.
Examples
Keep content (default)
Strip the cre tags but leave the four enclosed bases in place.
wt = pp.from_seq("AAAA<cre>ATCG</cre>TTTT")
cleaned = pp.remove_tags(wt, "cre")
cleaned.print_library()
Drop content (keep_content=False)
Delete both the tags and the enclosed bases, shortening the sequence.
wt = pp.from_seq("AAAA<cre>ATCG</cre>TTTT")
dropped = pp.remove_tags(wt, "cre", keep_content=False)
dropped.print_library()
Strip scan tags while keeping another region
After region_scan() the scanning tag remains in every
sequence. Use remove_tags to strip it while leaving the cre region
tag intact. All seven scan positions collapse to the same visible sequence
once the win tag is removed.
wt = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
scan = pp.region_scan(wt, tag_name="win", region_length=2,
region="cre", mode="sequential")
out = pp.remove_tags(scan, "win")
out.print_library()
AAAA<cre>ATCGATCG</cre>TTTT
AAAA<cre>ATCGATCG</cre>TTTT
AAAA<cre>ATCGATCG</cre>TTTT
AAAA<cre>ATCGATCG</cre>TTTT ... (7 total)
Remove two regions sequentially
Call remove_tags once per region name to clear multiple tags.
wt = pp.from_seq("AAAA<left>ATCG</left>GGGG<right>CCCT</right>TTT")
step1 = pp.remove_tags(wt, "left")
clean = pp.remove_tags(step1, "right")
clean.print_library()
See remove_tags().