HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
3 stars 1 forks source link

Add pipettor support to macro language #147

Open EvanKirshenbaum opened 7 months ago

EvanKirshenbaum commented 7 months ago

As soon as I get the code to work again with the Opentrons (#82), people are going to want to use it.

I don't think that there's any reason to want to reify the pipettor itself, but it will probably be worthwhile to add a type for extraction point (and also extraction port, extraction hole, hole, port(?) and the like) and be able to ask about that as a "maybe" attribute of a pad. And where a pad implicitly converts to its extraction point. It will probably also be worth having a "pipetting target" ("pipettor target") type that includes extraction points and wells.

Then we have functions equivalent to

add = builtin(pipetting target, liquid)
add = builtin(pipetting target, volume)
remove = builtin(pipetting target, volume)

where if you add a volume to a well that has a reagent, you reuse that reagent, and otherwise you add the interactive reagent.

If/when we get imperatives (#139), this could become

add 20 uL to (3,4);
remove the well's volume from the well;
// and with some convenience functions:
empty the well;
fill the well with reagent "R";
Migrated from internal repository. Originally created by @EvanKirshenbaum on Jun 05, 2022 at 3:36 PM PDT.
EvanKirshenbaum commented 7 months ago

Taking down stuff from my whiteboard.

Add type for extraction point (aka extraction port, hole). Refer to by number and off of pad (like heater, well).

well has

With #164, we might make optional arguments for source/destination

Migrated from internal repository. Originally created by @EvanKirshenbaum on Jun 09, 2022 at 3:24 PM PDT.
EvanKirshenbaum commented 7 months ago

From https://github.com/HPInc/HP-Digital-Microfluidics/issues/164 [comment by @EvanKirshenbaum on Jun 20, 2022 at 10:50 AM PDT]:

In the macro language, you can talk about, e.g.,

source "A2"
source "A2/2" // e.g., A2 at slot 2, but interpreted by the Pipettor
r's source
r's source = "A2"
r's source = 2uL
source "A3"'s contents = 200uL of r1
r's source's volume

As currently implemented (#164),

  • a PipettingSource's reagent can only be assigned once, so two reagents can't have the same source.
  • a pipettor may have more than one source for a reagent, so we when we look up r's reagent, we need to make sure it's unique and complain otherwise.
  • a source whose reagent is unassigned can have it assigned:
    s's reagent = r

    After this, r's source will be s (assuming there are no others).

  • sources have a capacity, which may be infinite.
  • sources actually can have a volume range, with min volume and max volume. If you set the reagent (explicitly or implicitly) before setting the volume, its min volume will be zero and its max volume will be its capacity. After you add or remove fluid, the bounds will change.
  • volume as an attribute only works if min volume and max volume are the same. (Ditto contents)
  • sources should probably have empty and full properties.
Migrated from internal repository. Originally created by @EvanKirshenbaum on Jun 23, 2022 at 12:27 PM PDT.