async def test_set_temp_deck_temperature(monkeypatch):
    # Set target temperature
    import types
    from opentrons.drivers.temp_deck import TempDeck

    temp_deck = TempDeck()
    temp_deck.simulating = False
    command_log = []

    def _mock_send_command(self, command, timeout=None, tag=None):
        nonlocal command_log
        command_log += [command]
        return ''

    def _mock_update_temp(self):
        return 'holding at target'

    temp_deck._send_command = types.MethodType(_mock_send_command, temp_deck)
    temp_deck._update_temp = types.MethodType(_mock_send_command, temp_deck)

    try:
        await asyncio.wait_for(temp_deck.set_temperature(99), timeout=0.2)
    except asyncio.TimeoutError:
        pass
    assert command_log[-1] == 'M104 S99.0'

    try:
        await asyncio.wait_for(temp_deck.set_temperature(-9), timeout=0.2)
    except asyncio.TimeoutError:
        pass
    assert command_log[-1] == 'M104 S-9.0'
Esempio n. 2
0
def test_fail_set_temp_deck_temperature(monkeypatch):
    import types
    from opentrons.drivers import serial_communication

    error_msg = 'ERROR: some error here'

    def _raise_error(self, command, ack, serial_connection, timeout=None):
        nonlocal error_msg
        return error_msg

    serial_communication.write_and_return = types.MethodType(
        _raise_error, serial_communication)

    from opentrons.drivers.temp_deck import TempDeck
    temp_deck = TempDeck()
    temp_deck.simulating = False

    res = temp_deck.set_temperature(-9)
    assert res == error_msg

    error_msg = 'Alarm: something alarming happened here'

    def _raise_error(self, command, ack, serial_connection, timeout=None):
        nonlocal error_msg
        return error_msg

    serial_communication.write_and_return = types.MethodType(
        _raise_error, serial_communication)

    res = temp_deck.set_temperature(-9)
    assert res == error_msg
Esempio n. 3
0
def test_set_temp_deck_temperature(monkeypatch):
    # Set target temperature
    import types
    from opentrons.drivers.temp_deck import TempDeck

    temp_deck = TempDeck()
    temp_deck.simulating = False
    command_log = []

    def _mock_send_command(self, command, timeout=None):
        nonlocal command_log
        command_log += [command]
        return ''

    temp_deck._send_command = types.MethodType(_mock_send_command, temp_deck)

    temp_deck.set_temperature(99)
    assert command_log[-1] == 'M104 S99.0'

    temp_deck.set_temperature(-9)
    assert command_log[-1] == 'M104 S-9.0'
All_wells = [Plasmid1_wells, Plasmid2_wells]                                                                                # Creates an array from the lists of wells. More lists can be declared and added to this array
                                                                                                                            # By adding in another variable to this section a second list for cells requiring a different plasmid can be used
                                                                                                                            # A third variable would be needed to house both lists and could be used to iterate through the loops with each smaller list being for each plasmid, biglist = [list1,list2], biglist[0]
#All_Wells = Randomizer(All_wells)                                                                                          # Randomizes the wells, delete the hashtag to allow this randomizer to run. Imported from OT2_Functions

#########################################################################################
#########################################################################################

tempdeck = TempDeck()                                                                                                       # Saves the temperature deck into a variable,

temperature = {"temp1": 4, "temp2": 42, "temp3": 37}                                                                        # Saves the temperatures for the protocol into a dictionary. Dictionaries have keys and values
                                                                                                                            # The value can be called by the key i.e temperature["temp1"] = 4
if not robot.is_simulating():                                                                                               # If the robot is inactive and the temperature deck isn't processing a command
    tempdeck.connect('/dev/ttyACM0')                                                                                        # Connects to and begins cooling the temperature deck
    tempdeck.set_temperature(temperature["temp1"])                                                                          # Initialization temperature for cooling
    tempdeck.wait_for_temp()                                                                                                # Pauses the protocol until the temperature deck reaches the set temperature

target = All_wells                                                                                                          # Adds the array of wells into a variable for easier readability during manipulation
SOB_wells = [well.top(1) for well in target]                                                                                # well.top moves the pipette to the top of the well, the number specifies the distance in mm

robot.pause()                                                                                                               # Opentron command that pauses whatever the robot is doing. The user can remove and centrifuge at this point, if the need is there. resumed via the OT app
                                                                                                                            # The code below handles distributing plasmid DNA
for i in range(NumberofPlasmids):                                                                                           # Transfers plasmid DNA into competent cell aliquots. The variable NumberofPlasmids controls how many times the loop is carried out, once for each plasmid
    P10.distribute(                                                                                                         # Presumes same plasmid for all cells, adds all doses to the pipette, wells specified later in the block
        PlasmidVolume,                                                                                                      # Specifies the volume in ul
        DNA(i),                                                                                                             # Selects which plasmid to pipette based on it's position on the container declared DNA. I increases with each loop, meaning the next plasmid is selected
        target,                                                                                                             # Target is the specified wells where the plasmid is then distributed (this will not work if multiple plasmids are being used)
        blow_out=True,                                                                                                      # Empties the pipette with an extra gust of air to ensure it is fluid free
        new_tip='always'                                                                                                    # Changes the pipette after every dispense to avoid contamination
    )
Esempio n. 5
0
    'A1', length=25
)  # Specify the buffer positions, change length=25 to whatever the number
# of buffers you have, eg if 15 buffers length=15
#########################################################################################
#########################################################################################
# BELOW IS CODE FOR THE PROTOCOL
# IF WORKING WITH E. COLI, BELOW IS A OPTIMAL PROTOCOL THAT ONLY REQUIRES 1 WASH STEP
# IF INVESTINGATING DIFFERENT INCUBATION TIMES, ALTER P300 DELAYS
# IF WANTING TO CHANGE TEMPDECK ON CONSTANTLY, REMOVE ALL tempdeck.disengage() AND PLACE BEFORE
# FINAL ROBOT COMMENT

tempdeck = TempDeck()  # Connects the Tempdeck module to OT-2

if not robot.is_simulating():  # Cannot use while simulating,
    tempdeck.connect('/dev/ttyACM0')
    tempdeck.set_temperature(
        target_temperature)  # Sets the temperature to whats specified above

target1 = Compcells1(Even_wells)  # Where your cells are going

robot.home()  # turbulent airflow within the OT-2
robot.pause()
robot.comment(
    "Make sure that centrifuge has been chilled down to 4*C and all buffers are on ice."
)
robot.comment(
    "All plates should be chilled at the beginning and culture should be incubated on ice for 15 minutes before start."
)
robot.comment(
    "Once at set temperature, insert culture into slot 6 and plate onto TempDeck, then resume!"
)
Esempio n. 6
0
                            blow_out=True,
                            rate=0.5,
                            new_tip='never')
            P300.touch_tip(Buffers(well_counter))
            P300.blow_out(Buffers(well_counter))
    P300.drop_tip(
    )  # Drops tips at end of single reagent run to prevent contamination
    P10.drop_tip()

#########################################################################################
#########################################################################################
# COMPETENT CELLS

if not robot.is_simulating():  # Cannot use while simulating,
    tempdeck.connect('/dev/ttyACM0')
    tempdeck.set_temperature(
        target_temperature)  # Sets the temperature to whats specified above

target1 = Compcells1(Even_wells)  # Where your cells are going

robot.home()  # turbulent airflow within the OT-2
robot.pause()
robot.comment(
    "Make sure that centrifuge has been chilled down to 4*C and all buffers are on ice."
)
robot.comment(
    "All plates should be chilled at the beginning and culture should be incubated on ice for 15 minutes before start."
)
robot.comment(
    "Once at set temperature, insert culture into slot 6 and plate onto TempDeck, then resume!"
)