本文整理汇总了Python中autoprotocol.protocol.Protocol.transfer方法的典型用法代码示例。如果您正苦于以下问题:Python Protocol.transfer方法的具体用法?Python Protocol.transfer怎么用?Python Protocol.transfer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autoprotocol.protocol.Protocol
的用法示例。
在下文中一共展示了Protocol.transfer方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_one_tip
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_one_tip(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
p.transfer(c.wells_from(0, 2), c.wells_from(2, 2), "20:microliter",
one_tip=True)
self.assertEqual(c.well(2).volume, c.well(3).volume)
self.assertEqual(1, len(p.instructions[0].groups))
示例2: test_single_transfer
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_single_transfer(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
p.transfer(c.well(0), c.well(1), "20:microliter")
self.assertEqual(Unit(20, "microliter"), c.well(1).volume)
self.assertEqual(None, c.well(0).volume)
self.assertTrue("transfer" in p.instructions[-1].groups[-1])
示例3: test_web_example
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_web_example(self):
p = Protocol()
bacterial_sample = p.ref("bacteria", None, "micro-1.5", discard=True)
test_plate = p.ref("test_plate", None, "96-flat", storage="cold_4")
p.dispense_full_plate(test_plate, "lb-broth-noAB", "50:microliter")
w = 0
amt = 1
while amt < 20:
p.transfer(bacterial_sample.well(
0), test_plate.well(w), "%d:microliter" % amt)
amt += 2
w += 1
pjsonString = json.dumps(p.as_dict(), indent=2)
pjson = json.loads(pjsonString)
parser_instance = english.AutoprotocolParser(pjson)
parser_instance.job_tree()
parsed_output = parser_instance.parsed_output
steps = parser_instance.object_list
forest = parser_instance.forest_list
self.assertEqual(forest, [[1], [2], [3], [4], [5], [
6], [7], [8], [9], [10], [11]])
示例4: test_sequence_cover_instructions
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_sequence_cover_instructions(self):
p = Protocol()
cont1 = p.ref("c1", None, "384-pcr", storage="cold_4")
cont2 = p.ref("c2", None, "384-pcr", storage="cold_4")
cont3 = p.ref("c3", None, "96-deep", storage="cold_4")
cont4 = p.ref("c4", None, "micro-1.5", storage="cold_4")
cont5 = p.ref("c5", None, "384-echo", discard=True)
therm_groups = [
{
"cycles": 1,
"steps": [
{
"temperature": "37:celsius",
"duration": "60:minute"
},
]
}
]
p.incubate(cont1, "ambient", duration="1:minute")
self.assertEqual(p.instructions[0].op, "seal")
self.assertEqual(p.instructions[1].op, "incubate")
self.assertEqual(cont1.cover, 'ultra-clear')
p.spin(cont1, acceleration="1000:g", duration="2:minute")
self.assertEqual(cont1.cover, "ultra-clear")
self.assertEqual(cont2.cover, None)
p.thermocycle(cont2, groups=therm_groups)
self.assertEqual(cont2.cover, "ultra-clear")
p.transfer(cont2.well(0), cont1.well(1), volume="1:microliter")
self.assertEqual(cont1.cover, None)
self.assertEqual(cont2.cover, None)
with self.assertRaises(RuntimeError):
p.cover(cont2)
p.seal(cont2)
p.thermocycle(cont1, groups=therm_groups)
self.assertEqual(cont1.cover, "ultra-clear")
p.spin(cont1, acceleration="1000:g", duration="2:minute")
p.spin(cont2, acceleration="1000:g", duration="2:minute")
p.spin(cont5, acceleration="1000:g", duration="2:minute")
self.assertEqual(cont1.cover, "ultra-clear")
self.assertEqual(cont2.cover, "ultra-clear")
self.assertEqual(cont5.cover, "universal")
p.uncover(cont5)
p.unseal(cont1)
p.transfer(cont4.well(0), cont3.well(0), "1:microliter")
p.spin(cont4, acceleration="1000:g", duration="2:minute")
self.assertEqual(cont4.cover, None)
with self.assertRaises(RuntimeError):
p.thermocycle(cont4, groups=therm_groups)
seal_on_store(p)
self.assertEqual(cont1.cover, "ultra-clear")
self.assertEqual(cont2.cover, "ultra-clear")
self.assertEqual(cont3.cover, "standard")
self.assertEqual(cont4.cover, None)
self.assertEqual(cont5.cover, None)
示例5: test_gt_750uL_wellgroup_transfer
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_gt_750uL_wellgroup_transfer(self):
p = Protocol()
c = p.ref("test", None, "96-deep", discard=True)
p.transfer(
c.wells_from(0, 8, columnwise=True),
c.wells_from(1, 8, columnwise=True),
'1800:microliter'
)
self.assertEqual(
24,
len(p.instructions[0].groups)
)
示例6: test_transfer_option_propagation
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_transfer_option_propagation(self):
p = Protocol()
c = p.ref("test", None, "96-deep", discard=True)
p.transfer(
c.well(0),
c.well(1),
"1800:microliter",
aspirate_source=aspirate_source(
depth("ll_bottom", distance=".004:meter")
)
)
self.assertEqual(
len(p.instructions[0].groups[0]['transfer'][0]),
len(p.instructions[0].groups[1]['transfer'][0])
)
self.assertEqual(
len(p.instructions[0].groups[0]['transfer'][0]),
len(p.instructions[0].groups[2]['transfer'][0])
)
示例7: test_gt_750uL_transfer
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_gt_750uL_transfer(self):
p = Protocol()
c = p.ref("test", None, "96-deep", discard=True)
p.transfer(
c.well(0),
c.well(1),
"1800:microliter"
)
self.assertEqual(3, len(p.instructions[0].groups))
self.assertEqual(
Unit(750, 'microliter'),
p.instructions[0].groups[0]['transfer'][0]['volume']
)
self.assertEqual(
Unit(750, 'microliter'),
p.instructions[0].groups[1]['transfer'][0]['volume']
)
self.assertEqual(
Unit(300, 'microliter'),
p.instructions[0].groups[2]['transfer'][0]['volume']
)
示例8: test_unit_conversion
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_unit_conversion(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
with self.assertRaises(ValueError):
p.transfer(c.well(0), c.well(1), "1:liter")
p.transfer(c.well(0), c.well(1), "200:nanoliter")
self.assertTrue(str(p.instructions[0].groups[0]['transfer'][0]['volume']) == "0.2:microliter")
p.transfer(c.well(1), c.well(2), ".5:milliliter", new_group=True)
self.assertTrue(str(p.instructions[-1].groups[0]['transfer'][0]['volume']) == "500.0:microliter")
示例9: test_one_source
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_one_source(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
with self.assertRaises(ValueError):
p.transfer(c.wells_from(0, 2),
c.wells_from(2, 2), "40:microliter", one_source=True)
with self.assertRaises(RuntimeError):
p.transfer(c.wells_from(0, 2).set_volume("1:microliter"),
c.wells_from(1, 5), "10:microliter", one_source=True)
p.transfer(c.wells_from(0, 2).set_volume("50:microliter"),
c.wells_from(2, 2), "40:microliter", one_source=True)
self.assertEqual(2, len(p.instructions[0].groups))
self.assertFalse(p.instructions[0].groups[0]["transfer"][0]["from"] == p.instructions[0].groups[1]["transfer"][0]["from"])
示例10: test_max_transfer
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_max_transfer(self):
p = Protocol()
c = p.ref("test", None, "micro-2.0", storage="cold_4")
p.transfer(c.well(0), c.well(0), "3050:microliter")
示例11: test_mix_before_and_after
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_mix_before_and_after(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
with self.assertRaises(RuntimeError):
p.transfer(c.well(0), c.well(1), "10:microliter", mix_vol= "15:microliter")
p.transfer(c.well(0), c.well(1), "10:microliter", repetitions_a=21)
p.transfer(c.well(0), c.well(1), "10:microliter", repetitions=21)
p.transfer(c.well(0), c.well(1), "10:microliter", repetitions_b=21)
p.transfer(c.well(0), c.well(1), "10:microliter", flowrate_a="200:microliter/second")
p.transfer(c.well(0), c.well(1), "12:microliter", mix_after=True,
mix_vol="10:microliter", repetitions_a=20)
self.assertTrue(int(p.instructions[-1].groups[0]['transfer'][0]['mix_after']['repetitions']) == 20)
p.transfer(c.well(0), c.well(1), "12:microliter", mix_after=True,
mix_vol="10:microliter", repetitions_b=20)
self.assertTrue(int(p.instructions[-1].groups[-1]['transfer'][0]['mix_after']['repetitions']) == 10)
p.transfer(c.well(0), c.well(1), "12:microliter", mix_after=True)
self.assertTrue(int(p.instructions[-1].groups[-1]['transfer'][0]['mix_after']['repetitions']) == 10)
self.assertTrue(str(p.instructions[-1].groups[-1]['transfer'][0]['mix_after']['speed']) == "100:microliter/second")
self.assertTrue(str(p.instructions[-1].groups[-1]['transfer'][0]['mix_after']['volume']) == "6.0:microliter")
p.transfer(c.well(0), c.well(1), "12:microliter", mix_before=True,
mix_vol="10:microliter", repetitions_b=20)
self.assertTrue(int(p.instructions[-1].groups[-1]['transfer'][-1]['mix_before']['repetitions']) == 20)
p.transfer(c.well(0), c.well(1), "12:microliter", mix_before=True,
mix_vol="10:microliter", repetitions_a=20)
self.assertTrue(int(p.instructions[-1].groups[-1]['transfer'][-1]['mix_before']['repetitions']) == 10)
p.transfer(c.well(0), c.well(1), "12:microliter", mix_before=True)
self.assertTrue(int(p.instructions[-1].groups[-1]['transfer'][-1]['mix_before']['repetitions']) == 10)
self.assertTrue(str(p.instructions[-1].groups[-1]['transfer'][-1]['mix_before']['speed']) == "100:microliter/second")
self.assertTrue(str(p.instructions[-1].groups[-1]['transfer'][-1]['mix_before']['volume']) == "6.0:microliter")
示例12: test_one_tip_true_gt_750
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_one_tip_true_gt_750(self):
p = Protocol()
c = p.ref("test", None, "96-deep", discard=True)
p.transfer(c.well(0), c.well(1), "1000:microliter", one_tip=True)
self.assertEqual(1, len(p.instructions[0].groups))
示例13: test_one_source
# 需要导入模块: from autoprotocol.protocol import Protocol [as 别名]
# 或者: from autoprotocol.protocol.Protocol import transfer [as 别名]
def test_one_source(self):
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
with self.assertRaises(RuntimeError):
p.transfer(c.wells_from(0, 2),
c.wells_from(2, 2), "40:microliter", one_source=True)
with self.assertRaises(RuntimeError):
p.transfer(c.wells_from(0, 2).set_volume("1:microliter"),
c.wells_from(1, 5), "10:microliter", one_source=True)
p.transfer(c.wells_from(0, 2).set_volume("50:microliter"),
c.wells_from(2, 2), "40:microliter", one_source=True)
self.assertEqual(2, len(p.instructions[0].groups))
self.assertFalse(p.instructions[0].groups[0]["transfer"][0]["from"] == p.instructions[0].groups[1]["transfer"][0]["from"])
p.transfer(c.wells_from(0, 2).set_volume("100:microliter"),
c.wells_from(2, 4), "40:microliter", one_source=True)
self.assertEqual(7, len(p.instructions[0].groups))
self.assertTrue(p.instructions[0].groups[2]["transfer"][0]["from"] == p.instructions[0].groups[4]["transfer"][0]["from"])
self.assertTrue(p.instructions[0].groups[4]["transfer"][0]["volume"] == Unit.fromstring("20:microliter"))
p.transfer(c.wells_from(0, 2).set_volume("100:microliter"),
c.wells_from(2, 4), ["20:microliter", "40:microliter", "60:microliter", "80:microliter"], one_source=True)
self.assertEqual(12, len(p.instructions[0].groups))
self.assertTrue(p.instructions[0].groups[7]["transfer"][0]["from"] == p.instructions[0].groups[9]["transfer"][0]["from"])
self.assertFalse(p.instructions[0].groups[9]["transfer"][0]["from"] == p.instructions[0].groups[10]["transfer"][0]["from"])
self.assertEqual(Unit.fromstring("20:microliter"), p.instructions[0].groups[10]["transfer"][0]["volume"])
p.transfer(c.wells_from(0, 2).set_volume("50:microliter"), c.wells(2), "100:microliter", one_source=True)
c.well(0).set_volume("50:microliter")
c.well(1).set_volume("200:microliter")
p.transfer(c.wells_from(0, 2), c.well(1), "100:microliter", one_source=True)
self.assertFalse(p.instructions[0].groups[14]["transfer"][0]["from"] == p.instructions[0].groups[15]["transfer"][0]["from"])
c.well(0).set_volume("100:microliter")
c.well(1).set_volume("0:microliter")
c.well(2).set_volume("100:microliter")
p.transfer(c.wells_from(0, 3), c.wells_from(3, 2), "100:microliter", one_source=True)
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
c.well(0).set_volume("100.0000000000005:microliter")
c.well(1).set_volume("100:microliter")
p.transfer(c.wells_from(0, 2), c.wells_from(3, 3), "50:microliter", one_source=True)
self.assertEqual(3, len(p.instructions[0].groups))
p = Protocol()
c = p.ref("test", None, "96-flat", discard=True)
c.well(0).set_volume("50:microliter")
c.well(1).set_volume("101:microliter")
p.transfer(c.wells_from(0, 2), c.wells_from(3, 3), "50.0000000000005:microliter", one_source=True)
self.assertEqual(3, len(p.instructions[0].groups))