Пример #1
0
    def __init__(self):
        'Create a new experiment with given sample locations for water and WASTE;  totalTime is expected run time in seconds, if known'
        worklist.comment("Generated %s" % (datetime.now().ctime()))
        worklist.userprompt(
            "The following reagent tubes should be present: %s" %
            Sample.getAllLocOnPlate(decklayout.REAGENTPLATE))
        worklist.userprompt(
            "The following eppendorf tubes should be present: %s" %
            Sample.getAllLocOnPlate(decklayout.EPPENDORFS))
        worklist.email(dest='*****@*****.**',
                       subject='Run started (Generate: %s)' %
                       (datetime.now().ctime()))
        worklist.email(dest='*****@*****.**',
                       subject='Tecan error',
                       onerror=1)
        self.cleanTips = 0
        # self.sanitize()  # Not needed, TRP does it, also first use of tips will do this
        self.useDiTis = False
        self.ptcrunning = False
        self.overrideSanitize = False
        self.pgmStartTime = None
        self.pgmEndTime = None

        # Access PTC and RIC early to be sure they are working
        worklist.pyrun("PTC\\ptctest.py")
        #        worklist.periodicWash(15,4)
        worklist.userprompt(
            "Verify that PTC thermocycler lid pressure is set to '2'.")
        self.idlePgms = []
        self.timerStartTime = [None] * 8
Пример #2
0
    def __init__(self):
        'Create a new experiment with given sample locations for water and WASTE;  totalTime is expected run time in seconds, if known'
        self.checksum=md5sum(sys.argv[0])
        self.checksum=self.checksum[-4:]
        pyTecan=os.path.dirname(os.path.realpath(__file__))
        self.gitlabel=strip(subprocess.check_output(["git", "describe","--always"],cwd=pyTecan))
        worklist.comment("Generated %s (%s-%s pyTecan-%s)"%(datetime.now().ctime(),sys.argv[0],self.checksum,self.gitlabel))
        worklist.userprompt("The following reagent tubes should be present: %s"%Sample.getAllLocOnPlate(decklayout.REAGENTPLATE))
        worklist.userprompt("The following eppendorf tubes should be present: %s"%Sample.getAllLocOnPlate(decklayout.EPPENDORFS))
        worklist.email(dest='*****@*****.**',subject='Run started (Generate: %s) expected runtime %.0f minutes'%(datetime.now().ctime(),clock.totalTime/60.0 if clock.totalTime is not None else 0.0 ) )
        worklist.email(dest='*****@*****.**',subject='Tecan error',onerror=1)
        self.cleanTips=0
        # self.sanitize()  # Not needed, TRP does it, also first use of tips will do this
        self.useDiTis=False
        self.ptcrunning=False
        self.overrideSanitize=False
        self.pgmStartTime=None
        self.pgmEndTime=None

        # Access PTC and RIC early to be sure they are working
        worklist.pyrun("PTC\\ptctest.py")
        #        worklist.periodicWash(15,4)
        worklist.userprompt("Verify that PTC thermocycler lid pressure is set to '2'.")
        self.idlePgms=[]
        self.timerStartTime=[None]*8
Пример #3
0
    def __init__(self):
        'Create a new experiment with given sample locations for water and WASTE;  totalTime is expected run time in seconds, if known'
        worklist.comment("Generated %s"%(datetime.now().ctime()))
        worklist.userprompt("The following reagent tubes should be present: %s"%Sample.getAllLocOnPlate(decklayout.REAGENTPLATE))
        worklist.userprompt("The following eppendorf tubes should be present: %s"%Sample.getAllLocOnPlate(decklayout.EPPENDORFS))
        worklist.email(dest='*****@*****.**',subject='Run started (Generate: %s)'%(datetime.now().ctime()))
        worklist.email(dest='*****@*****.**',subject='Tecan error',onerror=1)
        self.cleanTips=0
        # self.sanitize()  # Not needed, TRP does it, also first use of tips will do this
        self.useDiTis=False
        self.ptcrunning=False
        self.overrideSanitize=False
        self.pgmStartTime=None
        self.pgmEndTime=None

        # Access PTC and RIC early to be sure they are working
        worklist.pyrun("PTC\\ptctest.py")
        #        worklist.periodicWash(15,4)
        worklist.userprompt("Verify that PTC thermocycler lid pressure is set to '2'.")
        self.idlePgms=[]
        self.timerStartTime=[None]*8
Пример #4
0
    def __init__(self):
        'Create a new experiment with given sample locations for water and WASTE;  totalTime is expected run time in seconds, if known'
        self.checksum = md5sum(sys.argv[0])
        self.checksum = self.checksum[-4:]
        pyTecan = os.path.dirname(os.path.realpath(__file__))
        self.gitlabel = strip(
            subprocess.check_output(["git", "describe", "--always"],
                                    cwd=pyTecan))
        worklist.comment("Generated %s (%s-%s pyTecan-%s)" %
                         (datetime.now().ctime(), sys.argv[0], self.checksum,
                          self.gitlabel))
        worklist.userprompt(
            "The following reagent tubes should be present: %s" %
            Sample.getAllLocOnPlate(decklayout.REAGENTPLATE))
        worklist.userprompt(
            "The following eppendorf tubes should be present: %s" %
            Sample.getAllLocOnPlate(decklayout.EPPENDORFS))
        worklist.email(
            dest='*****@*****.**',
            subject='Run started (Generate: %s) expected runtime %.0f minutes'
            % (datetime.now().ctime(),
               clock.totalTime / 60.0 if clock.totalTime is not None else 0.0))
        worklist.email(dest='*****@*****.**',
                       subject='Tecan error',
                       onerror=1)
        self.cleanTips = 0
        # self.sanitize()  # Not needed, TRP does it, also first use of tips will do this
        self.useDiTis = False
        self.ptcrunning = False
        self.overrideSanitize = False
        self.pgmStartTime = None
        self.pgmEndTime = None

        # Access PTC and RIC early to be sure they are working
        worklist.pyrun("PTC\\ptctest.py")
        #        worklist.periodicWash(15,4)
        worklist.userprompt(
            "Verify that PTC thermocycler lid pressure is set to '2'.")
        self.idlePgms = []
        self.timerStartTime = [None] * 8
Пример #5
0
    def volcheck(self,tipMask,well,volToRemove):
        '''Check if the well contains the expected volume'''
        if self.lastvolcheck is not None:
            # Decide if a volume check is needed
            if volToRemove==0:
                # No need to check if not removing anything and it has been checked previously (i.e. lastvolcheck is not None)
                return
            if self.volume-volToRemove > max(30,self.lastvolcheck-200) or self.volume-volToRemove>200:
                # Not needed
                return
        self.lastvolcheck=self.volume
        height=self.plate.getliquidheight(self.volume)
        gemvol=self.plate.getgemliquidvolume(height)	# Volume that would be reported by Gemini for this height
        if gemvol is None:
            logging.warning( "No volume equation for %s, skipping initial volume check"%self.name)
            return

        volwarn=self.volume*0.80
        heightwarn=min(self.plate.getliquidheight(volwarn),height-1.0)	# threshold is lower of 1mm or 80%
        gemvolwarn=self.plate.getgemliquidvolume(heightwarn)	# Volume that would be reported by Gemini for this height

        volcrit=self.plate.unusableVolume*0.8+volToRemove
        heightcrit=self.plate.getliquidheight(volcrit)
        gemvolcrit=self.plate.getgemliquidvolume(heightcrit)	# Volume that would be reported by Gemini for this height
    
        worklist.flushQueue()
        worklist.comment( "Check that %s contains %.1f ul (warn< %.1f, crit<%.1f), (gemvol=%.1f (warn<%.1f,crit<%.1f); height=%.1f (>%.1f) )"%(self.name,self.volume,volwarn,volcrit,gemvol,gemvolwarn,gemvolcrit,height,heightwarn))
        tipnum=0
        tm=tipMask
        while tm>0:
            tm=tm>>1
            tipnum+=1

        volvar='detected_volume_%d'%tipnum
        worklist.variable(volvar,-2)
        worklist.detectLiquid(tipMask,well,self.inliquidLC,self.plate)
        doneLabel=worklist.getlabel()
        worklist.condition(volvar,">",gemvolwarn,doneLabel)
        ptmp=clock.pipetting;
        warnLabel=worklist.getlabel()
        worklist.condition(volvar,">",gemvolcrit,warnLabel)
        worklist.moveliha(worklist.WASHLOC)	# Get LiHa out of the way
        msg="Failed volume check of %s - should have  %.0f ul (gemvol=~%s~, crit=%.0f)"%(self.name,self.volume,volvar,gemvolcrit)
        worklist.email(dest='*****@*****.**',subject=msg)
        worklist.stringvariable("response","retry",msg+" Enter 'ignore' to ignore and continue, otherwise will retry.")
        worklist.condition("response","==","ignore",doneLabel)
        # Retry
        worklist.detectLiquid(tipMask,well,self.inliquidLC,self.plate)
        worklist.condition(volvar,">",gemvolcrit,doneLabel)
        worklist.stringvariable("response","retry","Still have <%.0f. Enter 'ignore' to ignore and continue, otherwise will retry."%self.volume)
        worklist.condition("response","==","ignore",doneLabel)
        # Retry again
        worklist.detectLiquid(tipMask,well,self.inliquidLC,self.plate)
        worklist.condition(volvar,">",gemvolcrit,doneLabel)
        worklist.stringvariable("response","ignore","Still have <%.0f. Will continue regardless."%self.volume)
        worklist.condition("response","!=","warn",doneLabel)

        worklist.comment(warnLabel)
        msg="Warning: volume check of %s - should have  %.0f ul (gemvol=~%s~, warn=%.0f, crit=%.0f)"%(self.name,self.volume,volvar,gemvolwarn,gemvolcrit)
        worklist.email(dest='*****@*****.**',subject=msg)
        worklist.comment(doneLabel)
        clock.pipetting=ptmp   # All the retries don't usually happen, so don't count in total time
        self.addhistory("LD",0,tipMask)
Пример #6
0
    def volcheck(self, tipMask, well, volToRemove):
        '''Check if the well contains the expected volume'''
        if self.lastvolcheck is not None:
            # Decide if a volume check is needed
            if volToRemove == 0:
                # No need to check if not removing anything and it has been checked previously (i.e. lastvolcheck is not None)
                return
            if self.volume - volToRemove > max(
                    30, self.lastvolcheck -
                    200) or self.volume - volToRemove > 200:
                # Not needed
                return
        self.lastvolcheck = self.volume
        height = self.plate.getliquidheight(self.volume)
        gemvol = self.plate.getgemliquidvolume(
            height)  # Volume that would be reported by Gemini for this height
        if gemvol is None:
            logging.warning(
                "No volume equation for %s, skipping initial volume check" %
                self.name)
            return

        volcrit = self.plate.unusableVolume * 0.8 + volToRemove
        volwarn = min(volcrit, self.volume * 0.80)

        heightwarn = min(self.plate.getliquidheight(volwarn),
                         height - 1.0)  # threshold is lower of 1mm or 80%
        gemvolwarn = self.plate.getgemliquidvolume(
            heightwarn
        )  # Volume that would be reported by Gemini for this height

        heightcrit = self.plate.getliquidheight(volcrit)
        gemvolcrit = self.plate.getgemliquidvolume(
            heightcrit
        )  # Volume that would be reported by Gemini for this height

        worklist.flushQueue()
        worklist.comment(
            "Check that %s contains %.1f ul (warn< %.1f, crit<%.1f), (gemvol=%.1f (warn<%.1f,crit<%.1f); height=%.1f (>%.1f) )"
            % (self.name, self.volume, volwarn, volcrit, gemvol, gemvolwarn,
               gemvolcrit, height, heightwarn))
        tipnum = 0
        tm = tipMask
        while tm > 0:
            tm = tm >> 1
            tipnum += 1

        volvar = 'detected_volume_%d' % tipnum
        worklist.variable(volvar, -2)
        worklist.detectLiquid(tipMask, well, self.inliquidLC, self.plate)
        doneLabel = worklist.getlabel()
        worklist.condition(volvar, ">", gemvolwarn, doneLabel)
        ptmp = clock.pipetting
        warnLabel = worklist.getlabel()
        worklist.condition(volvar, ">", gemvolcrit, warnLabel)
        worklist.moveliha(worklist.WASHLOC)  # Get LiHa out of the way
        msg = "Failed volume check of %s - should have  %.0f ul (gemvol=~%s~, crit=%.0f)" % (
            self.name, self.volume, volvar, gemvolcrit)
        worklist.email(dest='*****@*****.**', subject=msg)
        worklist.stringvariable(
            "response", "retry", msg +
            " Enter 'ignore' to ignore and continue, otherwise will retry.")
        worklist.condition("response", "==", "ignore", doneLabel)
        # Retry
        worklist.detectLiquid(tipMask, well, self.inliquidLC, self.plate)
        worklist.condition(volvar, ">", gemvolcrit, doneLabel)
        worklist.stringvariable(
            "response", "retry",
            "Still have <%.0f. Enter 'ignore' to ignore and continue, otherwise will retry."
            % self.volume)
        worklist.condition("response", "==", "ignore", doneLabel)
        # Retry again
        worklist.detectLiquid(tipMask, well, self.inliquidLC, self.plate)
        worklist.condition(volvar, ">", gemvolcrit, doneLabel)
        worklist.stringvariable(
            "response", "ignore",
            "Still have <%.0f. Will continue regardless." % self.volume)
        worklist.condition("response", "!=", "warn", doneLabel)

        worklist.comment(warnLabel)
        msg = "Warning: volume check of %s - should have  %.0f ul (gemvol=~%s~, warn=%.0f, crit=%.0f)" % (
            self.name, self.volume, volvar, gemvolwarn, gemvolcrit)
        worklist.email(dest='*****@*****.**', subject=msg)
        worklist.comment(doneLabel)
        clock.pipetting = ptmp  # All the retries don't usually happen, so don't count in total time
        self.addhistory("LD", 0, tipMask, "detect")