Add SynBioHub PartShop client, collection pulling, and Golden Gate digestion/ligation simulation#86
Conversation
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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 👍 / 👎.
Motivation
sbol2.PartShopso credentials (token or email/password) can be reused safely in memory.Description
PartShopRepositoryClientinsrc/buildcompiler/sbol/repository.pyto support anonymous pulls, token reuse, and email/password login, exposingpull_identity,pull_collection, andauth_tokenwhile hiding secrets in__repr__.BuildCompiler.from_synbiohuband thefull_buildwrapper insrc/buildcompiler/api/compiler.pyto acceptrepository_url,email, andpassword, create aPartShopRepositoryClient, pull requestedcollections, and store the client on the compiler instance; validate incompatible credential combinations and required parameters.pull_clienthook intoFullBuildExecutor.from_dependenciesso the executor can userepository_client.pull_identityduring execution, wired through thesbolresolver construction.PartShopRepositoryClientfrombuildcompiler.sboland add a new notebooknotebooks/buildcompiler_synbiohub_tutorial.ipynbdemonstrating authentication and a full-build workflow against SynBioHub.AssemblyServiceinsrc/buildcompiler/sbol/assembly.pyusingBio.Restrictionandpydna.dseqrecord.Dseqrecordto cut components, verify fragment counts, concatenate inserts into an open backbone, and ensure a circular ligation product is produced before invoking the legacyAssemblyroutine.tests/unit/api/test_compiler_api.py(collection pulling, credential validation) and repository client behavior intests/unit/sbol/test_repository.py(anonymous pull, token usage, email/password login and pull).README.mdwith usage examples forBuildCompiler.from_synbiohub(...)demonstrating anonymous access, token reuse, and email/password login.Testing
pytesttargetingtests/unit/api/test_compiler_api.pyandtests/unit/sbol/test_repository.py, and they passed.BuildCompiler.from_synbiohubcode paths via tests that mockPartShopRepositoryClientand verifypull_collectionwas invoked successfully.PartShopandDocumentbehavior and verified login, token exposure, and pull semantics.Codex Task