-
Notifications
You must be signed in to change notification settings - Fork 1
Add SynBioHub PartShop client, collection pulling, and Golden Gate digestion/ligation simulation #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Gonza10V
wants to merge
1
commit into
full_build
Choose a base branch
from
codex/implement-authenticated-repository-login-support-11apgr
base: full_build
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add SynBioHub PartShop client, collection pulling, and Golden Gate digestion/ligation simulation #86
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# BuildCompiler SynBioHub Tutorial\n", | ||
| "\n", | ||
| "This notebook shows how to authenticate to SynBioHub, load private collections into BuildCompiler, and run a full-build workflow using an abstract design URI.\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "from getpass import getpass\n", | ||
| "import sbol2\n", | ||
| "\n", | ||
| "from buildcompiler.api import BuildCompiler\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "repository_url = \"https://synbiohub.org\"\n", | ||
| "user = \"user\"\n", | ||
| "password = getpass(\"SynBioHub password: \")\n", | ||
| "\n", | ||
| "abstract_design_uri = \"https://synbiohub.org/user/Gon/abstract_design/standard_GFP/1\"\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" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "sbol_doc = sbol2.Document()\n", | ||
| "\n", | ||
| "compiler = BuildCompiler.from_synbiohub(\n", | ||
| " repository_url=repository_url,\n", | ||
| " email=user,\n", | ||
| " password=password,\n", | ||
| " collections=collections,\n", | ||
| " sbol_doc=sbol_doc,\n", | ||
| ")\n", | ||
| "\n", | ||
| "print(f\"Loaded SBOL objects: {len(list(sbol_doc))}\")\n", | ||
| "print(f\"Indexed plasmids: {len(getattr(compiler.inventory, 'plasmids', [])) if compiler.inventory else 'n/a'}\")\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Pull/resolve the abstract design into the shared document.\n", | ||
| "if compiler.repository_client is not None:\n", | ||
| " compiler.repository_client.pull_identity(abstract_design_uri)\n", | ||
| "\n", | ||
| "abstract_design = sbol_doc.find(abstract_design_uri)\n", | ||
| "if abstract_design is None:\n", | ||
| " raise LookupError(f\"Could not resolve abstract design: {abstract_design_uri}\")\n", | ||
| "\n", | ||
| "plan = compiler.plan([abstract_design])\n", | ||
| "result = compiler.execute(plan)\n", | ||
| "result\n" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## Notes\n", | ||
| "\n", | ||
| "- BuildCompiler reuses a single authenticated `sbol2.PartShop` client for collection pulls and identity fallback pulls.\n", | ||
| "- Tokens returned by SynBioHub login are kept in memory only; they are not serialized by default.\n", | ||
| "- Assembly uses Golden Gate digestion/ligation simulation and links reagent usages + generated products through a stage activity in SBOL.\n" | ||
| ] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "Python 3", | ||
| "language": "python", | ||
| "name": "python3" | ||
| }, | ||
| "language_info": { | ||
| "name": "python", | ||
| "version": "3.11" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 5 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_digest_componenthard-codescircular=True, so the new Golden Gate pre-simulation ignores whether a plasmid/backbone is actually linear. The legacy assembly path (part_digestion/backbone_digestion) branches on topology and accepts different fragment patterns for linear inputs, but this precheck now computes cuts as circular and can produce different fragment counts/joins, causing false precheck failures (or mismatches) beforeAssembly.runexecutes. This affects assemblies where source SBOL marks components as linear or lacks circular topology metadata.Useful? React with 👍 / 👎.