intbio-ncl/BiomationScripterLib

Issue with EchoProto calculation

Closed this issue · 4 comments

The attached protocol caused the following error to occur:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-11-eef2098f1c38> in <module>
     12     Repeats = Repeats
     13 )
---> 14 Protocol.run()

~\Anaconda3\lib\site-packages\BiomationScripter\EchoProto\Templates.py in run(self)
    137 
    138         # Generate the picklists
--> 139         self.create_picklists()
    140 
    141 class PCR(_EchoProto.EchoProto_Template):

~\Anaconda3\lib\site-packages\BiomationScripter\EchoProto\__init__.py in create_picklists(self)
     35 
     36     def create_picklists(self):
---> 37         _BMS.EchoProto.Generate_Actions(self._protocol)
     38         _BMS.EchoProto.Write_Picklists(self._protocol, self.save_dir)
     39 

~\Anaconda3\lib\site-packages\BiomationScripter\EchoProto\__init__.py in Generate_Actions(Protocol)
    243                             raise ValueError("Internal transfer error: unhandled transfer situation for {}. Please raise this protocol as an issue on GitHub.".format(reagent))
    244                         if source_index == len(source_wells):
--> 245                             raise ValueError("Internal calculation error: ran out of {} to transfer. Please raise this protocol as an issue on GitHub.".format(reagent))
    246 
    247 #################################

ValueError: Internal calculation error: ran out of T4 Ligase Buffer to transfer. Please raise this protocol as an issue on GitHub.

Something is still wrong with how EchoProto calculates liquids.

Level 0 Loop - 150222.txt

This problems seems to occur when the same reagent is present across multiple source plates. Will investigate further to either raise an error when the user tries to do this (as a temp. solution), or make it so EchoProto can deal with this situation.

One of the apparent discrepancies in how EchoProto reports how much volume is lacking is that it doesn't take into account how much volume is needed to bring a well above the dead volume. See the example below:

A protocol needs 0.25 uL of Reagent-1. Reagent-1 is present in A1 of a 384PP plate with a volume of 14 uL. The dead volume for a 384PP plate is 15 uL, so EchoProto will (correctly) raise an error, stating that there isn't enough of Reagent-1. However, the error message will say that only an extra 0.25 uL of Reagent-1 is required, rather than 1.25 uL, which is the amount required to bring well A1 above the dead volume, plus the 0.25 uL required for the protocol.

The best fix here would probably be to find the first well that is found containing the required reagent, but with volume below the dead volume, and report the volume this well should be topped up by to allow the protocol to proceed. However, this could cause confusion/be unhelpful for users who would instead wish to simply add more volume to a well which is already above the dead volume, and is being used in the protocol. So maybe it would be best to show both options in the error report, or to add an option for users to state their preferred option when these cases arise. Another fix could also be to make the text in the error message more accurate, and make it clear that the extra volume reported is not including any volume required to bring well to above the dead volume.

For version 0.1, I think the best option is to simply change the error message. For later versions, it may be better to give users options for when these situations occur.

More accurate error message have now been added: 1f66cac

For most cases, EchoProto calculation now seems to be correct. The only situation this fails is when the same reagent is present in multiple source plates. However, this error occurs when determining the transfer events, not during calculation, so this issue will be closed and a new one has been opened (#29)