Skip to content

Add SynBioHub PartShop client, collection pulling, and Golden Gate digestion/ligation simulation#86

Open
Gonza10V wants to merge 1 commit into
full_buildfrom
codex/implement-authenticated-repository-login-support-11apgr
Open

Add SynBioHub PartShop client, collection pulling, and Golden Gate digestion/ligation simulation#86
Gonza10V wants to merge 1 commit into
full_buildfrom
codex/implement-authenticated-repository-login-support-11apgr

Conversation

@Gonza10V
Copy link
Copy Markdown
Contributor

@Gonza10V Gonza10V commented May 7, 2026

Motivation

  • Enable BuildCompiler to load and index SBOL collections from SynBioHub with optional authentication and to allow executor-driven identity pulls during build execution.
  • Provide a lightweight repository adapter backed by sbol2.PartShop so credentials (token or email/password) can be reused safely in memory.
  • Improve assembly fidelity by simulating Golden Gate digestion/ligation for generated assemblies before invoking the legacy assembly routine.

Description

  • Implement PartShopRepositoryClient in src/buildcompiler/sbol/repository.py to support anonymous pulls, token reuse, and email/password login, exposing pull_identity, pull_collection, and auth_token while hiding secrets in __repr__.
  • Extend BuildCompiler.from_synbiohub and the full_build wrapper in src/buildcompiler/api/compiler.py to accept repository_url, email, and password, create a PartShopRepositoryClient, pull requested collections, and store the client on the compiler instance; validate incompatible credential combinations and required parameters.
  • Pass a pull_client hook into FullBuildExecutor.from_dependencies so the executor can use repository_client.pull_identity during execution, wired through the sbol resolver construction.
  • Export PartShopRepositoryClient from buildcompiler.sbol and add a new notebook notebooks/buildcompiler_synbiohub_tutorial.ipynb demonstrating authentication and a full-build workflow against SynBioHub.
  • Add Golden Gate digestion/ligation simulation to AssemblyService in src/buildcompiler/sbol/assembly.py using Bio.Restriction and pydna.dseqrecord.Dseqrecord to cut components, verify fragment counts, concatenate inserts into an open backbone, and ensure a circular ligation product is produced before invoking the legacy Assembly routine.
  • Add unit tests covering the new API behavior in tests/unit/api/test_compiler_api.py (collection pulling, credential validation) and repository client behavior in tests/unit/sbol/test_repository.py (anonymous pull, token usage, email/password login and pull).
  • Update README.md with usage examples for BuildCompiler.from_synbiohub(...) demonstrating anonymous access, token reuse, and email/password login.

Testing

  • Ran unit tests for the modified components with pytest targeting tests/unit/api/test_compiler_api.py and tests/unit/sbol/test_repository.py, and they passed.
  • Exercised the BuildCompiler.from_synbiohub code paths via tests that mock PartShopRepositoryClient and verify pull_collection was invoked successfully.
  • Executed the repository client tests which simulate PartShop and Document behavior and verified login, token exposure, and pull semantics.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60850bd942

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

sequence_obj = source_document.find(component.sequences[0])
if not isinstance(sequence_obj, sbol2.Sequence):
raise ValueError(f"Missing sequence for component {component.displayId}")
ds_record = Dseqrecord(sequence_obj.elements, circular=True)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve component topology in digestion simulation

_digest_component hard-codes circular=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) before Assembly.run executes. This affects assemblies where source SBOL marks components as linear or lacks circular topology metadata.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant