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 |
|---|---|---|---|
|
|
(required) |
Input pool. |
|
|
(required) |
Prefix string appended to each sequence name. |
|
|
|
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
| name | seq |
|---|---|
| mut_00.batch1 | CTCG |
| mut_01.batch1 | GTCG |
| mut_02.batch1 | TTCG |
| mut_03.batch1 | AACG |
| mut_04.batch1 | ACCG |
See add_prefix().