from_seq

Create a pool containing a single, fixed sequence. Inline region tags (<name>...</name>) delimit named segments for later targeting by mutagenesis, scan, or replacement operations.

import poolparty as pp
pp.init()

Parameters

Parameter

Type

Default

Description

seq

str

(required)

The sequence string. Inline region tags (<name>...</name>) are parsed and registered automatically.

pool

Pool | None

None

Background pool. When provided with region, the content of that region is replaced by seq. Requires region.

region

str | None

None

Region to replace in pool. Required when pool is provided.

remove_tags

bool | None

None

If True, strip region tags from the output.

style

str | None

None

Display style applied to the sequence (affects rendering only).

iter_order

int | None

None

Dimension-name ordering for downstream multi-pool iteration.

prefix

str | None

None

Prefix for auto-generated sequence names.


Note

Only the most commonly used parameters are shown above. For the full parameter list, see from_seq() in the API Reference.

Examples

Basic single sequence

Create a pool from a plain sequence string.

pool = pp.from_seq("ACGTACGT")
pool.print_library()
pool: seq_length=8, num_states=1 ACGTACGT

Sequence with embedded region tags

Inline tags define named regions that downstream operations can target.

wt = pp.from_seq("AAAA<promoter>TATAAA</promoter><core>ATCGATCG</core>TTTT")
wt.print_library()
wt: seq_length=22, num_states=1 AAAA<promoter>TATAAA</promoter><core>ATCGATCG</core>TTTT

Applying a display style

style controls how the sequence is rendered without changing its value.

pool = pp.from_seq("ACGTACGT", style="blue bold")
pool.print_library()
pool: seq_length=8, num_states=1 ACGTACGT

Replacing a named region in a background pool

Provide pool and region to substitute the content of a tagged region.

import poolparty as pp
pp.init()
wt     = pp.from_seq("AAAA<cre>ATCG</cre>TTTT")
mutant = pp.from_seq("GGGG", pool=wt, region="cre")
wt.print_library()
mutant.print_library()
wt: seq_length=12, num_states=1 AAAA<cre>ATCG</cre>TTTT
mutant: seq_length=4, num_states=1 AAAA<cre>GGGG</cre>TTTT

See from_seq().