def movetoch4(): fluidics.stop_flow() stage.move_to("J1") stage.move_to("Ch1") setpressure(0.1) fluidics.open(1, 2, 3, 4, 6) reset_force() print("setup should be ready to go")
def false_positive(): #1 if it was ok, 0 if false positive fluidics.close(1, 2, 3, 4, 5, 6) gohome() pause(0.8) reset_force() trap.move_by(dx=5, speed=6) f1 = trap2.current_force trap.move_by(dx=5.5, speed=6) f2 = trap2.current_force trap.move_by(dx=-10.5, speed=6) print(" -FP" + str(round(f1, 2)) + " to " + str(round(f2, 2))) if f2 > (4 * f1): return 1 else: return 0
def themainloop( ): #will return 1 if caught, 0 if attempted 60 times and failed #check for beads first bt = beadtest() fluidics.close(1, 2, 3, 4, 5, 6) if bt == 0: setpressure(0.3) fluidics.open(1, 2, 3, 6) stage.move_to("beads") catch_beads(86) else: #turn on fluidics fluidics.open(1, 2, 3, 6) # set up the pressure stage.move_to("buffer") setpressure(0.4) #set traps at initial position and reset force gohome() reset_force() print("initialized position") caught = pingpongforce2() attempts = 1 #moving into dna channel and starting pingpong while caught != 1: print(" we've attempted " + str(attempts) + " times") #print(" new force ="+str(round(pforce,2))) stage.move_to("DNA") pause(dnadwell) stage.move_to("buffer") pause(dnadwell) caught = pingpongforce2() if attempts == 15: return 0 if (attempts % 10) == 0: pressurecycle() attempts += 1 else: attempts += 1 print("hopefully we finished") return 1
def is_single_tether(max_force=70, min_force=30, backward_speed=1): # min_forcce depemds on the rate of flow, especially when you have flow # make sure that you don't have bubbles inside the system trap1, trap2 = traps[:2] distance = timeline["Distance"]["Distance 1"] goto_distance(10) print("traps are 10 um apart") trap1.move_by(dx=-3, speed=backward_speed) # MAYBE play with this reset_force() pause(0.5) # MAYBE play with this baseline_force = trap1.current_force # print('baseline force') # print(baseline_force) trap1.move_by(dx=3, speed=5) # MAYBE play with this force_list = [] ii = 0 # while distance.latest_value < 26: # MAYBE play with this, not sure how long you can stretch DNA while ii < 38: # MAYBE play with this, not sure how long you can stretch DNA ii += 1 trap1.move_by(dx=0.5, speed=5) # print('trap1 force') # print(trap1.current_force) current_force = abs(baseline_force - trap1.current_force) # print(current_force) force_list.append(current_force) if current_force > max_force: print("Multiple tethers found") return 2 # elif distance.latest_value > 16: elif ii > 18: if current_force > min_force: # print('stdev of past 10 forces') # print(std(force_list[-10:])) if std(force_list[-10:]) < 2: print("Single tether potentially found") trap1.move_by(dx=-16, speed=5) return 1 print("No tethers found") trap1.move_by(dx=-16, speed=5) return 0
def thelooploop(): #return 1 if done chk = 0 while chk == 0: print("starting loop loop") chk = themainloop() if chk == 1: chk = false_positive() else: target_traps = traps[:2] target_traps[1].clear() target_traps[0].clear() #hopefully caught something, move to buffer channel and reset all stage.move_to("buffer") gohome() fluidics.stop_flow() reset_force() print("in the buffer channel with all reset") #0 for no ssDNA, 1 for good, 2 for failed to pull if makessDNA == 1: print("time to try for ssDNA") s = 0 while s != 1: s = ssDNAstretch() if s == 0: setpressure(0.3) fluidics.open(3, 6) target_traps = traps[:2] target_traps[1].clear() target_traps[0].clear() fluidics.close(3, 6) return s if s == 2: continue else: return 1
def fish_for_dna(min_distance_um, max_distance_um, force_threshold_pN): """Oscillate between min and max distance while the force is under the threshold value""" stage.move_to("DNA") goto_distance(min_distance_um) fluidics.open(1, 2, 3, 6) pause(1) reset_force() goto_distance(max_distance_um) while trap2.current_force < force_threshold_pN: goto_distance(min_distance_um) reset_force() goto_distance(max_distance_um) fluidics.close(1, 2, 3, 6) stage.move_to("buffer") goto_distance(min_distance_um) reset_force()
from bluelake import Trap, stage, fluidics, pause, power, timeline, reset_force, confocal reset_force() timeline.mark_begin("FD1") while Distancebeads.latest_value < 25: trap1.move_by(dx=3, speed=8) confocal.start_scan() # start the active configuration # wait for scan to finish pause(1) while confocal.is_scanning: pause(1) timeline.mark_end() print("Done!")