Operations

PoolParty provides composable operations for designing DNA sequence libraries. Each operation returns a new Pool, so calls can be chained into a declarative pipeline. All examples assume:

import poolparty as pp
pp.init()

Key concepts

Most operations accept a mode parameter that controls whether outputs are enumerated exhaustively (sequential), sampled randomly (random), or uniquely determined by the input (fixed). Each operation has internal states determined by its mode and parameters — see Operation Modes for details.

When operations are combined, their internal states compose to determine the output pool’s num_states — through multiplication, addition, or other rules depending on the operation. See Library Size for details and a worked example.

Every operation that accepts a pool argument is also available as a method on any Pool. pp.mutagenize(wt, ...) and wt.mutagenize(...) are equivalent, so operations can be chained left-to-right into a pipeline.


Source Operations

Create the initial Pools from which all downstream Pools are constructed. See Source Operations.


Transformation Operations

Modify sequence content through mutations, positional scanning, region manipulation, codon-level operations, and deterministic transforms.


Composition Operations

Combine sequences from multiple Pools, either by concatenating sequences end-to-end or by merging state spaces. See Composition Operations.


State Operations

Control which sequences are in a Pool and how they are ordered, including methods to replicate, sample, filter, score, and synchronize. See State Operations.