-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5051 from Opentrons/0f7910-add-csv
fix(protocols/0f7910): add transfer volume to csv
- Loading branch information
Showing
6 changed files
with
18 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"content": "from opentrons import protocol_api\n\nmetadata = {\n 'protocolName': 'Plate Filling with CSV Import',\n 'author': 'Rami Farawi <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [csv_samp,\n source_format,\n dest_format,\n transfer_vol,\n starting_tip,\n p300_mount,\n p20_mount] = get_values( # noqa: F821\n \"csv_samp\",\n \"source_format\",\n \"dest_format\",\n \"transfer_vol\",\n \"starting_tip\",\n \"p300_mount\",\n \"p20_mount\")\n\n # mapping\n csv_lines = [[val.strip() for val in line.split(',')]\n for line in csv_samp.splitlines()\n if line.split(',')[0].strip()][1:]\n\n unique_list = []\n for row in csv_lines:\n source_plate_slot = int(row[1])\n if source_plate_slot not in unique_list:\n unique_list.append(source_plate_slot)\n\n starting_tip -= starting_tip\n\n # labware\n source_plates = [ctx.load_labware(\n 'corning_96_wellplate_360ul_flat'\n if source_format == \"96\"\n else \"corning_384_wellplate_112ul_flat\", slot)\n for slot in unique_list]\n source_plates = source_plates\n\n dest_plate = ctx.load_labware(\n 'corning_96_wellplate_360ul_flat'\n if dest_format == \"96\"\n else \"corning_384_wellplate_112ul_flat\", 2\n if dest_format == \"384\"\n else 1)\n\n if transfer_vol > 20:\n tips300 = [ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in [10]]\n else:\n tips20 = [ctx.load_labware('opentrons_96_tiprack_20ul', slot)\n for slot in [11]]\n\n # pipettes\n if transfer_vol > 20:\n p300 = ctx.load_instrument('p300_single_gen2', p300_mount,\n tip_racks=tips300)\n\n else:\n p20 = ctx.load_instrument('p20_single_gen2', p20_mount,\n tip_racks=tips20)\n\n def pick_up(pip):\n try:\n pip.pick_up_tip()\n except protocol_api.labware.OutOfTipsError:\n ctx.pause(\"Replace empty tip racks.\")\n pip.reset_tipracks()\n pick_up(pip)\n\n # protocol\n pip = p20 if transfer_vol <= 20 else p300\n pip.flow_rate.aspirate = 1\n pip.flow_rate.dispense = 2\n if transfer_vol > 20:\n pip.starting_tip = tips300[0].wells()[starting_tip]\n else:\n pip.starting_tip = tips20[0].wells()[starting_tip]\n for row in csv_lines:\n source_plate_slot = int(row[1])\n source_well_name = row[2]\n dest_well_name = row[4]\n\n source = ctx.loaded_labwares[source_plate_slot].wells_by_name()[source_well_name] # noqa: E501\n dest = dest_plate.wells_by_name()[dest_well_name]\n\n pick_up(pip)\n pip.transfer(transfer_vol, source.bottom(z=0.2), dest, new_tip='never',\n blow_out=True, blowout_location='destination well')\n pip.drop_tip()\n ctx.comment('\\n\\n')\n", | ||
"content": "from opentrons import protocol_api\n\n\nmetadata = {\n 'protocolName': 'Plate Filling with CSV Import',\n 'author': 'Rami Farawi <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [csv_samp,\n source_format,\n dest_format,\n starting_tip,\n p300_mount,\n p20_mount] = get_values( # noqa: F821\n \"csv_samp\",\n \"source_format\",\n \"dest_format\",\n \"starting_tip\",\n \"p300_mount\",\n \"p20_mount\")\n\n # mapping\n csv_lines = [[val.strip() for val in line.split(',')]\n for line in csv_samp.splitlines()\n if line.split(',')[0].strip()][1:]\n\n unique_list = []\n for row in csv_lines:\n source_plate_slot = int(row[1])\n if source_plate_slot not in unique_list:\n unique_list.append(source_plate_slot)\n\n starting_tip -= starting_tip\n\n # labware\n source_plates = [ctx.load_labware(\n 'corning_96_wellplate_360ul_flat'\n if source_format == \"96\"\n else \"corning_384_wellplate_112ul_flat\", slot)\n for slot in unique_list]\n source_plates = source_plates\n\n dest_plate = ctx.load_labware(\n 'corning_96_wellplate_360ul_flat'\n if dest_format == \"96\"\n else \"corning_384_wellplate_112ul_flat\", 2\n if dest_format == \"384\"\n else 1)\n transfer_vol = float(csv_lines[0][5])\n\n if transfer_vol > 20:\n tips300 = [ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in [10]]\n else:\n tips20 = [ctx.load_labware('opentrons_96_tiprack_20ul', slot)\n for slot in [11]]\n\n # pipettes\n if transfer_vol > 20:\n p300 = ctx.load_instrument('p300_single_gen2', p300_mount,\n tip_racks=tips300)\n\n else:\n p20 = ctx.load_instrument('p20_single_gen2', p20_mount,\n tip_racks=tips20)\n\n def pick_up(pip):\n try:\n pip.pick_up_tip()\n except protocol_api.labware.OutOfTipsError:\n ctx.pause(\"Replace empty tip racks.\")\n pip.reset_tipracks()\n pick_up(pip)\n\n # protocol\n\n pip = p20 if transfer_vol <= 20 else p300\n pip.flow_rate.aspirate = 1\n pip.flow_rate.dispense = 2\n\n if transfer_vol > 20:\n pip.starting_tip = tips300[0].wells()[starting_tip]\n else:\n pip.starting_tip = tips20[0].wells()[starting_tip]\n\n for row in csv_lines:\n source_plate_slot = int(row[1])\n source_well_name = row[2]\n dest_well_name = row[4]\n\n source = ctx.loaded_labwares[source_plate_slot].wells_by_name()[source_well_name] # noqa: E501\n dest = dest_plate.wells_by_name()[dest_well_name]\n\n pick_up(pip)\n pip.mix(1, transfer_vol, source.bottom(z=0.2))\n pip.aspirate(transfer_vol, source.bottom(z=0.2))\n pip.dispense(transfer_vol, dest)\n pip.move_to(dest.top(z=-3))\n ctx.delay(seconds=1)\n pip.blow_out()\n pip.drop_tip()\n ctx.comment('\\n\\n')\n", | ||
"custom_labware_defs": [], | ||
"fields": [ | ||
{ | ||
"default": "Source plate Barcode,Source plate location,Source well,Destination plate Barcode,Destination well\nDDDD,3,C1,ABCD,A1\nEEEE,3,A1,BBBD,B1", | ||
"default": "Source plate Barcode,Source plate location,Source well,Destination plate Barcode,Destination well\nDDDD,3,C1,ABCD,A1,12.4\nEEEE,3,A1,BBBD,B1,12.4", | ||
"label": ".CSV File", | ||
"name": "csv_samp", | ||
"type": "textFile" | ||
|
@@ -38,12 +38,6 @@ | |
], | ||
"type": "dropDown" | ||
}, | ||
{ | ||
"default": 12, | ||
"label": "Transfer Volume", | ||
"name": "transfer_vol", | ||
"type": "int" | ||
}, | ||
{ | ||
"default": 1, | ||
"label": "Starting Tip in Tip Rack (1-96, by column)", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from opentrons import protocol_api | ||
|
||
|
||
metadata = { | ||
'protocolName': 'Plate Filling with CSV Import', | ||
'author': 'Rami Farawi <[email protected]>', | ||
|
@@ -13,14 +14,12 @@ def run(ctx): | |
[csv_samp, | ||
source_format, | ||
dest_format, | ||
transfer_vol, | ||
starting_tip, | ||
p300_mount, | ||
p20_mount] = get_values( # noqa: F821 | ||
"csv_samp", | ||
"source_format", | ||
"dest_format", | ||
"transfer_vol", | ||
"starting_tip", | ||
"p300_mount", | ||
"p20_mount") | ||
|
@@ -52,6 +51,7 @@ def run(ctx): | |
else "corning_384_wellplate_112ul_flat", 2 | ||
if dest_format == "384" | ||
else 1) | ||
transfer_vol = float(csv_lines[0][5]) | ||
|
||
if transfer_vol > 20: | ||
tips300 = [ctx.load_labware('opentrons_96_tiprack_300ul', slot) | ||
|
@@ -78,13 +78,16 @@ def pick_up(pip): | |
pick_up(pip) | ||
|
||
# protocol | ||
|
||
pip = p20 if transfer_vol <= 20 else p300 | ||
pip.flow_rate.aspirate = 1 | ||
pip.flow_rate.dispense = 2 | ||
|
||
if transfer_vol > 20: | ||
pip.starting_tip = tips300[0].wells()[starting_tip] | ||
else: | ||
pip.starting_tip = tips20[0].wells()[starting_tip] | ||
|
||
for row in csv_lines: | ||
source_plate_slot = int(row[1]) | ||
source_well_name = row[2] | ||
|
@@ -94,7 +97,11 @@ def pick_up(pip): | |
dest = dest_plate.wells_by_name()[dest_well_name] | ||
|
||
pick_up(pip) | ||
pip.transfer(transfer_vol, source.bottom(z=0.2), dest, new_tip='never', | ||
blow_out=True, blowout_location='destination well') | ||
pip.mix(1, transfer_vol, source.bottom(z=0.2)) | ||
pip.aspirate(transfer_vol, source.bottom(z=0.2)) | ||
pip.dispense(transfer_vol, dest) | ||
pip.move_to(dest.top(z=-3)) | ||
ctx.delay(seconds=1) | ||
pip.blow_out() | ||
pip.drop_tip() | ||
ctx.comment('\n\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters