kalekundert / stepwise

Modular, command-line scientific protocols
GNU General Public License v3.0
3 stars 0 forks source link

Allow reactions to mix units #57

Open kalekundert opened 2 years ago

kalekundert commented 2 years ago

Today, I was trying to make a protocol for the following media recipe:

Reagent            Stock           Final  Volume
────────────────────────────────────────────────
M9 salts                                  612 mL
glucose        200 mg/mL         4 mg/mL   14 mL
thiamine       200 mg/mL         4 mg/mL   14 mL
MgSO₄             100 mM            1 mM    7 mL
ZnSO₄             100 mM           10 µM   70 µL
CaCl₂                1 M          100 µM   70 µL
kanamycin       50 mg/mL  25 µg/mL, 0.5x  350 µL
carbenicillin  100 mg/mL   100 µg/mL, 1x  700 µL
IPTG                 1 M           10 µM    7 µL

Note the wide range in volumes: from 612 mL to 7 µL. Currently, it's only possible to operate on quantities with identical units, and so the only way to make this reaction work is to convert everything to µL. (If I convert to mL, the µL volumes get rounded.)

Unfortunately, fixing this is going to be a big change. I'll basically need a full-blown units package. Some ideas about how to do this:

Some open questions: