Пример #1
0
    def mix_reactive(self, reactive, LiqClass=None, cycles=3, maxTips=1, v_perc=90):
        """
        Select all possible replica of the given reactive and mix using the given % of the current vol in EACH well
        or the max vol for the tip. Use the given liq class or the reactive deff.
        :param reactive:
        :param LiqClass:
        :param cycles:
        :param maxTips:
        :param v_perc:
        :return:
        """
        assert isinstance(reactive, Rtv.Reagent)
        LiqClass = LiqClass or reactive.defLiqClass
        v_perc /= 100.0
        vol = []
        reactive.autoselect(maxTips)
        for tip, w in enumerate(reactive.labware.selected_wells()):
            v = w.vol * v_perc
            vm = self.robot.curArm().Tips[tip].type.maxVol * 0.9
            vol += [min(v, vm)]

        Itr.mix(Rbt.tipsMask[len(vol)],
                liquidClass =LiqClass,
                volume      =vol,
                labware     =reactive.labware,
                cycles      =cycles).exec()
Пример #2
0
def mix_reactive(reactive, LiqClass=None, cycles=3, maxTips=1, v_perc=90):
    assert isinstance(reactive, Rtv.Reactive)
    v_perc /= 100.0
    vol = []
    reactive.autoselect(maxTips)
    for tip, w in enumerate(reactive.labware.selected_wells()):
        v = w.vol * v_perc
        vm = Rbt.Robot.current.curArm().Tips[tip].type.maxVol * 0.9
        vol += [min(v, vm)]
    Itr.mix(Rbt.tipsMask[len(vol)],
            liquidClass=LiqClass,
            volume=vol,
            labware=reactive.labware,
            cycles=cycles).exec()
Пример #3
0
    def mix(self,  in_labware_region, using_liquid_class=None, volume=None, optimize=True):

        """
        Mix each of the reactive in the selected region of the labware
        :param in_labware_region:
        :param using_liquid_class:
        :param volume:
        :param optimize:
        :return:
        """
        mix_p = 0.9
        in_labware_region = in_labware_region or self.worktable.def_WashWaste    # todo ???????????
        assert isinstance(in_labware_region, Lab.Labware), 'A Labware expected in in_labware_region to be mixed'
        if not volume or volume< 0.0 : volume = 0.0
        assert isinstance(volume, (int, float))
        oriSel = in_labware_region.selected()
        nt = self.robot.curArm().nTips  # the number of tips to be used in each cycle of pippeting
        if not oriSel:
            oriSel = range(Rtv.NumOfSamples)
        if optimize:
            oriSel = in_labware_region.parallelOrder( nt, oriSel)
        NumSamples = len(oriSel)
        SampleCnt = NumSamples
        if nt > SampleCnt:
            nt = SampleCnt
        # mV = Rbt.Robot.current.curArm().Tips[0].type.maxVol * 0.8
        mV = self.worktable.def_DiTi.maxVol * mix_p    # What tip tp use !
        if volume:
            v = volume
        else:
            v = in_labware_region.Wells[oriSel[0]].vol
        v = v * mix_p
        v = v if v < mV else mV

        lf = in_labware_region
        mx = Itr.mix(Rbt.tipsMask[nt], using_liquid_class, volume, in_labware_region)
        msg = "Mix: {v:.1f} µL of {n:s}".format(v=v, n=lf.label)
        with group(msg):
            msg += " [grid:{fg:d} site:{fs:d}] in order:".format(fg=lf.location.grid, fs=lf.location.site+1) \
                                        + str([i+1 for i in oriSel])
            Itr.comment(msg).exec()
            while SampleCnt:
                curSample = NumSamples - SampleCnt
                if nt > SampleCnt:
                    nt = SampleCnt
                    mx.tipMask = Rbt.tipsMask[nt]

                sel = oriSel[curSample:curSample + nt]
                spl = range(curSample, curSample + nt)
                with self.tips(Rbt.tipsMask[nt], selected_samples=spl):
                    mV = self.robot.curArm().Tips[0].type.maxVol * mix_p
                    mx.labware.selectOnly(sel)
                    if not using_liquid_class:
                        if sel:
                            mx.liquidClass = mx.labware.selected_wells()[0].reactive.defLiqClass
                    if volume:
                        r = volume   # r: Waste_available yet; volume: to be Waste
                    else:
                        vols = [w.vol for w in mx.labware.selected_wells()]
                        r_min, r_max = min(vols), max(vols)
                        assert r_min == r_max
                        r = r_max
                    r = r * mix_p
                    r = r if r < mV else mV
                    mx.volume = r
                    mx.exec()
                SampleCnt -= nt
        mx.labware.selectOnly(oriSel)
        return oriSel
Пример #4
0
def mix(in_labware_region,
        using_liquid_class=None,
        volume=None,
        optimize=True):
    """

    :param in_labware_region:
    :param using_liquid_class:
    :param volume:
    :param optimize:
    :return:
    """
    mix_p = 0.9
    in_labware_region = in_labware_region or Lab.WashWaste
    assert isinstance(
        in_labware_region,
        Lab.Labware), 'A Labware expected in in_labware_region to be mixed'
    if not volume or volume < 0.0: volume = 0.0
    assert isinstance(volume, (int, float))
    oriSel = in_labware_region.selected()
    nt = Rbt.Robot.current.curArm(
    ).nTips  # the number of tips to be used in each cycle of pippeting
    if not oriSel:
        oriSel = range(Rtv.NumOfSamples)
    if optimize:
        oriSel = in_labware_region.parallelOrder(nt, oriSel)
    NumSamples = len(oriSel)
    SampleCnt = NumSamples
    if nt > SampleCnt:
        nt = SampleCnt
    # mV = Rbt.Robot.current.curArm().Tips[0].type.maxVol * 0.8
    mV = Lab.def_DiTi.maxVol * mix_p  # What tip tp use !
    if volume:
        v = volume
    else:
        v = in_labware_region.Wells[oriSel[0]].vol
    v = v * mix_p
    v = v if v < mV else mV

    lf = in_labware_region
    mx = Itr.mix(Rbt.tipsMask[nt], using_liquid_class, volume,
                 in_labware_region)
    msg = "Mix: {v:.1f} µL of {n:s}".format(v=v, n=lf.label)
    with group(msg):
        msg += " [grid:{fg:d} site:{fs:d}] in order:".format(fg=lf.location.grid, fs=lf.location.site+1) \
                                    + str([i+1 for i in oriSel])
        Itr.comment(msg).exec()
        while SampleCnt:
            curSample = NumSamples - SampleCnt
            if nt > SampleCnt:
                nt = SampleCnt
                mx.tipMask = Rbt.tipsMask[nt]

            sel = oriSel[curSample:curSample + nt]
            spl = range(curSample, curSample + nt)
            with tips(Rbt.tipsMask[nt], selected_samples=spl):
                mV = Rbt.Robot.current.curArm().Tips[0].type.maxVol * mix_p
                mx.labware.selectOnly(sel)
                if not using_liquid_class:
                    if sel:
                        mx.liquidClass = mx.labware.selected_wells(
                        )[0].reactive.defLiqClass
                if volume:
                    r = volume  # r: Waste_available yet; volume: to be Waste
                else:
                    vols = [w.vol for w in mx.labware.selected_wells()]
                    r_min, r_max = min(vols), max(vols)
                    assert r_min == r_max
                    r = r_max
                r = r * mix_p
                r = r if r < mV else mV
                mx.volume = r
                mx.exec()
            SampleCnt -= nt
    mx.labware.selectOnly(oriSel)
    return oriSel