kalekundert / freezerbox

MIT License
0 stars 0 forks source link

Allow multi-step protocols #7

Closed kalekundert closed 3 years ago

kalekundert commented 4 years ago

The whole idea of stepwise is to break protocols up into small pieces. That PO₄ can only handle one protocol at a time really does not work well with that idea.

Syntax: could use ; or | as a separator.

Semantics: Would connect commands with pipes, obviously. The hard part is grouping. I'll need to think more about that...

kalekundert commented 4 years ago

One problem is that subsequent commands can't get passed the same list of constructs as the first command, because much of that information (e.g. name, concentration, etc.) doesn't apply anymore. For example, imagine I want to do PCR followed by PCR cleanup. The inputs to the cleanup are the products from the PCR reaction. The database doesn't know anything about those products.

One idea is that any commands after the first would just get a number of constructs. Or maybe a list of "AnonymousConstruct" objects that would have references to the parent object: this is better because it presents the same interface to every protocol (list of constructs), and all the information is available if necessary (e.g. the protocol could look at the upstream constructs, see that the primary protocol is PCR, and assume a concentration of 50 ng/µL based on that). This would mean that protocols written to use information from the database couldn't come after other protocols, but that's not such a bad thing. If you really want a primary protocol in a secondary position, you can always make another database entry and specify all of its information.

A list of secondary protocols, just to see if I can find any good counter-points:

All of these would be handled pretty seamlessly by this architecture. "Aliquot" is worth highlighting, because it is somewhat unique in requiring parameters.

kalekundert commented 4 years ago

I could also add a CMD protocol, which would just give a command-line verbatim. This misses out on the ability to be smart about master mixes and such, but it's a feature that should exist nonetheless.

Edit: I'm gonna make a separate issue for this.

kalekundert commented 4 years ago

Another consideration is that protocols are used to determine the sequence of database entries. This is another thing that becomes unclear when there are multiple protocols. I think I can apply the same thinking as above, though: only the primary protocol is queried for this information.

I'm starting to think that it might be better to draw a more explicit distinction between "protocols" and "cleanup steps". For instance, making them separate columns in the database. Basically, a protocol would be something that changes the sequence, while a cleanup step would be something that doesn't. It follows that there can only be one "protocol" (might want to think of a more specific name, maybe "synthesis"), but multiple cleanups. It also follows that the inputs to the cleanup steps should be the constructs in question, because the sequence is known once the primary protocol completes.