Skip to content

K-Dense-AI/scientific-agent-skills / skills/opentrons-integration

opentrons-integration

Verified

Authors, reviews, migrates, simulates, and troubleshoots official Opentrons Python Protocol API v2 protocols for Flex and OT-2 robots. Use for robot-specific liquid handling, deck and labware setup, pipettes, modules, runtime parameters, liquid classes, and Opentrons App analysis. Use pylabrobot instead when one workflow must support multiple robot vendors.

scripts/pcr_setup_template.py

View on GitHub
"""Eight-reaction PCR setup and cycling template for Opentrons Flex.

This is an automation example, not a validated PCR method. Confirm reagent
volumes, dead volume, temperatures, cycle profile, plate, seal, and tip policy
for the assay. Simulate and complete a nonhazardous dry run before use.
"""

from opentrons import protocol_api

metadata = {
    "protocolName": "Flex PCR Setup and Cycling Template",
    "author": "Customize before use",
    "description": "Prepare eight 25 µL PCR reactions and run a cycle profile.",
}

requirements = {
    "robotType": "Flex",
    "apiLevel": "2.29",
}


def run(protocol: protocol_api.ProtocolContext) -> None:
    """Prepare eight reactions and run an example PCR program."""
    thermocycler = protocol.load_module("thermocyclerModuleV2")
    pcr_plate = thermocycler.load_labware(
        "opentrons_96_wellplate_200ul_pcr_full_skirt",
        label="PCR Plate",
    )

    tips_50 = protocol.load_labware(
        "opentrons_flex_96_tiprack_50ul",
        "C1",
        label="50 µL Tips",
    )
    tips_200 = protocol.load_labware(
        "opentrons_flex_96_tiprack_200ul",
        "C2",
        label="200 µL Tips",
    )
    reagent_rack = protocol.load_labware(
        "opentrons_24_tuberack_nest_1.5ml_snapcap",
        "D1",
        label="PCR Reagents",
    )
    protocol.load_trash_bin("A3")

    small_pipette = protocol.load_instrument(
        "flex_1channel_50",
        "left",
        tip_racks=[tips_50],
    )
    large_pipette = protocol.load_instrument(
        "flex_1channel_1000",
        "right",
        tip_racks=[tips_200],
    )

    sample_count = 8
    master_mix_volume_ul = 20
    template_volume_ul = 5
    reaction_volume_ul = master_mix_volume_ul + template_volume_ul

    master_mix = protocol.define_liquid(
        name="PCR Master Mix",
        description="Assay-specific master mix",
        display_color="#E377C2",
    )
    template_dna = protocol.define_liquid(
        name="Template DNA",
        description="DNA samples 1-8",
        display_color="#2CA02C",
    )
    reagent_rack.load_liquid(
        wells=["A1"],
        volume=300,
        liquid=master_mix,
    )
    reagent_rack.load_liquid(
        wells=reagent_rack.wells()[1 : sample_count + 1],
        volume=20,
        liquid=template_dna,
    )
    pcr_plate.load_empty(wells=pcr_plate.wells()[:sample_count])

    thermocycler.open_lid()

    with protocol.group_steps(
        name="Distribute Master Mix",
        description="Add 20 µL master mix to reactions A1-H1.",
    ):
        large_pipette.distribute(
            volume=master_mix_volume_ul,
            source=reagent_rack["A1"],
            dest=pcr_plate.wells()[:sample_count],
            new_tip="once",
            disposal_volume=10,
        )

    with protocol.group_steps(
        name="Add Templates",
        description="Add one DNA template to each PCR reaction.",
    ):
        for index in range(sample_count):
            small_pipette.transfer(
                volume=template_volume_ul,
                source=reagent_rack.wells()[index + 1],
                dest=pcr_plate.wells()[index],
                mix_after=(3, 20),
                new_tip="always",
            )

    with protocol.group_steps(
        name="Run PCR",
        description="Confirm the plate seal, close the lid, and run the profile.",
    ):
        protocol.pause(
            "Verify the PCR sealing setup and plate seating. Use a compatible "
            "seal or lid according to its instructions; do not combine a "
            "disposable auto-sealing lid with the Thermocycler's rubber seal. "
            "Resume only when ready to close and heat."
        )
        thermocycler.close_lid()
        thermocycler.set_lid_temperature(temperature=105)
        thermocycler.set_block_temperature(
            temperature=95,
            hold_time_seconds=180,
            block_max_volume=reaction_volume_ul,
        )
        thermocycler.execute_profile(
            steps=[
                {"temperature": 95, "hold_time_seconds": 15},
                {"temperature": 60, "hold_time_seconds": 30},
                {"temperature": 72, "hold_time_seconds": 30},
            ],
            repetitions=35,
            block_max_volume=reaction_volume_ul,
        )
        thermocycler.set_block_temperature(
            temperature=72,
            hold_time_minutes=5,
            block_max_volume=reaction_volume_ul,
        )
        thermocycler.set_block_temperature(
            temperature=4,
            block_max_volume=reaction_volume_ul,
        )
        thermocycler.deactivate_lid()
        thermocycler.open_lid()

    protocol.comment(
        "PCR complete. The block remains at 4 °C until the run is stopped."
    )
planning-and-task-breakdownaddyosmani/agent-skillsBreaks work into ordered tasks. Use when you have a spec or clear requirements and need to break work into implementable tasks. Use when a task feels too large to start, when you need to estimate scope, or when parallel work is possible.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
screenpipethedotmack/claude-memSearch screen and audio history recorded by Screenpipe and optionally save selected context into claude-mem. Use when the user asks to recall desktop activity, a meeting, or something seen in another app through Screenpipe.Stars: 118kUpdated Claude CodeCodexVerifiedInstall
contact-widgetnexu-io/open-designSelf-contained floating chat widget with welcome screen, social links, meeting button, and message input. Single HTML file, zero dependencies.Stars: 108kUpdated Claude CodeCodexVerifiedInstall
meeting-notesnexu-io/open-designMeeting notes page — title bar with attendees, agenda checklist, decisions block, action items table with owners + dates, and a "next meeting" footer. Use when the brief mentions "meeting notes", "minutes", "1:1 notes", "all-hands recap", or "会议纪要".Stars: 108kUpdated Claude CodeCodexVerifiedInstall