Esempio n. 1
0
    def dispose(self, volume, src,  mix=False, getDITI=True, dropDITI=True):
        'Dispose of a given volume by aspirating and not dispensing (will go to waste during next wash)'
        if self.ptcrunning and src.plate==decklayout.SAMPLEPLATE:
            self.waitpgm()
        if volume>self.MAXVOLUME:
            reuseTip=False   # Since we need to wash to get rid of it
            print "Splitting large transfer of %.1f ul into smaller chunks < %.1f ul "%(volume,self.MAXVOLUME),
            if reuseTip:
                print "with tip reuse"
            else:
                print "without tip reuse"
            self.dispose(self.MAXVOLUME,src,mix,getDITI,dropDITI)
            self.dispose(volume-self.MAXVOLUME,src,False,getDITI,dropDITI)
            return

        cmt="Remove and dispose of %.1f ul from %s"%(volume, src.name)
        ditivolume=volume+src.inliquidLC.singletag
        if mix and not src.isMixed():
            cmt=cmt+" with src mix"
            ditivolume=max(ditivolume,src.volume)
        if self.useDiTis:
            tipMask=4
            if getDITI:
                worklist.getDITI(tipMask&self.DITIMASK,ditivolume)
        else:
            tipMask=self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix and not src.isMixed():
            src.mix(tipMask)
        src.aspirate(tipMask,volume)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask&self.DITIMASK,decklayout.WASTE)
Esempio n. 2
0
    def multitransfer(self, volumes, src, dests,mix=(True,False),getDITI=True,dropDITI=True,ignoreContents=False,extraFrac=0.05):
        'Multi pipette from src to multiple dest.  mix is (src,dest) mixing -- only mix src if needed though'
        #print "multitransfer(",volumes,",",src,",",dests,",",mix,",",getDITI,",",dropDITI,")"
        if self.ptcrunning and (src.plate==decklayout.SAMPLEPLATE or len([1 for d in dests if d.plate==decklayout.SAMPLEPLATE])>0):
            self.waitpgm()

        if isinstance(volumes,(int,long,float)):
            # Same volume for each dest
            volumes=[volumes for i in range(len(dests))]
        assert len(volumes)==len(dests)
        #        if len([d.volume for d in dests if d.conc!=None])==0:
        if len([dests[i].volume for i in range(0,len(dests)) if dests[i].conc != None and volumes[i]>0.01])==0:
            maxval=0
        else:
            maxval=max([dests[i].volume for i in range(0,len(dests)) if dests[i].conc != None and volumes[i]>0.01])
            #         maxval=max([d.volume for d in dests if d.conc != None])
        #print "volumes=",[d.volume for d in dests],", conc=",[str(d.conc) for d in dests],", maxval=",maxval
        if not mix[1] and len(volumes)>1 and ( maxval<.01 or ignoreContents):
            if sum(volumes)*(1+extraFrac)>self.MAXVOLUME:
                #print "sum(volumes)=%.1f, MAXVOL=%.1f"%(sum(volumes),self.MAXVOLUME)
                for i in range(1,len(volumes)):
                    if sum(volumes[0:i+1])*(1+extraFrac)>self.MAXVOLUME:
                        destvol=max([d.volume for d in dests[0:i]])
                        reuseTip=destvol<=0
                        # print "Splitting multi with total volume of %.1f ul into smaller chunks < %.1f ul after %d dispenses "%(sum(volumes),self.MAXVOLUME,i),
                        # if reuseTip:
                        #     print "with tip reuse"
                        # else:
                        #     print "without tip reuse"
                        self.multitransfer(volumes[0:i],src,dests[0:i],mix,getDITI,not reuseTip,extraFrac=extraFrac)
                        self.multitransfer(volumes[i:],src,dests[i:],(False,mix[1]),not reuseTip,dropDITI,extraFrac=extraFrac)
                        return

            if self.useDiTis:
                tipMask=4
                if  getDITI:
                    ditivol=sum(volumes)*(1+extraFrac)+src.inliquidLC.multicond+src.inliquidLC.multiexcess
                    worklist.getDITI(tipMask&self.DITIMASK,min(self.MAXVOLUME,ditivol),True,True)
            else:
                tipMask=self.cleantip()

            cmt="Multi-add  %s to samples %s"%(src.name,",".join("%s[%.1f]"%(dests[i].name,volumes[i]) for i in range(len(dests))))
            #print "*",cmt
            worklist.comment(cmt)

            if mix[0] and not src.isMixed():
                if src.plate==decklayout.SAMPLEPLATE or src.plate==decklayout.DILPLATE:
                    self.shakeSamples([src])
                else:
                    src.mix(tipMask)
            src.aspirate(tipMask,sum(volumes)*(1+extraFrac),True)	# Aspirate extra
            for i in range(len(dests)):
                if volumes[i]>0.01:
                    dests[i].dispense(tipMask,volumes[i],src)
            if self.useDiTis and dropDITI:
                worklist.dropDITI(tipMask&self.DITIMASK,decklayout.WASTE)
        else:
            for i in range(len(dests)):
                if volumes[i]>0.01:
                    self.transfer(volumes[i],src,dests[i],(mix[0] and i==0,mix[1]),getDITI,dropDITI)
Esempio n. 3
0
    def transfer(self,
                 volume,
                 src,
                 dest,
                 mix=(True, False),
                 getDITI=True,
                 dropDITI=True):
        if self.ptcrunning and (src.plate == decklayout.SAMPLEPLATE
                                or dest.plate == decklayout.SAMPLEPLATE) > 0:
            self.waitpgm()

        if volume > self.MAXVOLUME:
            destvol = dest.volume
            reuseTip = destvol <= 0
            print "Splitting large transfer of %.1f ul into smaller chunks < %.1f ul " % (
                volume, self.MAXVOLUME),
            if reuseTip:
                print "with tip reuse"
            else:
                print "without tip reuse"
            self.transfer(self.MAXVOLUME, src, dest, mix, getDITI, False)
            self.transfer(volume - self.MAXVOLUME, src, dest,
                          (mix[0] and not reuseTip, mix[1]), False, dropDITI)
            return

        cmt = "Add %.1f ul of %s to %s" % (volume, src.name, dest.name)
        ditivolume = volume + src.inliquidLC.singletag
        if mix[0] and not src.isMixed():
            cmt = cmt + " with src mix"
            ditivolume = max(ditivolume, src.volume)
        if mix[1] and dest.volume > 0 and not src.isMixed():
            cmt = cmt + " with dest mix"
            ditivolume = max(ditivolume, volume + dest.volume)
            #            print "Mix volume=%.1f ul"%(ditivolume)
        if self.useDiTis:
            tipMask = 4
            if getDITI:
                worklist.getDITI(tipMask & self.DITIMASK, ditivolume)
        else:
            tipMask = self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix[0] and not src.isMixed():
            if src.plate == decklayout.SAMPLEPLATE or src.plate == decklayout.DILPLATE:
                self.shakeSamples([src])
            else:
                src.mix(tipMask)
        src.aspirate(tipMask, volume)
        dest.dispense(tipMask, volume, src)
        if mix[1]:
            dest.mix(tipMask, True)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask & self.DITIMASK, decklayout.WASTE)
Esempio n. 4
0
    def transfer(self, volume, src, dest, mix=(True,False), getDITI=True, dropDITI=True):
        if self.ptcrunning and (src.plate==decklayout.SAMPLEPLATE or dest.plate==decklayout.SAMPLEPLATE)>0:
            self.waitpgm()

        if volume>self.MAXVOLUME:
            destvol=dest.volume
            reuseTip=destvol<=0
            msg="Splitting large transfer of %.1f ul into smaller chunks < %.1f ul "%(volume,self.MAXVOLUME)
            if reuseTip:
                msg+= "with tip reuse"
            else:
                msg+= "without tip reuse"
            logging.notice(msg)
            self.transfer(self.MAXVOLUME,src,dest,mix,getDITI,False)
            self.transfer(volume-self.MAXVOLUME,src,dest,(mix[0] and not reuseTip,mix[1]),False,dropDITI)
            return

        cmt="Add %.1f ul of %s to %s"%(volume, src.name, dest.name)
        ditivolume=volume+src.inliquidLC.singletag
        if mix[0] and not src.isMixed():
            cmt=cmt+" with src mix"
            ditivolume=max(ditivolume,src.volume)
        if mix[1] and dest.volume>0 and not src.isMixed():
            cmt=cmt+" with dest mix"
            ditivolume=max(ditivolume,volume+dest.volume)
            #            print "Mix volume=%.1f ul"%(ditivolume)
        if mix[0] and not src.isMixed() and (src.plate==decklayout.SAMPLEPLATE or src.plate==decklayout.DILPLATE):
            worklist.comment("shaking for src mix of "+src.name)
            self.shakeSamples([src])  # Need to do this before allocating a tip since washing during this will modify the tip clean states

        if self.useDiTis:
            tipMask=4
            if getDITI:
                worklist.getDITI(tipMask&self.DITIMASK,ditivolume)
        else:
            tipMask=self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix[0] and (not src.isMixed() or not src.wellMixed):
            if (src.plate==decklayout.SAMPLEPLATE or src.plate==decklayout.DILPLATE):
                logging.notice("Forcing pipette mix of "+src.name)
            worklist.comment("pipette mix for src mix of "+src.name)
            src.mix(tipMask)	# Manual mix (after allocating a tip for this)
            
        src.aspirate(tipMask,volume)
        dest.dispense(tipMask,volume,src)
        if mix[1]:
            dest.mix(tipMask,True)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask&self.DITIMASK,decklayout.WASTE)
Esempio n. 5
0
    def transfer(self, volume, src, dest, mix=(True,False), getDITI=True, dropDITI=True):
        if self.ptcrunning and (src.plate==decklayout.SAMPLEPLATE or dest.plate==decklayout.SAMPLEPLATE)>0:
            self.waitpgm()
            
        if volume>self.MAXVOLUME:
            destvol=dest.volume
            reuseTip=destvol<=0
            print "Splitting large transfer of %.1f ul into smaller chunks < %.1f ul "%(volume,self.MAXVOLUME),
            if reuseTip:
                print "with tip reuse"
            else:
                print "without tip reuse"
            self.transfer(self.MAXVOLUME,src,dest,mix,getDITI,False)
            self.transfer(volume-self.MAXVOLUME,src,dest,(mix[0] and not reuseTip,mix[1]),False,dropDITI)
            return

        cmt="Add %.1f ul of %s to %s"%(volume, src.name, dest.name)
        ditivolume=volume+src.inliquidLC.singletag
        if mix[0] and not src.isMixed():
            cmt=cmt+" with src mix"
            ditivolume=max(ditivolume,src.volume)
        if mix[1] and dest.volume>0 and not src.isMixed():
            cmt=cmt+" with dest mix"
            ditivolume=max(ditivolume,volume+dest.volume)
            #            print "Mix volume=%.1f ul"%(ditivolume)
        if self.useDiTis:
            tipMask=4
            if getDITI:
                worklist.getDITI(tipMask&self.DITIMASK,ditivolume)
        else:
            tipMask=self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix[0] and not src.isMixed():
            if src.plate==decklayout.SAMPLEPLATE or src.plate==decklayout.DILPLATE:
                self.shakeSamples([src])
            else:
                src.mix(tipMask)
        src.aspirate(tipMask,volume)
        dest.dispense(tipMask,volume,src)
        if mix[1]:
            dest.mix(tipMask,True)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask&self.DITIMASK,decklayout.WASTE)
Esempio n. 6
0
    def dispose(self, volume, src, mix=False, getDITI=True, dropDITI=True):
        'Dispose of a given volume by aspirating and not dispensing (will go to waste during next wash)'
        if self.ptcrunning and src.plate == decklayout.SAMPLEPLATE:
            self.waitpgm()
        if volume > self.MAXVOLUME:
            reuseTip = False  # Since we need to wash to get rid of it
            msg = "Splitting large transfer of %.1f ul into smaller chunks < %.1f ul " % (
                volume, self.MAXVOLUME),
            if reuseTip:
                msg += "with tip reuse"
            else:
                msg += "without tip reuse"
            logging.notice(msg)
            self.dispose(self.MAXVOLUME, src, mix, getDITI, dropDITI)
            self.dispose(volume - self.MAXVOLUME, src, False, getDITI,
                         dropDITI)
            return

        cmt = "Remove and dispose of %.1f ul from %s" % (volume, src.name)
        ditivolume = volume + src.inliquidLC.singletag
        if mix and not src.isMixed():
            cmt = cmt + " with src mix"
            ditivolume = max(ditivolume, src.volume)
        if self.useDiTis:
            tipMask = 4
            if getDITI:
                worklist.getDITI(tipMask & self.DITIMASK, ditivolume)
        else:
            tipMask = self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix and not src.isMixed():
            src.mix(tipMask)
        src.aspirate(tipMask, volume)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask & self.DITIMASK, decklayout.WASTE)
Esempio n. 7
0
    def multitransfer(self,
                      volumes,
                      src,
                      dests,
                      mix=(True, False),
                      getDITI=True,
                      dropDITI=True,
                      ignoreContents=False,
                      extraFrac=0.05):
        'Multi pipette from src to multiple dest.  mix is (src,dest) mixing -- only mix src if needed though'
        #print "multitransfer(",volumes,",",src,",",dests,",",mix,",",getDITI,",",dropDITI,")"
        if self.ptcrunning and (src.plate == decklayout.SAMPLEPLATE or len(
            [1 for d in dests if d.plate == decklayout.SAMPLEPLATE]) > 0):
            self.waitpgm()

        if isinstance(volumes, (int, long, float)):
            # Same volume for each dest
            volumes = [volumes for i in range(len(dests))]
        assert len(volumes) == len(dests)
        #        if len([d.volume for d in dests if d.conc!=None])==0:
        if len([
                dests[i].volume for i in range(0, len(dests))
                if dests[i].conc != None and volumes[i] > 0.01
        ]) == 0:
            maxval = 0
        else:
            maxval = max([
                dests[i].volume for i in range(0, len(dests))
                if dests[i].conc != None and volumes[i] > 0.01
            ])
            #         maxval=max([d.volume for d in dests if d.conc != None])
        #print "volumes=",[d.volume for d in dests],", conc=",[str(d.conc) for d in dests],", maxval=",maxval
        if not mix[1] and len(volumes) > 1 and (maxval < .01
                                                or ignoreContents):
            if sum(volumes) * (1 + extraFrac) > self.MAXVOLUME:
                #print "sum(volumes)=%.1f, MAXVOL=%.1f"%(sum(volumes),self.MAXVOLUME)
                for i in range(1, len(volumes)):
                    if sum(volumes[0:i + 1]) * (1 +
                                                extraFrac) > self.MAXVOLUME:
                        destvol = max([d.volume for d in dests[0:i]])
                        reuseTip = destvol <= 0
                        # print "Splitting multi with total volume of %.1f ul into smaller chunks < %.1f ul after %d dispenses "%(sum(volumes),self.MAXVOLUME,i),
                        # if reuseTip:
                        #     print "with tip reuse"
                        # else:
                        #     print "without tip reuse"
                        self.multitransfer(volumes[0:i],
                                           src,
                                           dests[0:i],
                                           mix,
                                           getDITI,
                                           not reuseTip,
                                           extraFrac=extraFrac)
                        self.multitransfer(volumes[i:],
                                           src,
                                           dests[i:], (False, mix[1]),
                                           not reuseTip,
                                           dropDITI,
                                           extraFrac=extraFrac)
                        return

            if self.useDiTis:
                tipMask = 4
                if getDITI:
                    ditivol = sum(volumes) * (
                        1 + extraFrac
                    ) + src.inliquidLC.multicond + src.inliquidLC.multiexcess
                    worklist.getDITI(tipMask & self.DITIMASK,
                                     min(self.MAXVOLUME, ditivol), True, True)
            else:
                tipMask = self.cleantip()

            cmt = "Multi-add  %s to samples %s" % (src.name, ",".join(
                "%s[%.1f]" % (dests[i].name, volumes[i])
                for i in range(len(dests))))
            #print "*",cmt
            worklist.comment(cmt)

            if mix[0] and not src.isMixed():
                if src.plate == decklayout.SAMPLEPLATE or src.plate == decklayout.DILPLATE:
                    self.shakeSamples([src])
                else:
                    src.mix(tipMask)
            src.aspirate(tipMask,
                         sum(volumes) * (1 + extraFrac),
                         True)  # Aspirate extra
            for i in range(len(dests)):
                if volumes[i] > 0.01:
                    dests[i].dispense(tipMask, volumes[i], src)
            if self.useDiTis and dropDITI:
                worklist.dropDITI(tipMask & self.DITIMASK, decklayout.WASTE)
        else:
            for i in range(len(dests)):
                if volumes[i] > 0.01:
                    self.transfer(volumes[i], src, dests[i],
                                  (mix[0] and i == 0, mix[1]), getDITI,
                                  dropDITI)
Esempio n. 8
0
    def transfer(self,
                 volume,
                 src,
                 dest,
                 mix=(True, False),
                 getDITI=True,
                 dropDITI=True):
        if self.ptcrunning and (src.plate == decklayout.SAMPLEPLATE
                                or dest.plate == decklayout.SAMPLEPLATE) > 0:
            self.waitpgm()

        if volume > self.MAXVOLUME:
            destvol = dest.volume
            reuseTip = destvol <= 0
            msg = "Splitting large transfer of %.1f ul into smaller chunks < %.1f ul " % (
                volume, self.MAXVOLUME)
            if reuseTip:
                msg += "with tip reuse"
            else:
                msg += "without tip reuse"
            logging.notice(msg)
            self.transfer(self.MAXVOLUME, src, dest, mix, getDITI, False)
            self.transfer(volume - self.MAXVOLUME, src, dest,
                          (mix[0] and not reuseTip, mix[1]), False, dropDITI)
            return

        cmt = "Add %.1f ul of %s to %s" % (volume, src.name, dest.name)
        ditivolume = volume + src.inliquidLC.singletag
        if mix[0] and not src.isMixed():
            cmt = cmt + " with src mix"
            ditivolume = max(ditivolume, src.volume)
        if mix[1] and dest.volume > 0 and not src.isMixed():
            cmt = cmt + " with dest mix"
            ditivolume = max(ditivolume, volume + dest.volume)
            #            print "Mix volume=%.1f ul"%(ditivolume)
        if mix[0] and not src.isMixed() and (
                src.plate == decklayout.SAMPLEPLATE
                or src.plate == decklayout.DILPLATE):
            worklist.comment("shaking for src mix of " + src.name)
            self.shakeSamples(
                [src]
            )  # Need to do this before allocating a tip since washing during this will modify the tip clean states

        if self.useDiTis:
            tipMask = 4
            if getDITI:
                worklist.getDITI(tipMask & self.DITIMASK, ditivolume)
        else:
            tipMask = self.cleantip()
        #print "*",cmt
        worklist.comment(cmt)

        if mix[0] and (not src.isMixed() or not src.wellMixed):
            if (src.plate == decklayout.SAMPLEPLATE
                    or src.plate == decklayout.DILPLATE):
                logging.notice("Forcing pipette mix of " + src.name)
            worklist.comment("pipette mix for src mix of " + src.name)
            src.mix(tipMask)  # Manual mix (after allocating a tip for this)

        src.aspirate(tipMask, volume)
        dest.dispense(tipMask, volume, src)
        if mix[1]:
            dest.mix(tipMask, True)

        if self.useDiTis and dropDITI:
            worklist.dropDITI(tipMask & self.DITIMASK, decklayout.WASTE)