from_seqs
Create a pool that draws from an explicit list of sequences. By default the
pool samples uniformly at random; pass mode='sequential' to iterate
through the list in order.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
List of DNA strings. Must not be empty. |
|
|
|
Background pool. When provided with |
|
|
|
Region to replace in |
|
|
|
Explicit label for each sequence; populates the |
|
|
|
Prefix for auto-generated names (e.g. |
|
|
|
|
|
|
|
Number of states to generate. In |
|
|
|
Dimension-name ordering for downstream multi-pool iteration. |
|
|
|
Display style applied to every generated sequence. |
|
|
|
Design card columns to include in library output. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see from_seqs() in the
API Reference.
Examples
Basic list, random mode
mode='random' (the default) — each draw picks one sequence uniformly at
random. This example sets it explicitly and shows one representative draw.
pool = pp.from_seqs(
["AAAA", "CCCC", "GGGG", "TTTT"],
mode="random",
)
pool.print_library()
Sequential mode
mode='sequential' iterates through the list in order — useful for
reproducible, ordered enumeration of a fixed variant set.
pool = pp.from_seqs(
["ATCG", "CGTA", "GCAT"],
mode="sequential",
)
pool.print_library()
CGTA
GCAT
Custom sequence names
seq_names assigns meaningful labels that appear in library output.
pool = pp.from_seqs(
["ATCG", "ATAG", "AACG"],
seq_names=["wt", "mut_A", "mut_B"],
mode="sequential",
)
pool.print_library()
mut_A ATAG
mut_B AACG
Cycling with num_states
In sequential mode, num_states greater than len(seqs) cycles through
the list to produce the requested number of output rows.
pool = pp.from_seqs(
["AAAA", "CCCC"],
mode="sequential",
num_states=6,
)
pool.print_library()
CCCC
AAAA
CCCC
AAAA
CCCC
Inserting into a named region
Provide pool and region to insert each sequence into a fixed context.
bg = pp.from_seq("AAAA<cre>XXXX</cre>TTTT")
pool = pp.from_seqs(
["ACGT", "TGCA", "GGCC"],
pool=bg,
region="cre",
mode="sequential",
)
pool.print_library()
AAAA<cre>TGCA</cre>TTTT
AAAA<cre>GGCC</cre>TTTT
See from_seqs().