def sample_turbs(): ham_int, reader_int, reader_int, shaker, *_ = sys_state.instruments #shaker.stop() TODO: for asynchrony for batch in batches: tip_poss = new_tips() aspirate(ham_int, [(turb_plate, i) for i in batch], [read_sample_vol]*8) dispense(ham_int, [(reader_plate, i) for i in batch], [read_sample_vol]*8) tip_eject(ham_int, tip_poss)
def prepare_assays(phage_dilutions, culture_wells, plate_wells): # deal with up to 8 at the same time ham_int, *_ = sys_state.instruments num_phage_dilutions = len(phage_dilutions) agar_positions = all_agar_positions[:num_phage_dilutions] if prep_hard_agar: logging.info('\n##### Filling assay plates with hard agar.') if next(replace_agar_tips): tip_eject(ham_int) new_tips(num_phage_dilutions) aspirate(ham_int, agar_positions, [hard_agar_vol*dipenses_per_prep_tip*1.3]*num_phage_dilutions, liquidClass=agar_class) # Aspirate 10% more to avoid bubbles dispense(ham_int, plate_wells, [hard_agar_vol]*num_phage_dilutions, liquidHeight=6, liquidClass=agar_class) return logging.info('\n##### Moving culture into dilution wells.') new_tips(num_phage_dilutions, 'culture') aspirate(ham_int, culture_wells, [culture_vol]*num_phage_dilutions, liquidClass=std_class) dispense(ham_int, phage_dilutions, [culture_vol]*num_phage_dilutions, liquidClass=std_class) tip_eject(ham_int) logging.info('\n##### Moving agar into dilution tubes.') new_tips(num_phage_dilutions) aspirate(ham_int, agar_positions, [soft_agar_vol + 50]*num_phage_dilutions, liquidClass=agar_class) dispense(ham_int, phage_dilutions, [soft_agar_vol + 50]*num_phage_dilutions, liquidHeight=6, liquidClass=agar_class) logging.info('\n##### Moving finished phage_dilutions into plate wells.') aspirate(ham_int, phage_dilutions, [soft_agar_vol]*num_phage_dilutions, liquidClass=agar_class) dispense(ham_int, plate_wells, [soft_agar_vol]*num_phage_dilutions, liquidHeight=6, liquidClass=agar_class) tip_eject(ham_int)
def replace_media(replace_vols): ham_int, reader_int, reader_int, shaker, *_ = sys_state.instruments if sys_state.waffle_clean_thread: sys_state.waffle_clean_thread.join() pump_int.refill(30) shaker.stop() for batch in batches: tip_poss = new_tips() aspirate(ham_int, [(media_reservoir, i%8) for i in batch], [replace_vols[i] for i in batch]) dispense(ham_int, [(turb_plate, i) for i in batch], [replace_vols[i] for i in batch], liquidHeight=fly_disp_height, dispenseMode=9) shaker.start(shake_speed) tip_eject(ham_int, tip_poss) #TODO: only for tip reuse tip_poss = new_tips() #TODO: only for tip reuse shaker.stop() aspirate(ham_int, [(turb_plate, i) for i in batch], [800]*8, liquidHeight=fixed_turb_height) dispense(ham_int, [(bleach_site, i%8 + 88) for i in batch], [800]*8, liquidHeight=15) # +88 for far right side of bleach tip_eject(ham_int, tip_poss) shaker.start(shake_speed)
def service(replace_vols, plate, tips, media_reservoir): ham_int, *_ = sys_state.instruments if not remember.replace_vols: return # no transfer volumes ready to act on liq_move_param = { 'liquidClass': std_class, 'airTransportRetractDist': 0 } for col_num, col_vols in enumerate(replace_vols): array_idxs = [col_num * 8 + i for i in range(8)] tip_poss = [(tips, j) for j in array_idxs] tip_pick_up(ham_int, tip_poss) media_poss = [(media_reservoir, j) for j in array_idxs] aspirate(ham_int, media_poss, col_vols, **liq_move_param) plate_poss = [(plate, j) for j in array_idxs] dispense(ham_int, plate_poss, col_vols, liquidHeight=disp_height, mixCycles=2, mixVolume=mix_vol, dispenseMode=9, **liq_move_param) excess_vols = [max_transfer_vol for _ in media_poss] aspirate(ham_int, plate_poss, excess_vols, liquidHeight=fixed_turb_height, **liq_move_param) dispense( ham_int, [(waste_site, j % 8 + 88) for j in array_idxs], excess_vols, # +88 for far right side of bleach liquidHeight=15, **liq_move_param) wash_vols = [wash_vol for _ in media_poss] bleach_poss = [(bleach_site, j) for j in array_idxs] aspirate(ham_int, bleach_poss, wash_vols, **liq_move_param) dispense(ham_int, bleach_poss, wash_vols, **liq_move_param) water_poss = [(water_site, j) for j in array_idxs] aspirate(ham_int, water_poss, wash_vols, **liq_move_param) dispense(ham_int, water_poss, wash_vols, **liq_move_param) tip_eject(ham_int, tip_poss) remember.replace_vols = None # make sure these transfers are only executed once