add_prefix

Add a label prefix to sequence names without modifying the sequences themselves. Useful for marking which branch of a pipeline produced each sequence.

import poolparty as pp
pp.init()

Parameters

Parameter

Type

Default

Description

pool

Pool

(required)

Input pool.

prefix

str

(required)

Prefix string appended to each sequence name.

iter_order

float | None

None

Enumeration order when combined with other pools.


Note

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

Examples

Label sequences from a pipeline branch

Operations like mutagenize can assign a prefix to each sequence name. add_prefix appends an additional label, letting you distinguish sequences that came from different branches of a design.

wt     = pp.from_seq("ATCG")
muts   = pp.mutagenize(wt, num_mutations=1, mode="sequential",
                       prefix="mut")
tagged = pp.add_prefix(muts, "batch1")
df     = tagged.generate_library(num_seqs=5)
df — 5 rows × 2 columns
nameseq
mut_00.batch1CTCG
mut_01.batch1GTCG
mut_02.batch1TTCG
mut_03.batch1AACG
mut_04.batch1ACCG

See add_prefix().