Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a70c7a5
established missing implementation warning framework
doublergreer Mar 26, 2026
2653177
incorrect draft of lvl2
doublergreer Mar 31, 2026
8f8c624
resolving original plasmid part overwrite issue in digestion
doublergreer Mar 31, 2026
6083612
unique objects for each lvl1 + passing in final doc for continuity
doublergreer Apr 1, 2026
7f68281
only grab first and last fusion site from new composite
doublergreer Apr 1, 2026
53716c0
codex check
doublergreer Apr 2, 2026
1ad96f2
backbone now listed last in product
doublergreer Apr 6, 2026
fd65c9a
type correction on ligation products
doublergreer Apr 7, 2026
ee7451f
function to simplify complex plasmid part representation to a scar-TU…
doublergreer Apr 7, 2026
5640cd8
intermediate w/ annos not working
doublergreer Apr 8, 2026
d4ee967
encapsulate TU annotaitons and sequence
doublergreer Apr 14, 2026
e073084
constant list of tuples defining TU fusion site order for l2 assemblies
doublergreer Apr 14, 2026
3c26af0
grab first and last fusion site now in order they appear
doublergreer Apr 14, 2026
def5b8b
digestion now takes in Plasmid object; implementation selection happe…
doublergreer Apr 14, 2026
2747758
remove todo
doublergreer Apr 21, 2026
494ddcf
ligase and RE flow optimized + domestication added if not found
doublergreer Apr 21, 2026
69fea09
definition->identity
doublergreer Apr 21, 2026
d9fbdf2
lvl2 and multi-design lvl1 drafts
doublergreer Apr 27, 2026
88a3b44
docstring updates
doublergreer Apr 27, 2026
230f2ba
get referencing CD in extract toplevel definition
doublergreer Apr 28, 2026
de292b8
ironing out iterative lvl1
doublergreer Apr 28, 2026
a0f395c
better doc search in get_or_pull
doublergreer Apr 29, 2026
fb76b9c
added combinatorial design support to lvl1
doublergreer Apr 29, 2026
79b6b3a
new tests for digestion and ligation
doublergreer May 7, 2026
e622941
combinatorial test
doublergreer May 7, 2026
4e704fc
type and error handling adjustments
doublergreer May 8, 2026
a0bb9e0
adjusting backbone arg to allow for dictionary mapping design.display…
doublergreer May 8, 2026
cc967fe
type correction
doublergreer May 8, 2026
4e9f961
activity tests for digestion and ligation
doublergreer May 12, 2026
3dc25ee
test buildcompiler draft
doublergreer May 12, 2026
7d346cf
level 1 and first comb test complete
doublergreer May 12, 2026
da38668
removed superfluous prints
doublergreer May 12, 2026
d2fe409
new test suite
doublergreer May 12, 2026
feb64fa
synbiohub.org->api.synbiohub.org
doublergreer May 13, 2026
3384148
secret access for github job
doublergreer May 13, 2026
cecf73f
api for pulls only
doublergreer May 13, 2026
26e638d
api for collections
doublergreer May 13, 2026
f91e490
revert api for collections
doublergreer May 13, 2026
bb8d338
added server mode flag to add api. to canonical sbh registry uris
doublergreer May 13, 2026
776bc73
notebooks for creating various implementations used in buildcompiler
doublergreer May 13, 2026
767fa6b
decouple forward and reverse fusion site matching to fix skipped back…
doublergreer May 16, 2026
0454cfe
lvl2 working
doublergreer May 16, 2026
307f61c
lvl2 test draft
doublergreer May 17, 2026
9cebf0d
lvl1 TU tests for lvl2 assembly
doublergreer May 18, 2026
207b68c
transformation test
doublergreer May 18, 2026
1c67d56
notebook updates
doublergreer May 18, 2026
2237123
added transformation
doublergreer May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ jobs:
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
env:
SBH_USERNAME: ${{ secrets.SBH_USERNAME }}
SBH_PASSWORD: ${{ secrets.SBH_PASSWORD }}
run: |
python -m unittest discover -s tests
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,13 @@ uv run pre-commit install
```


#### Running tests:
#### Running tests locally:
Run these bash commands to establish your SynBioHub account for collection access. These are saved in GitHub secrets for the automated test suite.

`export SBH_USERNAME=your_username`

`export SBH_PASSWORD=your_password`

Then run the tests with:

`uv run python -m unittest discover -s tests`
252 changes: 197 additions & 55 deletions notebooks/build_compiler_test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,72 +12,239 @@
"from buildcompiler.abstract_translator import extract_toplevel_definition"
]
},
{
"cell_type": "markdown",
"id": "238f2456",
"metadata": {},
"source": [
"## Multi-Design Lvl 1 Testing:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e60a9c84",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['qlSBuNBL', 'i0mwvNcgH']\n"
]
}
],
"source": [
"design_doc = sbol2.Document()\n",
"design_doc.read(\"../tests/test_files/moclo_parts_circuit.xml\")\n",
"design = extract_toplevel_definition(design_doc)"
"design_path_list = [\n",
" \"../tests/test_files/moclo_parts_circuit.xml\",\n",
" \"../tests/test_files/mocloparts116.xml\",\n",
"]\n",
"design_defs = []\n",
"sbol_doc = sbol2.Document()\n",
"\n",
"for design in design_path_list:\n",
" temp_doc = sbol2.Document()\n",
" temp_doc.read(design)\n",
"\n",
" design_defs.append(extract_toplevel_definition(temp_doc))\n",
"\n",
" # sbol_doc.read(\"../tests/test_files/ExampleLvl2_design.xml\")\n",
"\n",
"print([design_def.displayId for design_def in design_defs])"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "90648527",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Indexing collection: https://synbiohub.org/user/Gon/impl_test/impl_test_collection/1\n",
"Indexing collection: https://synbiohub.org/user/Gon/Enzyme_Implementations/Enzyme_Implementations_collection/1\n"
]
}
],
"source": [
"auth = \"51102d98-f852-4386-9ae8-7c5814d679c1\"\n",
"auth = \"c6f22554-f057-4b4f-a597-67041d9002e5\"\n",
"collections = [\n",
" \"https://synbiohub.org/user/Gon/impl_test/impl_test_collection/1\",\n",
" \"https://synbiohub.org/user/Gon/Enzyme_Implementations/Enzyme_Implementations_collection/1\",\n",
"]\n",
"buildcompiler = BuildCompiler(collections, \"https://synbiohub.org\", auth, None)"
"buildcompiler = BuildCompiler(collections, \"https://synbiohub.org\", auth, sbol_doc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7c12e504",
"execution_count": 4,
"id": "19c5d2ff",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"https://synbiohub.org/user/Gon/Enzyme_Implementations/BbsI_impl/1 https://synbiohub.org/user/Gon/Enzyme_Implementations/BsaI_impl/1 https://synbiohub.org/user/Gon/Enzyme_Implementations/T4_Ligase_impl/1\n"
]
}
],
"source": [
"print(buildcompiler.BbsI_impl, buildcompiler.BsaI_impl, buildcompiler.T4_ligase_impl)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "6ec9e2fe",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[<sbol2.implementation.Implementation object at 0x10d99bf20>, <sbol2.implementation.Implementation object at 0x10dadc230>]\n",
"[<sbol2.implementation.Implementation object at 0x10dadc140>]\n",
"matched pJ23100_AB_A_B with DVK_AE_A_E on fusion site A!\n",
"matched pB0034_BC_B_C with pJ23100_AB_A_B on fusion site B!\n",
"matched pE0030_CD_C_D with pB0034_BC_B_C on fusion site C!\n",
"matched final component pB0015_DE_D_E with pE0030_CD_C_D and DVK_AE_A_E on fusion sites (D, E)!\n",
"Success with backbone: DVK_AE_A_E and plasmids: ['pJ23100_AB_A_B', 'pB0034_BC_B_C', 'pE0030_CD_C_D', 'pB0015_DE_D_E']\n",
"[Plasmid:\n",
" Name: composite_1_A_B_C_D_E\n",
" Plasmid Definition: https://SBOL2Build.org/composite_1/1\n",
"Success with backbone: DVK_AE_A_E and plasmids: ['pJ23116_AB_A_B', 'pB0034_BC_B_C', 'pE0030_CD_C_D', 'pB0015_DE_D_E']\n"
]
},
{
"data": {
"text/plain": [
"({'https://sbolcanvas.org/qlSBuNBL/1': [Plasmid:\n",
" Name: qlSBuNBL_composite_1_A_E\n",
" Plasmid Definition: http://buildcompiler.org/qlSBuNBL_composite_1/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['http://buildcompiler.org/qlSBuNBL_composite_1_impl/1']\n",
" Strain Implementations: [None]\n",
" Fusion Sites: ['A', 'E']\n",
" Antibiotic Resistance: Kanamycin],\n",
" 'https://sbolcanvas.org/i0mwvNcgH/1': [Plasmid:\n",
" Name: i0mwvNcgH_composite_1_A_E\n",
" Plasmid Definition: http://buildcompiler.org/i0mwvNcgH_composite_1/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['http://buildcompiler.org/i0mwvNcgH_composite_1_impl/1']\n",
" Strain Implementations: [None]\n",
" Fusion Sites: ['A', 'E']\n",
" Antibiotic Resistance: Kanamycin]},\n",
" <sbol2.document.Document at 0x1110c3610>)"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"product_doc = sbol2.Document()\n",
"\n",
"buildcompiler.assembly_lvl1(design_defs, product_doc)"
]
},
{
"cell_type": "markdown",
"id": "00834b0c",
"metadata": {},
"source": [
"## LVL 2"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3e2272ff",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Gen\n",
"Gen1\n",
"Plasmid:\n",
" Name: Gen_Gen1_plas_1_simple_A_E\n",
" Plasmid Definition: http://buildcompiler.org/Gen_Gen1_plas_1_simple/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['https://SBOL2Build.org/composite_1_impl/1']\n",
" Plasmid Implementations: ['http://buildcompiler.org/Gen_Gen1_plas_1_impl/1']\n",
" Strain Implementations: [None]\n",
" Fusion Sites: ['A', 'B', 'C', 'D', 'E']\n",
" Fusion Sites: ['A', 'E']\n",
" Antibiotic Resistance: Kanamycin\n",
"]\n"
"\n",
"Plasmid:\n",
" Name: Gen1_Gen1_plas_1_simple_E_F\n",
" Plasmid Definition: http://buildcompiler.org/Gen1_Gen1_plas_1_simple/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['http://buildcompiler.org/Gen1_Gen1_plas_1_impl/1']\n",
" Strain Implementations: [None]\n",
" Fusion Sites: ['E', 'F']\n",
" Antibiotic Resistance: Kanamycin\n",
"\n",
"Success with backbone: DVA_AF2_A_F and plasmids: ['Gen_Gen1_plas_1_simple_A_E', 'Gen1_Gen1_plas_1_simple_E_F']\n",
"Plasmid:\n",
" Name: DVA_AF2_A_F\n",
" Plasmid Definition: https://synbiohub.org/user/Gon/CIDARMoCloPlasmidsKit/DVA_AF2/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['https://synbiohub.org/user/Gon/impl_test/DVA_AF2_impl/1']\n",
" Strain Implementations: None\n",
" Fusion Sites: ['A', 'F']\n",
" Antibiotic Resistance: Ampicillin\n",
"\n",
"Comparing gctt (Gen1_Gen1_plas_1_simple_extracted_part)to gcttand reverse: cgct (Gen1_Gen1_plas_1_simple_extracted_part)to ggag\n",
"Comparing cgct (DVA_AF2_extracted_backbone)to cgctand reverse: ggag (DVA_AF2_extracted_backbone)to ggag\n"
]
}
],
"source": [
"print(buildcompiler.restriction_enzyme_implementations)\n",
"print(buildcompiler.ligase_implementations)\n",
"lvl2_design_doc = sbol2.Document()\n",
"lvl2_design_doc.read(\"../tests/test_files/ExampleLvl2_design.xml\")\n",
"\n",
"composite_plasmids = buildcompiler.assembly_lvl1(design, None)"
"\n",
"composite_plasmids, final_doc = buildcompiler.assembly_lvl2(\n",
" lvl2_design_doc, product_name=\"lvl2\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"id": "ba31c4c6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[Plasmid:\n",
" Name: lvl2_1_A_F\n",
" Plasmid Definition: http://buildcompiler.org/lvl2_1/1\n",
" Strain Definitions: [None]\n",
" Plasmid Implementations: ['http://buildcompiler.org/lvl2_1_impl/1']\n",
" Strain Implementations: [None]\n",
" Fusion Sites: ['A', 'F']\n",
" Antibiotic Resistance: Ampicillin\n",
"]\n"
]
},
{
"data": {
"text/plain": [
"'Valid.'"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"print(composite_plasmids)\n",
"final_doc.write(\"lvl2_assembly.xml\")"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "79fd0cb5",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -109,46 +276,21 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "8f4ea67c",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'composite_plasmids' is not defined",
"output_type": "error",
"traceback": [
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
"\u001b[31mNameError\u001b[39m Traceback (most recent call last)",
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[6]\u001b[39m\u001b[32m, line 1\u001b[39m\n\u001b[32m----> \u001b[39m\u001b[32m1\u001b[39m bacterial_transformation(\u001b[43mcomposite_plasmids\u001b[49m, chassis_implementation, chassis, final_doc)\n",
"\u001b[31mNameError\u001b[39m: name 'composite_plasmids' is not defined"
]
}
],
"outputs": [],
"source": [
"# bacterial_transformation(composite_plasmids, chassis_implementation, chassis, final_doc)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5553bfc3",
"id": "cd334add",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Valid.'"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# final_doc.write(\"fullbuild.xml\")"
]
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading
Loading