Skip to content

Instantly share code, notes, and snippets.

@beniroquai
Last active February 7, 2024 14:20
Show Gist options
  • Save beniroquai/ddd1d4504e17dc68f4bb6770e951ca8a to your computer and use it in GitHub Desktop.
Save beniroquai/ddd1d4504e17dc68f4bb6770e951ca8a to your computer and use it in GitHub Desktop.
Micro Plaque Essay using Autonomous Microscopy, Robots and Liquid Handling

Title: Automated Protocol for Phage Detection and Analysis

Objective: To detect and analyze bacteriophages using a combination of automated pipetting, robotic handling, microscopy, and image processing.

Equipment:

  1. 96 Well scanning microscope (openUC2 FiveD)
  2. Pipetting robots (Opentrons OT2)
  3. Transfering Robot Arm (Dorna 2)

Reagents:

  1. Phage Solution 100 PFU (Phage types 1-8)
  2. Bacteria (1Mio Cells/ml)
  3. Growth Media

Procedure:

Step 1: Preparation

  • Ensure all machines are calibrated and ready for use.
  • Prepare Growth Media and bacterial culture at 1Mio Cells/ml.
  • Prepare Phage Solutions with designated PFUs (Plaque-Forming Units).

Step 2: Initial Dispensing (Opentrons OT2)

  • Dispense bacteria into all 96 wells of a microtiter plate.
  • Create a dilution series of phages (low, medium, high concentrations) mixed with bacteria for each phage type (1-8). TODO: Exact Ratios
  • Mix Bacteria and Phages thoroughly using a pipette tip.
  • Incubate at room temperature for 10 minutes to allow bacteria to sediment.

Step 3: Microscopic Analysis Preparation

  • Bring the microscope in the sample accept position to receive the well plate

Step 4: Transfer to Microscope (Dorna 2 Robot Arm)

  • Transfer the plate from Opentrons OT2 to the microscope.
  • Supply a new plate to the Opentrons OT2 for subsequent experiments.

Step 5: Microscopic Imaging (96 Well Scanning Microscope)

  • Perform periodic imaging at random locations in every well for 4 hours, with images taken every 2 minutes.

Step 6: Image Processing and Analysis

  • Track timelapse series for each well location.
  • Measure bacterial growth rate by assessing pixel variance after applying a Gaussian blur to the images.
  • Display growth curves in real-time graphs.
  • Analyze the data to identify which phage shows effective infection against the host bacteria.
  • Select the top 4 phage candidates for potential therapeutic use.

Step 7: Sample Retrieval (Microscope to Opentrons)

  • Return the microtiter plate to the Opentrons OT2 robot using the Dorna 2 Robot Arm.

Step 8: Agar Plate Preparation (Opentrons OT2)

  • Dispense solutions from the 4 selected well locations onto 4 separate agar plates.
  • Ensure each agar plate is labeled corresponding to the phage candidate.

Step 9: Incubation

  • Transfer agar plates to the incubation unit using the Robot Arm.
  • Incubate for 24 hours.

Step 10: Post-Incubation Analysis

  • After incubation, transfer agar plates back to the microscope using the Robot Arm.
  • Swap to a low magnification lens on the microscope.
  • Perform a comprehensive scan of each plate.

Step 11: Final Image Processing

  • Analyze the plates for plaque formation.
  • Interpret the data to recommend the most effective phage for treatment.

Additional steps:

  • Amplify phages by picking spots and applying phages to newly dispensed bacteria

Notes:

  • Ensure all equipment is operated according to their specific manuals and safety guidelines.
  • Maintain sterile conditions throughout the procedure to prevent contamination.
  • Record all observations and data systematically for each step of the process.
  • Dispose of all biological waste according to appropriate biosafety protocols.

Pseudo code:

{
    "protocolName": "Automated Phage Detection and Analysis",
    "objective": "To detect and analyze bacteriophages using automation",
    "stations":[
        "Lab": "Room XYZ",
        "Robot": "Dorna 2",
        "Microscope: "openUC2 FiveD", 
        "Pipetter": "Opentrons OT2",
        "Incubator": "Egg incubator",
        "Server": "Image Processing Computer"
    ],
    "steps": [
        {
            "stepNumber": 1,
            "description": "Preparation",
            "station": "Lab",
            "actions": [
                "Calibrate all machines",
                "Prepare Growth Media",
                "Prepare bacterial culture",
                "Prepare Phage Solutions"
            ]
        },
        {
            "stepNumber": 2,
            "station": "Pipetting Robot",
            "description": "Initial Dispensing",
            "actions": [
                "Dispense bacteria into 96 wells",
                "Create dilution series of phages",
                "Mix Bacteria and Phages",
                "Incubate for sedimentation"
            ]
        },
        {
            "stepNumber": 3,
            "station": "Microscope",
            "description": "Preparation for Microscopic Analysis",
            "actions": [
                "Place the plate in sample accept position"
            ]
        },
        {
            "stepNumber": 4,
            "station": "Robot",
            "description": "Transfer to Microscope",
            "actions": [
                "Transfer plate to microscope",
                "Supply new plate to Opentrons OT2"
            ]
        },
        {
            "stepNumber": 5,
            "station": "Microscope",
            "description": "Microscopic Imaging",
            "actions": [
                "Perform periodic imaging for 4 hours"
            ]
        },
        {
            "stepNumber": 6,
            "station": "Server",
            "description": "Analysis",
            "actions": [
                "Track timelapse series",
                "Measure growth rate",
                "Display real-time growth graphs",
                "Analyze for effective phage",
                "Select top 4 phage candidates"
            ]
        },
        {
            "stepNumber": 7,
            "station": "Robot",
            "description": "Sample Retrieval",
            "actions": [
                "Return plate to Opentrons OT2"
            ]
        },
        {
            "stepNumber": 8,
            "station": "Pipetting Robot",
            "description": "Agar Plate Preparation",
            "actions": [
                "Dispense solutions onto agar plates",
                "Label agar plates"
            ]
        },
        {
            "stepNumber": 9,
            "station": "Incubator",
            "description": "Incubation",
            "actions": [
                "Transfer agar plates for incubation",
                "Incubate for 4 hours"
            ]
        },
        {
            "stepNumber": 10,
            "station": "Microscope",
            "description": "Post-Incubation Analysis",
            "actions": [
                "Transfer agar plates to microscope",
                "Perform plate scan"
            ]
        },
        {
            "stepNumber": 11,
            "station": "Server",
            "description": "Final Analysis",
            "actions": [
                "Perform plaque analysis",
                "Recommend effective phage for treatment"
            ]
        }
    ],
    "notes": [
        "Operate equipment as per manuals",
        "Maintain sterile conditions",
        "Record observations systematically",
        "Dispose of biological waste properly"
    ]
}


## OT2 Code (from chatGPT):

```py
import requests

class MicroscopeLaserController:
    def __init__(self, base_url="https://youseetoo.github.io/LaserController/"):
        self.base_url = base_url
    
    def set_laser_value(self, laser_name, value):
        """Set the laser's value.

        Args:
            laser_name (str): The name of the laser.
            value (int): The value to set the laser to (e.g., 1 for on, 0 for off).
        
        Returns:
            dict: The response from the laser controller.
        """
        # Construct the URL for setting the laser value
        url = f"{self.base_url}setLaserValue?laserName={laser_name}&value={value}"
        
        try:
            # Make the request to set the laser value
            response = requests.get(url)
            # Check if the request was successful
            if response.status_code == 200:
                # Return the response as a dictionary
                return response.json()
            else:
                return {"error": "Failed to set laser value", "status_code": response.status_code}
        except requests.RequestException as e:
            return {"error": str(e)}

# Example usage
if __name__ == "__main__":
    laser_controller = MicroscopeLaserController()
    result = laser_controller.set_laser_value("ESP32Laser", 1)
    print(result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment