Constructs
A Construct is an ordered collection of Segments representing a complete biological design. Just as a gene is assembled from regulatory and coding parts (a promoter, ribosome binding site, coding sequence, and terminator), a Construct assembles Segment objects into a coherent whole. The Construct handles validation (all segments must share the same type), auto-labeling, and, crucially, joined sequence concatenation, which gives the full designed sequence after optimization.Creating Constructs
Pass an ordered list of Segments to create a Construct:python
Validation Rules
Constructs enforce several rules at creation time to catch design errors early:python
Joined Sequences
The most important property of a Construct isjoined_sequences. After optimization, this gives the full concatenated sequence from all segments, with merged metadata from each segment.
python
Multiple Results (Top-K)
When the optimizer selects multiple results per segment (e.g., top-3),joined_sequences pairs them by index:
python
All segments in a Construct must have the same number of result sequences.
joined_sequences raises a RuntimeError if the per-segment result pools have mismatched lengths.Auto-Labeling
Both Constructs and Segments support automatic labeling:python
Biological Design Patterns
- Gene Expression
- Multi-Domain Protein
- CRISPR System
- Plasmid Insert
The classic pattern for designing gene circuits: promoter, RBS, coding sequence, and terminator in series.Use cross-segment constraints to evaluate predicted expression levels considering all elements together.
python
Working with Optimizers
Optimizers take a list of Constructs to optimize. Multiple optimizers in a Program must share the same Construct objects by identity so that results persist between stages.python
Properties
Serialization
Constructs serialize to dictionaries, including all their segments and both sequence pools:Next Steps
Generators
How generators propose candidate sequences for each segment
Constraints
Scoring functions for design objectives
Programs
Chain optimizers into multi-stage pipelines
Overview
See how Constructs fit into the full architecture