ipdassembly
Golden Gate assembly library design: split designs to a chip oligo length, pick overhangs with a greedy solver and/or a genetic algorithm, reverse-translate protein input, clear enzyme sites by synonymous substitution, add adapters/primers/padding, report a per-design success probability, and QC by in-silico digest and re-assembly.
pip install "ipdassembly[all]"
or use it with no install at all — it is pure Python with its data bundled, so
sys.path.insert(0, "IPDassembly/src") is enough if you already have numpy, pandas, biopython and
tqdm. See docs/install.md.
from ipd_assembly import Config, Designer
d = Designer(Config(vector="LM0627", oligo_length=230, designs_per_rxn=8))
df = d.run(fasta_files=["library.fa"])
ipdassembly run library.fa --oligo-length 230 --designs-per-rxn 8
Or use a notebook — two ship, differing only in how they install and where files come from:
notebooks/IPDassembly_colab.ipynb |
open in Colab: installs the package, upload widget, downloads a zip. No local setup at all |
notebooks/IPDassembly_local.ipynb |
run it in your own Jupyter. Defaults to the bundled example, so it works top to bottom before you change anything |
Documentation
| docs/install.md | pip, uv, from a git tag, Colab, development install |
| docs/input-modes.md | designs vs. predefined sets, giving the vector, the None backbones, additional overhangs to avoid |
| docs/chip-orders.md | several libraries in one oligo order, subpool addressing, plates and wells |
| docs/pooling.md | how many designs per reaction, the off_target_allowed ladder, the two solvers, fidelity correction |
| docs/api.md | Config field by field, Designer methods, every module-level function |
| docs/cli.md | the ipdassembly command |
| docs/enzymes.md | enzyme table, the five bundled ligation matrices, registering your own |
| docs/mcp.md | driving it from an AI client instead — optional, one config entry |
| docs/provenance.md | what each module came from, the bugs fixed on the way, how the tests pin it |
What it takes as input
| you give | what it does | |
|---|---|---|
| designs | whole sequences, protein or DNA, mixed is fine | reverse-translate, domesticate, split to the oligo length, choose overhangs, pool |
| predefined sets | the fragments themselves, named Set<N>-... |
takes them as given, reads the assembly order back out of the overhangs they carry, scores the well |
Either way the vector is separate from the FASTA and can be a registered name, a backbone
sequence, the two sticky ends outright, or nothing at all ("None" / "None-BsaI") when the
fragments carry their own ends. See docs/input-modes.md.
Several libraries in one order. Pass more than one FASTA and each becomes a subpool with its
own plates and its own primers, so they share a chip but still amplify apart. Libraries needing
different vectors or oligo lengths — or a predefined set alongside protein designs — go through
order_chip. See docs/chip-orders.md.
Designing and ordering are two steps, because the slow half (splitting, choosing overhangs) and the instant half (adapters, primers, padding, addressing) have different scopes — so changing the chip layout costs a second, not a re-solve.
from ipd_assembly import Config, Subpool, design_campaign, build_order
lib = design_campaign([
Subpool("binders", "binders.fa", input_type="protein", vector="LM0627", pooled=True),
Subpool("controls", "controls.fa", input_type="protein", vector="LM0627", pooled=False),
Subpool("presets", "presets.fa", vector="None-BsaI", input_mode="predefined_set"),
], base=Config(oligo_length=300))
order = build_order(lib, output_prefix="out/run7_")
Three things to decide before anything else
Everything downstream follows from these, and none of them has a defensible default.
| why it cannot be guessed | |
|---|---|
| oligo length | what the vendor will synthesise. It sets how many fragments each design splits into |
| vector | a registered name, a backbone (plus the enzyme), or the two sticky ends outright |
| multiplexed or single | one design per reaction or multiplexed pooling designs |
The fourth number — designs per reaction — you should not decide: it is measured from your own sequences in well under a second.
d.recommend_designs_per_rxn(sequences, off_target_allowed=12)
# -> {"designs_per_rxn": 7, "n_fragments": 4, "pool_fidelity": 0.79, ...}
d.plan_pooling(sequences, target=15) # or ask for a number and be told what it costs
docs/pooling.md has the measured tables behind both.
Pipeline
FASTA ─┬─ DNA ───────────────────────────────┐
├─ protein → reverse translate ───────┤
└─ Set<N>- names → predefined set ────┤ (fragments taken as given)
↓ domesticate (clear pre-existing enzyme sites)
↓ split to the oligo length
greedy MRV/LCV overhang pick (~5 ms) ── pool filled → done
↓ pool not filled
GA seeded from the greedy solution (~10 s)
↓ designs still unplaced
synonymous codon swap → reshuffle → retry
↓
pool fidelity → per-design success probability
↓
enzyme adapters / vector sticky ends / nested PCR primers / padding
↓
QC: primer placement, cut counts, re-assembly, translation
↓
CSV + fragments / oligos / new-template FASTA
Oligo layout — the pad sits on the 3' side, so the forward primer abuts the enzyme site:
F1 ── enzyme site ── (sticky) ── fragment ── (sticky) ── enzyme site ── pad ── R2 ── R1
└──────────────────── oligo_length when pad_to_fixed_length=True ────────────────────┘
Tests
pip install -e ".[dev]"
pytest -q # ~140 tests, ~3 min
tests/test_golden.py pins output against the validated reference implementation — discrete
columns byte-for-byte, fidelity floats to 16 ULP. tests/test_determinism.py runs the pipeline
under two different PYTHONHASHSEED values and requires identical output.
tests/test_notebook.py executes every cell of the shipped notebook.
License
Code: MIT — see LICENSE.
Bundled data: the overhang-ligation matrices are from Pryor JM et al. (2020) PLoS ONE 15(9):
e0238592, used under CC BY 4.0 — see NOTICE, docs/enzymes.md and
src/ipd_assembly/data/SOURCES.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ipdassembly-0.4.0.tar.gz.
File metadata
- Download URL: ipdassembly-0.4.0.tar.gz
- Upload date:
- Size: 175.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076a8f02a5a7409616b3d471a6d8e871a0fababb194d53d03873d866b9f4427b
|
|
| MD5 |
38ecf902ea1f19752eea73a4ef69b7f9
|
|
| BLAKE2b-256 |
0c0141e259c5d6ce65e8b92c86a0e844d5ea8aa73d8a4053009e2bf1680fd0ce
|
File details
Details for the file ipdassembly-0.4.0-py3-none-any.whl.
File metadata
- Download URL: ipdassembly-0.4.0-py3-none-any.whl
- Upload date:
- Size: 151.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3189cc90f5984e6e7059fc48f88c8af47884e65810cce91300353993b811ac9e
|
|
| MD5 |
eb547d994bce72ea7300b60a2c964525
|
|
| BLAKE2b-256 |
d25bdf22987a31de3fdeb0d1d02f2191258ab5acfeccf14431042aefae94c403
|