@@ -56,7 +56,7 @@ def introduction() -> None:
56
56
echo (
57
57
"""This routine will calibrate the current Pioreactor to (offline) OD600 readings. You'll need:
58
58
1. The Pioreactor you wish to calibrate (the one you are using)
59
- 2. At least 10mL of a culture with density the most you'll ever observe, and its OD600 measurement
59
+ 2. At least 10mL of a culture with the highest density you'll ever observe, and its OD600 measurement
60
60
3. A micro-pipette
61
61
4. Accurate 10mL measurement tool
62
62
5. Sterile media, amount to be determined shortly.
@@ -155,7 +155,7 @@ def setup_HDC_instructions() -> None:
155
155
156
156
157
157
def start_stirring ():
158
- while not confirm (green ("Reading to start stirring?" ), default = True ):
158
+ while not confirm (green ("Reading to start stirring?" ), default = True , abort = True ):
159
159
pass
160
160
161
161
echo ("Starting stirring and blocking until near target RPM." )
@@ -189,6 +189,8 @@ def plot_data(
189
189
190
190
plt .theme ("pro" )
191
191
plt .title (title )
192
+ plt .xlabel ("OD600" )
193
+ plt .ylabel ("OD Reading (Raw)" )
192
194
plt .plot_size (105 , 22 )
193
195
194
196
if interpolation_curve :
@@ -211,6 +213,9 @@ def start_recording_and_diluting(
211
213
inferred_od600s = []
212
214
current_volume_in_vial = initial_volume_in_vial = 10.0
213
215
n_samples = int ((20 - initial_volume_in_vial ) / dilution_amount )
216
+ if initial_volume_in_vial + dilution_amount * n_samples >= 18 :
217
+ n_samples = n_samples - 1
218
+ #20mL in one vial is very scary
214
219
total_n_samples = int (log2 (initial_od600 / minimum_od600 ) * (initial_volume_in_vial / dilution_amount ))
215
220
count_of_samples = 0
216
221
@@ -236,14 +241,24 @@ def get_voltage_from_adc() -> pt.Voltage:
236
241
od_reader .record_from_adc ()
237
242
238
243
while inferred_od600 > minimum_od600 :
239
- if inferred_od600 < initial_od600 and confirm (
240
- green ("Do you want to enter an updated OD600 value for the current density?" )
241
- ):
242
- inferred_od600 = prompt (
243
- green ("Updated OD600" ),
244
- type = float ,
245
- confirmation_prompt = green ("Repeat for confirmation" ),
246
- )
244
+ while True :
245
+ if inferred_od600 < initial_od600 and confirm (
246
+ green ("Do you want to enter an updated OD600 value for the current density?" )
247
+ ):
248
+ r = prompt (
249
+ green ("Enter updated OD600, or SKIP" ),
250
+ type = str ,
251
+ confirmation_prompt = green ("Repeat for confirmation" ),
252
+ )
253
+ if r == "SKIP" :
254
+ break
255
+
256
+ else :
257
+ try :
258
+ inferred_od600 = float (r )
259
+ break
260
+ except ValueError :
261
+ echo ("OD600 entered is invalid." )
247
262
248
263
inferred_od600s .append (inferred_od600 )
249
264
@@ -268,7 +283,7 @@ def get_voltage_from_adc() -> pt.Voltage:
268
283
)
269
284
echo (f"Add { dilution_amount } ml of media to vial." )
270
285
271
- while not confirm (green ("Continue?" ), default = True ):
286
+ while not confirm (green ("Continue?" ), default = False ):
272
287
pass
273
288
274
289
current_volume_in_vial = current_volume_in_vial + dilution_amount
@@ -306,9 +321,9 @@ def get_voltage_from_adc() -> pt.Voltage:
306
321
echo (style ("Stop❗" , fg = "red" ))
307
322
echo ("Carefully remove vial." )
308
323
echo ("(Optional: take new OD600 reading with external instrument.)" )
309
- echo ("Reduce volume in vial back to 10ml ." )
324
+ echo (f "Reduce volume in vial by { n_samples * dilution_amount } mL. There should be 10mL remaining in your vial ." )
310
325
echo ("Confirm vial outside is dry and clean. Place back into Pioreactor." )
311
- while not confirm (green ("Continue?" ), default = True ):
326
+ while not confirm (green ("Continue?" ), default = False ):
312
327
pass
313
328
current_volume_in_vial = initial_volume_in_vial
314
329
st .set_state ("ready" )
@@ -330,7 +345,7 @@ def get_voltage_from_adc() -> pt.Voltage:
330
345
confirmation_prompt = green ("Repeat for confirmation" ),
331
346
)
332
347
echo ("Confirm vial outside is dry and clean. Place back into Pioreactor." )
333
- while not confirm (green ("Continue?" ), default = True ):
348
+ while not confirm (green ("Continue?" ), default = False ):
334
349
pass
335
350
echo ("Reading blank..." )
336
351
0 commit comments