BjornFJohansson / pydna

Clone with Python! Data structures for double stranded DNA & simulation of homologous recombination, Gibson assembly, cut & paste cloning.
Other
166 stars 45 forks source link

Type IIS assembly #273

Closed grassoste closed 1 month ago

grassoste commented 1 month ago

Hi guys,

I'll try to do my best for the pyDNA hackatron.

One thing I could bring relatively easily is some code for Golden Gate Assembly (based on any Type II2 enzyme). In pyDNA Golden Gate can be replicated with some workaround, but not natively.

We work with pure MoClo style, so we have a bunch of part plasmids that can be digested with a specific enzyme (e.g. BsaI) and combined in 1 way only (due to the specificity of the 4-bp overhang).

So I already coded a few functions on top of pyDNA to do this (I have them on the work PC, so I'll add some extra info tomorrow).

But in essence there are 2 main functions: 1) make_circular_assembly(): which takes as input a) a list of DSeqRecords (can be circular or linear) b) a restriction enzyme; and outputs a) a list of all possible circular assemblies (DSeqRecords), containing always 1 fragment for each input and with propagated features (this is a bit buggy). 2) filter_on_featuere(): because in some cases 2 assemblies can be returned (only in the case of all circular inputs) I wanted to filter based on some feature names/types.

This is something that will require me relatively little time to add, as it's already coded, and I might thus use the time to improve or debug my own functions. Or, even better, I'd be up to provide the functions as they are, and cross-debug someone else's ones.

@manulera let me know

manulera commented 1 month ago

Hi @grassoste! First of all thank you so much for participating in the hackathon, and for letting us know in advance the time you will be joining, it's really appreciated. We are also very happy to get to know some of the users and learn from their use-cases.

This has not been advertised anywhere, so I imagine you have not seen it, but I am planning to add a new implementation of the assembly functionality. It's more generic, and covers essentially all forms of joining DNA sequences, including: Gibson, restriction + ligation (regardless of whether it is Golden Gate or not), homologous recombination, PCR, ligation, etc. The advantage of this is that it will allow us to get rid of a lot of different implementations of essentially the same thing, and reduce the codebase significantly.

There is a description of the new implementation in this notebook. I wrote it a while ago, so it might be outdated here and there, but the main idea is there, I just double-checked and it runs.

The new version also addresses some bugs in the old implementation (see issues with "assembly" in them), where not all possibilities were returned, or had wrong annotations.

If you are using pydna often, I would really appreciate it if you could take a look at the new implementation and give me some feedback. This can be done live during the hackathon if you want.

Therefore, I don't think it would make much sense to contribute the SII assembly at this point. Sorry that this was not clear! Actually type SII assembly was always a big missing feature, so it was a great idea to work on it. Hopefully there is something else you would like to add or there is an existing issue that you would like to work on! Also, real-world examples are great contributions since the repository is still a bit behind in its documented examples.

By the way, you might be interested in a pydna-based project that I am working on, that adds a user interface, supports templates for Golden Gate assembly and much more. You can see a short 15 mins. summary video of the project here. The application is live here.

grassoste commented 1 month ago

Thanks @manulera for your reply!

No problem, actually better! I agree with you pyDNA was missing such an approach, since the molecular abstractions can be very similar (i.e. stacking overhangs). Well then I may help in adding the part you developed (I had a very quick look at the notebook and seems very interesting in terms of functionalities! I would definitely use it! I'll have a better look tomorrow).

Anyway since this issue has been already addressed I may also help in something else, let me know. Even just the documentation. In any case, I will try to join as much as possible on Thursday.

I was already aware of ShareYourCloning, but only superficially. I will have a better look into it, it's definitely a very cool project!

manulera commented 1 month ago

Will close as not planned then. See you tomorrow!