GRASP Library Designer
Codon-optimize GRASP (Farley et al., NAR 2025) binder DNA for Golden Gate assembly.
PyPI: grasp-library-designer · Import: grasp_library · Python: ≥3.10 · License: AGPL-3.0
What this is
GRASP is a modular PPR (pentatricopeptide repeat) RNA-binding protein platform. Binders are assembled from level −1 DNA modules with fixed Golden Gate overhangs. This package redesigns those DNA sequences (synonymous codons only) so that:
- Ligation fidelity of the Golden Gate overhang set is high (Potapov / GGAssembler tables)
- Codon usage matches a chosen organism table (Kazusa or custom)
- Synthesis fitness stays within vendor constraints (GC, homopolymers, repeats, forbidden sites)
Protein sequence is never changed. Coding Golden Gate overhang bases stay locked via a per-part coding_mask.
Two entry points:
| Path | When to use |
|---|---|
| One-shot | One target RNA → continuous binder protein → free GGA cut sites → oligos |
| Library | Redesign the 42-module combinatorial catalog, then GAP-compile any target RNA |
Open in Google Colab
Click a badge → run 0 · Install (PyPI) → fill the forms top to bottom. No GitHub token needed.
| Notebook | Open |
|---|---|
| One-shot (one RNA → free GGA oligos) | |
| Library (42-module redesign → GAP compile) |
Each notebook installs with:
%pip install -q -U "grasp-library-designer>=0.1.5"
Bundled GenBank modules and Potapov ligation tables ship inside the PyPI package (materialize_project()).
Install locally
pip install grasp-library-designer
# optional notebook extras
pip install "grasp-library-designer[notebook]"
from grasp_library import materialize_project, build_default_config, LigationFidelityCalculator
project = materialize_project() # ./grasp_library_project + GenBank
config = build_default_config(project / "input")
print(LigationFidelityCalculator(25, 18).set_fidelity(["AATG", "GATA"]))
Write the Forms notebooks to disk from a blank environment:
%pip install -q -U grasp-library-designer
from grasp_library import write_notebook
write_notebook("oneshot") # or "library"
Repository layout
grasp_library/ # installable Python package
binder.py # RNA → PPR code → binder AA
oneshot.py # one-shot design pipeline
workflows.py # library redesign / anneal / GAP compile
optimizer.py # masked codon + synthesis anneal
objectives.py # fidelity / codon / synthesis scores
pareto.py # multi-objective overhang search
ligation_fidelity.py # Potapov table wrapper
import_grasp.py # GenBank → parts / junctions / GAP
gga_split.py # free cut-site planner (one-shot)
codon_*.py / kazusa.py # codon tables & organism validation
control_panel.py # notebook widgets + default config
paths.py # materialize_project()
data/profiles/grasp_nar2025/ # bundled GenBank modules
notebooks/ # Colab Forms notebooks
third_party/dawdlib_golden_gate/ # vendored GGAssembler fidelity (AGPL)
grasp_library_project/ # writable working tree (created locally)
input/ # parts, junctions, codon table, config
output/ # oligos, Pareto CSVs, assembly plans
profiles/.../genbank/ # copied GenBank for import
grasp_oneshot_designer.ipynb # Colab / Jupyter UI (one-shot)
grasp_library_designer.ipynb # Colab / Jupyter UI (library)
Project folder (grasp_library_project/)
Created by materialize_project(). Standard paths:
| Path | Role |
|---|---|
input/parts.csv |
Module AA sequences, coding masks, oligo flanks |
input/parts_full.csv |
Native CDS + overhang coordinates (sidecar) |
input/junction_map.csv |
Fixed mask_start_0based for shared 9S junctions |
input/overhang_candidates.csv |
Native + synonym-compatible 4-mers |
input/target_map.csv |
Module catalog for GAP part picking |
input/codon_usage.csv |
Organism codon table in use |
input/config.yaml |
Optimizer, ligation, synthesis, Pareto settings |
output/ |
Redesigned oligos, Pareto fronts, assembly plans |
Regenerate notebook inputs from GenBank:
python -m grasp_library.import_grasp
Or in Python:
from grasp_library import project_paths, ensure_grasp_imported
paths = project_paths()
tables = ensure_grasp_imported(
profile_genbank_dir=paths["profile_genbank"],
input_dir=paths["input"],
)
GRASP profile (Farley et al., NAR 2025)
- Paper: https://academic.oup.com/nar/article/53/20/gkaf1169/8321212
- Upstream data: https://github.com/farleykvdg/GRASP
- Bundled:
GRASP_-1.gb(42 modules) + individualpPR-1_*.gbplasmids
Default 9S overhang set (cut indices are fixed; bases may be synonym-swapped):
AGGT – ACTC – AAGA – GCAC – TGAA – CTTC – ACTC – AAGA – GCAC – TGAA – TTCG
B/C/D junctions are shared across CDS1/CDS2, so redesign uses 7 unique junction variables (J_Nterm … J_Cterm). Prefer 1A_*_AGGT for MoClo N-terminal fusion; AATG variants are kept as alternate parts.
Pipelines
One-shot (run_oneshot_design)
No combinatorial library. Builds a continuous binder from the PPR recognition code.
- RNA → protein — target length must be 9, 14, or 19 nt; classic PPR pairs
(5th, last)fill a GRASP repeat scaffold - Anneal full CDS — synonymous codon + synthesis optimization (
coding_maskallN) - Plan GGA cuts — choose codon-aligned overhangs already present in the DNA that form a high-fidelity set
- Export oligos — flanks + fragment DNA (FASTA / CSV)
from grasp_library import (
materialize_project,
build_default_config,
apply_organism_codon_table,
run_oneshot_design,
)
project = materialize_project()
config = build_default_config(project / "input")
codon_data = apply_organism_codon_table(
project / "input",
"Chlamydomonas reinhardtii nuclear (Kazusa)",
)
result = run_oneshot_design(
target_rna="UUACACGUG",
codon_data=codon_data,
config=config,
output_dir=project / "output",
)
Library (run_library_redesign_and_anneal → GAP compile)
Redesigns the shared module catalog, then picks parts for a target RNA.
- Import GenBank →
parts.csv, junction map, overhang candidates - Pareto overhang redesign (optional) — search synonym-compatible 4-mers; score ligation fidelity, codon optimality, synthesis; pick knee / max-fidelity
- Write overhangs into masks — lock chosen 4-mers at fixed cut indices
- Anneal library — masked CDS optimization for every module → oligos
- Rescore / plot Pareto (optional) — uniform post-anneal scores
- GAP compile — pick modules for a target RNA and stitch assembled CDS + ordered oligos
from grasp_library import (
project_paths,
build_default_config,
apply_organism_codon_table,
ensure_grasp_imported,
run_library_redesign_and_anneal,
export_optimized_library,
compile_and_assemble_target,
)
paths = project_paths()
config = build_default_config(paths["input"])
codon_data = apply_organism_codon_table(
paths["input"],
"Chlamydomonas reinhardtii nuclear (Kazusa)",
)
tables = ensure_grasp_imported(
profile_genbank_dir=paths["profile_genbank"],
input_dir=paths["input"],
)
result = run_library_redesign_and_anneal(
parts=tables["parts"],
codon_data=codon_data,
config=config,
input_dir=paths["input"],
output_dir=paths["output"],
)
export_optimized_library(
result["optimized_library"],
paths["output"],
selected_overhangs=result["selected_overhangs"],
)
assembly = compile_and_assemble_target(
target_rna="UUACACGUG",
optimized_library=result["optimized_library"],
config=config,
input_dir=paths["input"],
output_dir=paths["output"],
codon_data=codon_data,
)
Typical library outputs
| File | Contents |
|---|---|
pareto_front.csv |
Evaluated overhang sets and objective scores |
selected_overhangs.csv |
Chosen junction → overhang mapping |
parts_with_redesigned_junctions.csv |
Parts with updated coding masks |
optimized_library.csv / optimized_grasp_oligos.* |
Annealed CDS + GGA oligos |
assembly_plan_<RNA>.csv |
GAP part order for one target |
assembled_<RNA>.fasta |
Stitched coding sequence |
oligos_<RNA>.csv / .fasta |
Ordered oligos for that assembly |
Design constraints and objectives
Hard constraints
- Synonymous redesign only (protein fixed)
- Coding overhang bases locked in
coding_mask(N= free,A/C/G/T= fixed) - Forbidden restriction sites from config (default BsaI / BpiI / BsmBI)
- Translation must match the organism codon table / genetic code
Objectives (all maximized)
| Objective | Meaning |
|---|---|
ligation_fidelity |
Potapov set fidelity for the overhang collection |
codon_optimality |
Mean log relative adaptiveness vs organism table |
synthesis |
Weighted GC / local GC / homopolymer / repeat / library-similarity score |
Weights and anneal schedule live under weights: and optimizer: in config.yaml.
Config highlights (input/config.yaml)
| Section | Controls |
|---|---|
forbidden_sites |
Enzyme → recognition sequence |
synthesis |
Global/window GC, max homopolymer, repeat k, oligo length bounds |
codon_optimization |
Minimum relative adaptiveness |
weights |
Objective component weights for anneal |
optimizer |
Simulated-annealing iterations, temperature, orthogonal versions |
ligation |
Temperature, hours, min efficiency/fidelity, Potapov table |
overhang_redesign |
enabled, selection (knee / max_fidelity / exact overhang string) |
pareto |
max_evaluations, beam_width, junction flank |
target_rna |
Default RNA for GAP compile |
selected_organism |
Label of active codon table |
Notebook control panels write this file via GraspControlPanel / build_default_config.
Binder protein (PPR code)
Classic recognition pairs (5th AA, last AA of each ~31-aa repeat):
| RNA | Code |
|---|---|
| A | TN |
| C | NN |
| G | TD |
| U / T | ND |
Scaffold: N-terminal solvating helix + one repeat per base (W{fifth}AM…PER{last}VVS), matching Farley et al. 9S native assemblies. Target RNA length must be 9, 14, or 19.
from grasp_library import describe_binder
print(describe_binder("UUACACGUG"))
Package API (selected)
| Symbol | Role |
|---|---|
materialize_project / project_paths |
Create writable project + copy GenBank |
build_default_config |
Default YAML-backed config |
ensure_grasp_imported / import_grasp_profile |
GenBank → CSV tables |
run_oneshot_design |
One-shot RNA → oligos |
run_library_redesign_and_anneal |
Pareto overhangs + library anneal |
run_overhang_redesign / run_library_optimize |
Pipeline steps separately |
compile_and_assemble_target |
GAP compile + stitch CDS |
export_optimized_library |
CSV / FASTA / Excel export |
optimize_coding_sequence / optimize_library |
Low-level anneal |
LigationFidelityCalculator |
Potapov fidelity queries |
plot_pareto_front / plot_library_pareto_after_anneal |
Visualization |
apply_organism_codon_table / fetch_kazusa_codon_table |
Codon tables |
write_notebook |
Drop Colab Forms notebooks to disk |
Full public surface is listed in grasp_library.__all__.
Develop from source
git clone https://github.com/JustABiologist/grasp-library-designer.git
cd grasp-library-designer
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[notebook,dev]"
Build / publish (maintainers):
python -m build
twine check dist/*
Citation and license
Software: AGPL-3.0 (required by the vendored GGAssembler / dawdlib ligation engine). See LICENSE and THIRD_PARTY_LICENSES.md.
GRASP sequences / biology: Farley et al., Nucleic Acids Research 2025 — https://academic.oup.com/nar/article/53/20/gkaf1169/8321212
Ligation frequency data: Potapov et al., ACS Synthetic Biology (2018), via Fleishman-Lab/GGAssembler.
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 grasp_library_designer-0.1.7.tar.gz.
File metadata
- Download URL: grasp_library_designer-0.1.7.tar.gz
- Upload date:
- Size: 261.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
955f385ad1ccfd66624912fbb39a57bbd1eadb6265e331657b0344c5b963b38d
|
|
| MD5 |
4cef36e900ae958a93bfc39a91796fc2
|
|
| BLAKE2b-256 |
b0ed887313d67b37c731f361e5c6af6b1967fe7c1c0403e654f042fa54b4397d
|
File details
Details for the file grasp_library_designer-0.1.7-py3-none-any.whl.
File metadata
- Download URL: grasp_library_designer-0.1.7-py3-none-any.whl
- Upload date:
- Size: 340.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3982c4cf8c37154391bdc5f646d1565ffb233272e383b312b5067dfe32eae79d
|
|
| MD5 |
ae1384599430af95b716d73f211fb4ef
|
|
| BLAKE2b-256 |
1c331ca92bb647d43356d90d5ab5767923535fd38e7ea2b62990169a5392c598
|