Week 3 Automation

basic Concepts

Your task this week is to Create a Python file to run on an Opentrons liquid handling robot.

  1. Review this week’s recitation and this week’s lab for details on the Opentrons and programming it.
  2. Generate an artistic design using the GUI at opentrons-art.rcdonovan.com.
  3. Using the coordinates from the GUI, follow the instructions in the HTGAA26 Opentrons Colab to write your own Python script that draws your design using the Opentrons.

I took the Elephant as a starting point for my art in OpenTrons. This was an experience we complemented by understanding th step by step how to set up the Opentrons machine

I adapted the colors for the ones of the LifeFabs: purple Pink and Blue, which is actually a great Fluorescent

After exporting the code from the website, I ran the code in the Colab notebook as shown in the following picture

As our protocols didn’t work because we still had some issues in our programming, we did another practical part inoculating bacteria of the diferent colors, which we could set up in the future for the OpenTrons work.

Here is the Python code, and in the lab session you can find the pictures showing how to set up the OpenTrons software. ‘# -- coding: utf-8 -- “““Untitled0.ipynb

Automatically generated by Colab.

Original file is located at https://colab.research.google.com/drive/1SsF7FthigKsevVZ6kBfAc3F54fxr1ahF "””

from opentrons import types import math

— Coordinate Data —

mrfp1_points = [(-25.3, 25.3),(-23.1, 25.3),(-20.9, 25.3),(-18.7, 25.3),(-16.5, 25.3),(-14.3, 25.3),(-12.1, 25.3),(-27.5, 23.1),(-23.1, 23.1),(-20.9, 23.1),(-18.7, 23.1),(-16.5, 23.1),(-14.3, 23.1),(-12.1, 23.1),(-27.5, 20.9),(-25.3, 20.9),(-23.1, 20.9),(-20.9, 20.9),(-18.7, 20.9),(-7.7, 20.9),(-1.1, 20.9),(-34.1, 18.7),(-25.3, 18.7),(-23.1, 18.7),(-18.7, 18.7),(-1.1, 18.7),(1.1, 18.7),(-34.1, 16.5),(-29.7, 16.5),(-25.3, 16.5),(-23.1, 16.5),(-20.9, 16.5),(-16.5, 16.5),(-14.3, 16.5),(-1.1, 16.5),(1.1, 16.5),(3.3, 16.5),(5.5, 16.5),(-34.1, 14.3),(-31.9, 14.3),(-29.7, 14.3),(-27.5, 14.3),(-25.3, 14.3),(-23.1, 14.3),(-16.5, 14.3),(-14.3, 14.3),(-12.1, 14.3),(-5.5, 14.3),(-1.1, 14.3),(1.1, 14.3),(3.3, 14.3),(5.5, 14.3),(7.7, 14.3),(9.9, 14.3),(-34.1, 12.1),(-31.9, 12.1),(-29.7, 12.1),(-27.5, 12.1),(-25.3, 12.1),(-23.1, 12.1),(-20.9, 12.1),(-9.9, 12.1),(-5.5, 12.1),(-3.3, 12.1),(-1.1, 12.1),(1.1, 12.1),(3.3, 12.1),(7.7, 12.1),(-38.5, 9.9),(-31.9, 9.9),(-29.7, 9.9),(-27.5, 9.9),(-25.3, 9.9),(-20.9, 9.9),(-18.7, 9.9),(-9.9, 9.9),(-7.7, 9.9),(-5.5, 9.9),(-3.3, 9.9),(-1.1, 9.9),(1.1, 9.9),(5.5, 9.9),(-31.9, 7.7),(-29.7, 7.7),(-27.5, 7.7),(-25.3, 7.7),(-23.1, 7.7),(-18.7, 7.7),(-16.5, 7.7),(-14.3, 7.7),(-12.1, 7.7),(-9.9, 7.7),(-3.3, 7.7),(-1.1, 7.7),(1.1, 7.7),(5.5, 7.7),(7.7, 7.7),(9.9, 7.7),(12.1, 7.7),(16.5, 7.7),(-36.3, 5.5),(-34.1, 5.5),(-29.7, 5.5),(-27.5, 5.5),(-25.3, 5.5),(-23.1, 5.5),(-20.9, 5.5),(-18.7, 5.5),(-16.5, 5.5),(-9.9, 5.5),(-5.5, 5.5),(-3.3, 5.5),(-1.1, 5.5),(3.3, 5.5),(5.5, 5.5),(7.7, 5.5),(14.3, 5.5),(20.9, 5.5),(-36.3, 3.3),(-34.1, 3.3),(-29.7, 3.3),(-27.5, 3.3),(-25.3, 3.3),(-20.9, 3.3),(-16.5, 3.3),(-14.3, 3.3),(-5.5, 3.3),(7.7, 3.3),(9.9, 3.3),(12.1, 3.3),(14.3, 3.3),(16.5, 3.3),(23.1, 3.3),(-36.3, 1.1),(-34.1, 1.1),(-29.7, 1.1),(-27.5, 1.1),(-25.3, 1.1),(-20.9, 1.1),(-18.7, 1.1),(-3.3, 1.1),(-1.1, 1.1),(5.5, 1.1),(7.7, 1.1),(12.1, 1.1),(14.3, 1.1),(16.5, 1.1),(20.9, 1.1),(23.1, 1.1),(25.3, 1.1),(27.5, 1.1),(29.7, 1.1),(31.9, 1.1),(-36.3, -1.1),(-34.1, -1.1),(-31.9, -1.1),(-29.7, -1.1),(-27.5, -1.1),(-23.1, -1.1),(-20.9, -1.1),(-18.7, -1.1),(-16.5, -1.1),(-14.3, -1.1),(-12.1, -1.1),(14.3, -1.1),(16.5, -1.1),(18.7, -1.1),(20.9, -1.1),(23.1, -1.1),(27.5, -1.1),(29.7, -1.1),(31.9, -1.1),(-36.3, -3.3),(-31.9, -3.3),(-25.3, -3.3),(-23.1, -3.3),(-20.9, -3.3),(-12.1, -3.3),(1.1, -3.3),(7.7, -3.3),(9.9, -3.3),(16.5, -3.3),(18.7, -3.3),(20.9, -3.3),(25.3, -3.3),(27.5, -3.3),(29.7, -3.3),(31.9, -3.3),(34.1, -3.3),(-34.1, -5.5),(-25.3, -5.5),(-23.1, -5.5),(-20.9, -5.5),(-18.7, -5.5),(-16.5, -5.5),(-14.3, -5.5),(-12.1, -5.5),(-1.1, -5.5),(3.3, -5.5),(5.5, -5.5),(7.7, -5.5),(9.9, -5.5),(16.5, -5.5),(18.7, -5.5),(20.9, -5.5),(23.1, -5.5),(25.3, -5.5),(29.7, -5.5),(34.1, -5.5),(36.3, -5.5),(-20.9, -7.7),(-18.7, -7.7),(-16.5, -7.7),(-14.3, -7.7),(-12.1, -7.7),(-3.3, -7.7),(-1.1, -7.7),(3.3, -7.7),(5.5, -7.7),(7.7, -7.7),(12.1, -7.7),(14.3, -7.7),(16.5, -7.7),(18.7, -7.7),(31.9, -7.7),(34.1, -7.7),(36.3, -7.7),(-16.5, -9.9),(-14.3, -9.9),(-12.1, -9.9),(-3.3, -9.9),(1.1, -9.9),(3.3, -9.9),(7.7, -9.9),(9.9, -9.9),(16.5, -9.9),(34.1, -9.9),(36.3, -9.9),(-16.5, -12.1),(-14.3, -12.1),(-12.1, -12.1),(-9.9, -12.1),(-7.7, -12.1),(-5.5, -12.1),(-3.3, -12.1),(9.9, -12.1),(12.1, -12.1),(14.3, -12.1),(16.5, -12.1),(18.7, -12.1),(20.9, -12.1),(23.1, -12.1),(34.1, -12.1),(36.3, -12.1),(-14.3, -14.3),(-12.1, -14.3),(-9.9, -14.3),(-7.7, -14.3),(-5.5, -14.3),(7.7, -14.3),(9.9, -14.3),(12.1, -14.3),(14.3, -14.3),(31.9, -14.3),(34.1, -14.3),(36.3, -14.3),(-12.1, -16.5),(-9.9, -16.5),(-7.7, -16.5),(-1.1, -16.5),(5.5, -16.5),(7.7, -16.5),(34.1, -16.5),(-9.9, -18.7),(-7.7, -18.7),(-5.5, -18.7),(-3.3, -18.7),(-1.1, -18.7),(1.1, -18.7),(3.3, -18.7),(29.7, -18.7),(31.9, -18.7),(-7.7, -20.9),(-5.5, -20.9),(-3.3, -20.9),(-1.1, -20.9),(1.1, -20.9),(3.3, -20.9),(14.3, -20.9),(25.3, -20.9),(27.5, -20.9),(29.7, -20.9),(31.9, -20.9),(9.9, -23.1),(14.3, -23.1),(16.5, -23.1),(18.7, -23.1),(20.9, -23.1),(23.1, -23.1),(25.3, -23.1),(27.5, -23.1),(29.7, -23.1),(9.9, -25.3),(12.1, -25.3),(14.3, -25.3),(16.5, -25.3),(20.9, -25.3),(23.1, -25.3),(25.3, -25.3)] mclover3_points = [(-9.9, 25.3),(-5.5, 23.1),(-29.7, 20.9),(-9.9, 20.9),(-36.3, 16.5),(-18.7, 12.1),(-12.1, 12.1),(14.3, 12.1),(-14.3, 9.9),(-12.1, 9.9),(14.3, 9.9),(-23.1, 3.3),(3.3, 3.3),(-14.3, 1.1),(-9.9, 1.1),(-7.7, 1.1),(-5.5, 1.1),(1.1, 1.1),(3.3, 1.1),(-5.5, -1.1),(-3.3, -1.1),(-1.1, -1.1),(1.1, -1.1),(-5.5, -3.3),(-1.1, -3.3),(-3.3, -5.5),(-5.5, -7.7),(-9.9, -9.9),(-7.7, -9.9),(18.7, -25.3)] mscarlet_i_points = [(-25.3, 23.1),(-5.5, 20.9),(-29.7, 18.7),(-27.5, 18.7),(-20.9, 18.7),(-7.7, 18.7),(-31.9, 16.5),(-27.5, 16.5),(-12.1, 16.5),(-5.5, 16.5),(12.1, 12.1),(-34.1, 9.9),(-23.1, 9.9),(3.3, 9.9),(12.1, 9.9),(16.5, 9.9),(-34.1, 7.7),(-20.9, 7.7),(14.3, 7.7),(18.7, 7.7),(-14.3, 5.5),(1.1, 3.3),(20.9, 3.3),(12.1, -1.1),(-9.9, -3.3),(14.3, -3.3),(1.1, -5.5),(3.3, -16.5),(34.1, -18.7)] mko2_points = [(-9.9, 23.1),(-7.7, 23.1),(-16.5, 20.9),(-14.3, 20.9),(-31.9, 18.7),(-14.3, 18.7),(-12.1, 18.7),(-9.9, 18.7),(-5.5, 18.7),(-3.3, 18.7),(-9.9, 16.5),(-7.7, 16.5),(-3.3, 16.5),(-36.3, 14.3),(-20.9, 14.3),(-7.7, 14.3),(-3.3, 14.3),(-36.3, 12.1),(-16.5, 12.1),(-7.7, 12.1),(5.5, 12.1),(-16.5, 9.9),(3.3, 7.7),(-31.9, 5.5),(-12.1, 5.5),(16.5, 5.5),(-31.9, 3.3),(-12.1, 3.3),(-9.9, 3.3),(-7.7, 3.3),(18.7, 3.3),(-31.9, 1.1),(-25.3, -1.1),(-18.7, -3.3),(-7.7, -3.3),(-3.3, -3.3),(12.1, -3.3),(-9.9, -5.5),(-7.7, -7.7),(5.5, -9.9),(12.1, -9.9),(14.3, -9.9),(5.5, -12.1),(1.1, -14.3),(3.3, -14.3),(5.5, -14.3),(1.1, -16.5),(5.5, -18.7)] azurite_points = [(-3.3, 20.9),(7.7, 9.9),(-38.5, 7.7),(9.9, 5.5),(12.1, 5.5)] electra2_points = [(9.9, 9.9),(25.3, -1.1)]

well_colors = { ‘A1’ : ‘Purple’, # mRFP1 / Electra2 ‘B1’ : ‘Pink’, # mClover3 / mScarlet-I ‘C1’ : ‘Blue’ # mKO2 / Azurite }

def run(protocol): tips_20ul = protocol.load_labware(‘opentrons_96_tiprack_20ul’, 9) pipette = protocol.load_instrument(“p20_single_gen2”, “right”, [tips_20ul]) temp_mod = protocol.load_module(’temperature module gen2’, 6) color_plate = temp_mod.load_labware(‘opentrons_96_aluminumblock_generic_pcr_strip_200ul’) agar_plate = protocol.load_labware(‘htgaa_agar_plate’, 5) center = agar_plate[‘A1’].top()

def location_of_color(color_name):
    for well, name in well_colors.items():
        if name.lower() == color_name.lower():
            return color_plate[well]
    return color_plate['A1']

def dispense_and_detach(vol, loc):
    above = loc.move(types.Point(z=5))
    pipette.move_to(above)
    pipette.dispense(vol, loc)
    pipette.move_to(above)

def draw_pattern(points, color, drop_vol=0.2):
    if not points: return
    pipette.pick_up_tip()
    current_pipette_vol = 0

    for i, (px, py) in enumerate(points):
        if current_pipette_vol < drop_vol:
            remaining_drops = len(points) - i
            asp_vol = min(20, remaining_drops * drop_vol)
            pipette.aspirate(asp_vol, location_of_color(color))
            current_pipette_vol = asp_vol

        target = center.move(types.Point(x=px, y=py))
        dispense_and_detach(drop_vol, target)
        current_pipette_vol -= drop_vol

    pipette.drop_tip()

# Drawing sequence with new colors
draw_pattern(mrfp1_points, 'Purple')
draw_pattern(mclover3_points, 'Pink')
draw_pattern(mscarlet_i_points, 'Pink')
draw_pattern(mko2_points, 'Blue')
draw_pattern(azurite_points, 'Blue')
draw_pattern(electra2_points, 'Purple')

Run simulation

protocol = OpentronsMock(well_colors) run(protocol) protocol.visualize()’