Skill Tracer
Skills › Scientific Agent Skills › opentrons-integration › pcr_setup_template.py

pcr_setup_template.py

152 lines · skills/opentrons-integration/scripts/pcr_setup_template.py at 5f2bc03

1"""Eight-reaction PCR setup and cycling template for Opentrons Flex.
2
3This is an automation example, not a validated PCR method. Confirm reagent
4volumes, dead volume, temperatures, cycle profile, plate, seal, and tip policy
5for the assay. Simulate and complete a nonhazardous dry run before use.
6"""
7
8from opentrons import protocol_api
9
10metadata = {
11 "protocolName": "Flex PCR Setup and Cycling Template",
12 "author": "Customize before use",
13 "description": "Prepare eight 25 µL PCR reactions and run a cycle profile.",
16requirements = {
17 "robotType": "Flex",
18 "apiLevel": "2.29",
22def run(protocol: protocol_api.ProtocolContext) -> None:
23 """Prepare eight reactions and run an example PCR program."""
24 thermocycler = protocol.load_module("thermocyclerModuleV2")
25 pcr_plate = thermocycler.load_labware(
26 "opentrons_96_wellplate_200ul_pcr_full_skirt",
27 label="PCR Plate",
28 )
30 tips_50 = protocol.load_labware(
31 "opentrons_flex_96_tiprack_50ul",
32 "C1",
33 label="50 µL Tips",
34 )
35 tips_200 = protocol.load_labware(
36 "opentrons_flex_96_tiprack_200ul",
37 "C2",
38 label="200 µL Tips",
39 )
40 reagent_rack = protocol.load_labware(
41 "opentrons_24_tuberack_nest_1.5ml_snapcap",
42 "D1",
43 label="PCR Reagents",
44 )
45 protocol.load_trash_bin("A3")
47 small_pipette = protocol.load_instrument(
48 "flex_1channel_50",
49 "left",
50 tip_racks=[tips_50],
51 )
52 large_pipette = protocol.load_instrument(
53 "flex_1channel_1000",
54 "right",
55 tip_racks=[tips_200],
56 )
58 sample_count = 8
59 master_mix_volume_ul = 20
60 template_volume_ul = 5
61 reaction_volume_ul = master_mix_volume_ul + template_volume_ul
63 master_mix = protocol.define_liquid(
64 name="PCR Master Mix",
65 description="Assay-specific master mix",
66 display_color="#E377C2",
67 )
68 template_dna = protocol.define_liquid(
69 name="Template DNA",
70 description="DNA samples 1-8",
71 display_color="#2CA02C",
72 )
73 reagent_rack.load_liquid(
74 wells=["A1"],
75 volume=300,
76 liquid=master_mix,
77 )
78 reagent_rack.load_liquid(
79 wells=reagent_rack.wells()[1 : sample_count + 1],
80 volume=20,
81 liquid=template_dna,
82 )
83 pcr_plate.load_empty(wells=pcr_plate.wells()[:sample_count])
85 thermocycler.open_lid()
87 with protocol.group_steps(
88 name="Distribute Master Mix",
89 description="Add 20 µL master mix to reactions A1-H1.",
90 ):
91 large_pipette.distribute(
92 volume=master_mix_volume_ul,
93 source=reagent_rack["A1"],
94 dest=pcr_plate.wells()[:sample_count],
95 new_tip="once",
96 disposal_volume=10,
97 )
99 with protocol.group_steps(
100 name="Add Templates",
101 description="Add one DNA template to each PCR reaction.",
102 ):
103 for index in range(sample_count):
104 small_pipette.transfer(
105 volume=template_volume_ul,
106 source=reagent_rack.wells()[index + 1],
107 dest=pcr_plate.wells()[index],
108 mix_after=(3, 20),
109 new_tip="always",
110 )
112 with protocol.group_steps(
113 name="Run PCR",
114 description="Confirm the plate seal, close the lid, and run the profile.",
115 ):
116 protocol.pause(
117 "Verify the PCR sealing setup and plate seating. Use a compatible "
118 "seal or lid according to its instructions; do not combine a "
119 "disposable auto-sealing lid with the Thermocycler's rubber seal. "
120 "Resume only when ready to close and heat."
121 )
122 thermocycler.close_lid()
123 thermocycler.set_lid_temperature(temperature=105)
124 thermocycler.set_block_temperature(
125 temperature=95,
126 hold_time_seconds=180,
127 block_max_volume=reaction_volume_ul,
128 )
129 thermocycler.execute_profile(
130 steps=[
131 {"temperature": 95, "hold_time_seconds": 15},
132 {"temperature": 60, "hold_time_seconds": 30},
133 {"temperature": 72, "hold_time_seconds": 30},
134 ],
135 repetitions=35,
136 block_max_volume=reaction_volume_ul,
137 )
138 thermocycler.set_block_temperature(
139 temperature=72,
140 hold_time_minutes=5,
141 block_max_volume=reaction_volume_ul,
142 )
143 thermocycler.set_block_temperature(
144 temperature=4,
145 block_max_volume=reaction_volume_ul,
146 )
147 thermocycler.deactivate_lid()
148 thermocycler.open_lid()
150 protocol.comment(
151 "PCR complete. The block remains at 4 °C until the run is stopped."
152 )