Week 3 HW: Lab Automation
Assignment: Python Script for Opentrons Artwork
Link: https://colab.research.google.com/drive/1G9DLa7Y6og9m0Ik8HrF0KU1YG555WzoK?usp=sharing
MY CODE:
import math
################################
GREEN SECTION (Body + Flagella)
################################
pipette_20ul.pick_up_tip() center = center_location
Oval body:
a = 16 b = 8 points = 40
for i in range(points):
if i % 8 == 0:
pipette_20ul.aspirate(8, location_of_color('Green'))
angle = 2 * math.pi * i / points
x = a * math.cos(angle)
y = b * math.sin(angle)
loc = center.move(types.Point(x=x, y=y, z=0))
dispense_and_detach(pipette_20ul, 1, loc)
Flagella:
flagella_points = 6
for i in range(flagella_points):
pipette_20ul.aspirate(6, location_of_color('Green'))
angle = 2 * math.pi * i / flagella_points
start_x = (a + 1) * math.cos(angle)
start_y = (b + 1) * math.sin(angle)
for t in range(5):
fx = start_x + t * 2 * math.cos(angle)
fy = start_y + t * 2 * math.sin(angle)
loc = center.move(types.Point(x=fx, y=fy, z=0))
dispense_and_detach(pipette_20ul, 1, loc)
pipette_20ul.drop_tip()
################################
RED SECTION (Eyes + Smile)
################################
pipette_20ul.pick_up_tip()
Eyes:
pipette_20ul.aspirate(4, location_of_color(‘Red’))
left_eye = center.move(types.Point(x=-5, y=2, z=0))
right_eye = center.move(types.Point(x=5, y=2, z=0))
dispense_and_detach(pipette_20ul, 2, left_eye)
dispense_and_detach(pipette_20ul, 2, right_eye)
Smile:
smile_points = 15
pipette_20ul.aspirate(15, location_of_color(‘Red’))
for i in range(smile_points):
angle = math.pi * i / smile_points
x = 6 * math.cos(angle)
y = -3 * math.sin(angle) - 2
loc = center.move(types.Point(x=x, y=y, z=0))
dispense_and_detach(pipette_20ul, 1, loc)
pipette_20ul.drop_tip()
Don’t forget to end with a drop_tip()
RESULT :) :

AI tools (ChatGPT and Gemini) assisted in suggesting mathematical approaches for generating an oval body and radial flagella. I reviewed, modified and finalized the code to ensure correct simulation behavior and compliance with lab constraints (volume limits).
Post-Lab Questions:
One of the great parts about having an automated robot is being able to precisely mix, deposit, and run reactions without much intervention, and design and deploy experiments remotely.
For this week, we’d like for you to do the following:
- Find and describe a published paper that utilizes the Opentrons or an automation tool to achieve novel biological applications.
Paper link: https://www.sciencedirect.com/science/article/pii/S2472630325000263

This paper describes how an Opentrons - 2 liquid handling robot can be used to automate and scale up protein crystallization experiments which is a foundational step in structural biology that is traditionally manual intensive. The robot was programmed via Python scripts to prepare 24 well sitting drop crystallization trials with precise reagent mixing and drop deposition. By comparing results against standard manual setup, the study showed that automation:
- Reduce hands-on labor and variability, improving reproducibility.
- Produce consistent crystal growth for both model proteins (hen egg white lysozyme) and a periplasmic protein from Campylobacter jejuni.
- Scale preparation in a way that could benefit labs doing structural studies or materials research requiring uniform crystal batches.
I find this application novel because protein crystallization is a critical but laborious step in X - ray crystallography and related structural methods. Most labs still perform it manually or with high-cost automation. This work shows that a relatively low - cost, open-programmable robot like Opentrons - 2 can reliably handle complex setup steps, lowering the barrier to high-throughput crystallization workflows and enabling new scale and reproducibility in structural biology applications
- Write a description about what you intend to do with automation tools for your final project. You may include example pseudocode, Python scripts, 3D printed holders, a plan for how to use Ginkgo Nebula, and more. You may reference this week’s recitation slide deck for lab automation details. While your description/project idea doesn’t need to be set in stone, we would like to see core details of what you would automate. This is due at the start of lecture and does not need to be tested on the Opentrons yet.
What I Would Automate?
A) Automated DNA Assembly & Construct Library Design
Using a liquid handling robot such as the Opentrons OT-2, I would automate Golden Gate or Gibson assembly reactions to generate a small library of salt-inducible constructs:
- Normalize DNA part concentrations.
- Set up combinatorial assembly reactions.
- Transform into competent cells.
- Plate onto selective media.
Python:
for promoter in promoter_list:
for gene in response_genes:
assemble_mix = {
"promoter": promoter,
"gene": gene,
"backbone": vector
}
pipette.transfer(2, promoter, assembly_well)
pipette.transfer(2, gene, assembly_well)
pipette.transfer(1, backbone, assembly_well)
pipette.mix(5, 10, assembly_well)
B) Automated Salinity Gradient Screening
To test salt responsiveness the Opentrons OT-2 liquid handling robot would:
- Prepare a 96-well plate with increasing NaCl concentrations (0–400 mM).
- Inoculate engineered strains.
If I would use a cloud lab platform such as Ginkgo Bioworks’s Ginkgo Nebula (conceptually), the workflow would include:
-Automated liquid handling for salt gradients. -Plate sealing and incubation. -Automated plate reader measurements. -Data export for downstream analysis.
C) Data Processing & Optimization
I would automate analysis using Python:
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_csv(“plate_reader_output.csv”)
grouped = data.groupby(“NaCl_concentration”).mean()
plt.plot(grouped.index, grouped[“fluorescence”])
plt.xlabel(“NaCl (mM)”)
plt.ylabel(“Normalized Fluorescence”)
plt.show()