stylize
Attach an inline display style to sequences (or to a named region) without
modifying the underlying bases. Styles control the colour and weight used when
printing pools to the terminal or rendering them in HTML documentation. Use
which= to target only uppercase characters, lowercase characters, gap
characters, or the full contents of a region; regex= allows arbitrary
pattern-based targeting.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
Parent pool or sequence string to stylize. |
|
|
|
Region to restrict styling (marker name or |
|
|
(required) |
Style specification (e.g. |
|
|
|
Pattern selector when |
|
|
|
Custom regex; when set, overrides |
|
|
|
Iteration order priority for the operation. |
|
|
|
Prefix for sequence names in the resulting pool. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see stylize() in the
API Reference.
Examples
Stylize a named region with a built-in style
Apply red bold to the cre region so it stands out when the pool is
displayed.
wt = pp.from_seq("AAAA<cre>ATCG</cre>TTTT")
styled = pp.stylize(wt, region="cre", style="red bold")
styled.print_library()
Stylize a different region with a different style
Apply blue bold to a promoter region embedded in a longer construct,
leaving the rest of the sequence unstyled.
wt = pp.from_seq("GCGCGC<promoter>TATAAT</promoter>ATGAAATTT")
styled = pp.stylize(wt, region="promoter", style="blue bold")
styled.print_library()
Stylize the full sequence
Omit region= to apply a style to every base in the sequence.
wt = pp.from_seq("ATCGATCG")
styled = pp.stylize(wt, style="cyan")
styled.print_library()
See stylize().