Parameters for aspirate and dispence

Hi

I am trying to use mix parameters for the aspirate/dispense method. Every time I try to add any parameters except destination and volume I am getting an error.

    await lh.aspirate(source[f"A{j+1}:H{j+1}"], vols = dna_volume) # works fine 
    await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = 10.0, mix_cycles = 5) # Brings up an error
TypeError                                 Traceback (most recent call last)
Cell In[54], line 9
      7     await lh.pick_up_tips(p_10[f"A{j+1}:H{j+1}"])
      8     await lh.aspirate(source[f"A{j+1}:H{j+1}"], vols = dna_volume)
----> 9     await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = 10.0, mix_cycles = 5)
     10 #, mix_volume = 10.0, mix_cycles = 5
     11 #     for g in range (0, 3):
     12 #             await lh.aspirate(q_bitp[f"A{j+1}:H{j+1}"], vols = mix_volume)
     13 #             await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = mix_volume) 
     15     await lh.discard_tips()

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/machine.py:23, in need_setup_finished.<locals>.wrapper(self, *args, **kwargs)
     21 if not self.setup_finished:
     22   raise RuntimeError("The setup has not finished. See `setup`.")
---> 23 return await func(self, *args, **kwargs)

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/liquid_handling/liquid_handler.py:898, in LiquidHandler.dispense(self, resources, vols, use_channels, flow_rates, end_delay, offsets, liquid_height, **backend_kwargs)
    896       op.resource.tracker.rollback()
    897       op.tip.tracker.rollback()
--> 898   self._trigger_callback(
    899     "dispense",
    900     liquid_handler=self,
    901     operations=dispenses,
    902     use_channels=use_channels,
...
-> 1984 elif not all(0 <= x <= 12500 for x in mix_volume):
   1985   raise ValueError("mix_volume must be in range 0 to 12500")
   1987 if mix_cycles is None:

TypeError: 'float' object is not iterable

Thank you,
D

1 Like

welcome to the forum!

for parameters that are specified for each channel (like mix_volume), you have to use a list:

await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = [10.0], mix_cycles = [5])
1 Like

I used a list with 8 values for every pipet. Getting this error now.

ValueError                                Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/liquid_handling/backends/hamilton/vantage.py:275, in vantage_response_string_to_error(string)
    274 error_format = r"[A-Z0-9]{2}[0-9]{2}"
--> 275 error_string = parse_vantage_fw_string(string, {"es": "str"})["es"]
    276 error_codes = re.findall(error_format, error_string)

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/liquid_handling/backends/hamilton/vantage.py:77, in parse_vantage_fw_string(s, fmt)
     76 if len(matches) != 1:
---> 77   raise ValueError(f"Expected exactly one match for {key} in {s}")
     78 parsed[key] = matches[0]

ValueError: Expected exactly one match for es in A1PMDDid0095er33

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[63], line 11
      9     await lh.pick_up_tips(p_10[f"A{j+1}:H{j+1}"])
     10     await lh.aspirate(source[f"A{j+1}:H{j+1}"], vols = dna_volume)
---> 11     await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = mix_v, mix_cycles = mix_c)
     12 #     await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = [10.0], mix_cycles = [5])
     13 #, mix_volume = 10.0, mix_cycles = 5
     14 #     for g in range (0, 3):
     15 #             await lh.aspirate(q_bitp[f"A{j+1}:H{j+1}"], vols = mix_volume)
...
---> 77     raise ValueError(f"Expected exactly one match for {key} in {s}")
     78   parsed[key] = matches[0]
     79 elif data_type == "[int]":

ValueError: Expected exactly one match for et in A1PMDDid0095er33

what are the values of mix_v and mix_c? mix_c needs to be an integer

also, i wrote this wrongly above, the list needs to have the same number of items as the number of wells.

await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = [10.0]*8, mix_cycles = [5]*8)

I just did exactly what you wrote here and got this:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/liquid_handling/backends/hamilton/vantage.py:275, in vantage_response_string_to_error(string)
    274 error_format = r"[A-Z0-9]{2}[0-9]{2}"
--> 275 error_string = parse_vantage_fw_string(string, {"es": "str"})["es"]
    276 error_codes = re.findall(error_format, error_string)

File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pylabrobot/liquid_handling/backends/hamilton/vantage.py:77, in parse_vantage_fw_string(s, fmt)
     76 if len(matches) != 1:
---> 77   raise ValueError(f"Expected exactly one match for {key} in {s}")
     78 parsed[key] = matches[0]

ValueError: Expected exactly one match for es in A1PMDDid0103er33

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
Cell In[68], line 12
     10     await lh.aspirate(source[f"A{j+1}:H{j+1}"], vols = dna_volume)
     11 #     await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = mix_v, mix_cycles = mix_c)
---> 12     await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = dna_volume, mix_volume = [10.0]*8, mix_cycles = [5]*8)
     13 #, mix_volume = 10.0, mix_cycles = 5
     14 #     for g in range (0, 3):
     15 #             await lh.aspirate(q_bitp[f"A{j+1}:H{j+1}"], vols = mix_volume)
     16 #             await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = mix_volume) 
...
---> 77     raise ValueError(f"Expected exactly one match for {key} in {s}")
     78   parsed[key] = matches[0]
     79 elif data_type == "[int]":

ValueError: Expected exactly one match for et in A1PMDDid0103er33

could you log the firmware commands and share it?

for configuring the logger, check this: Configuring PLR — PyLabRobot documentation

Completely reinstalled and updated PyLabRobot to the latest version. Trying to use mixing but get this error (‘Maximum volume in tip reached’) all the time.

---------------------------------------------------------------------------
VantageFirmwareError                      Traceback (most recent call last)
Cell In[35], line 18
     16 await lh.aspirate(q_bitp[f"A{j+1}:H{j+1}"], vols = [6]*8)
     17 await lh.dispense(q_bitp[f"A{j+1}:H{j+1}"], vols = [7]*8)
---> 18 await lh.aspirate(q_bitp[f"A{j+1}:H{j+1}"], vols = [0]*8, mix_volume=[3.0]*8, mix_cycles=[3]*8)
     19 # await lh.discard_tips()
     20 await lh.drop_tips(p_10[f"A{j+1}:H{j+1}"])

File ~/pylabrobot/pylabrobot/machines/machine.py:35, in need_setup_finished.<locals>.wrapper(*args, **kwargs)
     33 if not self.setup_finished:
     34   raise RuntimeError("The setup has not finished. See `setup`.")
---> 35 return await func(*args, **kwargs)

File ~/pylabrobot/pylabrobot/liquid_handling/liquid_handler.py:876, in LiquidHandler.aspirate(self, resources, vols, use_channels, flow_rates, offsets, liquid_height, blow_out_air_volume, **backend_kwargs)
    873     (self.head[channel].get_tip().tracker.commit if success else self.head[channel].rollback)()
    875 # trigger callback
--> 876 self._trigger_callback(
    877   "aspirate",
    878   liquid_handler=self,
    879   operations=aspirations,
    880   use_channels=use_channels,
    881   error=error,
    882   **backend_kwargs,
    883 )
...
    390 if "er" in resp and "er0" not in resp:
    391   error = vantage_response_string_to_error(resp)
--> 392   raise error

VantageFirmwareError: VantageFirmwareError(errors={'Pipetting channel 1': 'Maximum volume in tip reached', 'Pipetting channel 2': 'Maximum volume in tip reached', 'Pipetting channel 3': 'Maximum volume in tip reached', 'Pipetting channel 4': 'Maximum volume in tip reached', 'Pipetting channel 5': 'Maximum volume in tip reached', 'Pipetting channel 6': 'Maximum volume in tip reached', 'Pipetting channel 7': 'Maximum volume in tip reached', 'Pipetting channel 8': 'Maximum volume in tip reached'}, raw_response=A1PMDAid72er99es"P153 P253 P353 P453 P553 P653 P753 P853")