diff --git a/EvoScriPy/EvoMode.py b/EvoScriPy/EvoMode.py index 4c893c2..fbe4003 100644 --- a/EvoScriPy/EvoMode.py +++ b/EvoScriPy/EvoMode.py @@ -169,7 +169,7 @@ class iRobot(Mode): and current volume in wells in labware, etc. One basic use of this, is to garante that the robot will be actualize once and only once even when multiple modes are used. """ - def __init__(self, index, nTips=4 , arms=None): + def __init__(self, index, nTips , arms=None): Mode.__init__(self ) # import Robot as Rbt self.robot = Rbt.Robot(index=index, arms=arms, nTips=nTips) @@ -183,5 +183,5 @@ def set_as_current(self): self.robot.set_as_current() -current = None +current = None # Oppsss !!! Define diff --git a/EvoScriPy/Instruction_Base.py b/EvoScriPy/Instruction_Base.py index e5b531c..6480441 100644 --- a/EvoScriPy/Instruction_Base.py +++ b/EvoScriPy/Instruction_Base.py @@ -94,7 +94,7 @@ def actualize_robot_state(self): pass def exec(self, mode=None): - if not mode: mode = EvoScriPy.EvoMode.current # todo revise + if mode is None: mode = EvoScriPy.EvoMode.current # todo revise if not self.allowed(mode): return mode.exec(self) @@ -217,7 +217,7 @@ class Pipetting(Pipette): def __init__(self, name, tipMask = curTipMask, liquidClass = def_liquidClass, volume = def_vol, - labware = Lab.def_LabW, + labware = Lab.def_LabW, # todo ?????? spacing = 1, wellSelection= None, LoopOptions = def_LoopOp, @@ -237,7 +237,7 @@ def __init__(self, name, tipMask = curTipMask, def validateArg(self): Pipette.validateArg(self) - nTips = Rbt.Robot.current.curArm().nTips + nTips = Rbt.Robot.current.curArm().nTips # todo FIX arm is arg self.arg[1:1] = [string1(self.liquidClass)] + expr(nTips, self.volume).split() + [int(0)] * ( 12 - nTips) # arg 2, 3 - 14 return True diff --git a/EvoScriPy/Robot.py b/EvoScriPy/Robot.py index 214b23e..430783c 100644 --- a/EvoScriPy/Robot.py +++ b/EvoScriPy/Robot.py @@ -18,8 +18,8 @@ tipMask += [1 << tip] tipsMask += [2 ** tip - 1] -def_nTips = 4 -nTips = def_nTips +# def_nTips = 4 +# nTips = def_nTips class Robot: @@ -29,7 +29,7 @@ class Robot: Most of the changes in state are made by the implementation of the low level instructions, while the protocols can "observe" the state to make all kind of optimizations and organizations previous to the actual instruction call """ - current=None + current=None # use immediately, for a short time. class Arm: DiTi = 0 @@ -218,7 +218,7 @@ def __init__(self, index = None, tipsType = Arm.DiTi, templateFile= None): # index=Pipette.LiHa1 """ - + A Robot may have 1 or more Arms, indexes by key index in a dictionary of Arms. :param arms: :param nTips: :param workingTips: @@ -228,7 +228,7 @@ def __init__(self, index = None, Robot.current = self self.arms = arms if isinstance(arms, dict ) else \ {arms.index: arms} if isinstance(arms, Robot.Arm) else \ - { index: Robot.Arm(nTips or def_nTips, index, workingTips, tipsType)} + { index: Robot.Arm(nTips, index, workingTips, tipsType)} self.set_worktable(templateFile) self.def_arm = index # or Pipette.LiHa1 self.droptips = True @@ -270,7 +270,7 @@ def where_are_preserved_tips(self, selected_reactive, TIP_MASK, type)->list: # :param type: :return: Return a list of racks with the tips-wells already selected. """ - TIP_MASK = TIP_MASK if TIP_MASK != -1 else tipsMask[nTips] + TIP_MASK = TIP_MASK if TIP_MASK != -1 else tipsMask[self.curArm().nTips] type = type if type else Lab.def_DiTi n = Lab.count_tips(TIP_MASK) assert n == len(selected_reactive) @@ -293,7 +293,7 @@ def where_preserve_tips(self, TIP_MASK)->list: # [Lab.DITIrack] :return: """ # todo this in Labware?? - TIP_MASK = TIP_MASK if TIP_MASK != -1 else tipsMask[nTips] + TIP_MASK = TIP_MASK if TIP_MASK != -1 else tipsMask[self.curArm().nTips] types = [] t_masks = [] racks = [] diff --git a/EvoScriPy/protocol_steps.py b/EvoScriPy/protocol_steps.py index 7f340ed..cc1f675 100644 --- a/EvoScriPy/protocol_steps.py +++ b/EvoScriPy/protocol_steps.py @@ -18,7 +18,7 @@ def not_implemented(NumOfSamples): print('This protocols have yet to be implemented.') -output_filename = '../current/AWL' +# output_filename = '../current/AWL' class Protocol: @@ -36,11 +36,11 @@ class Parameter: def __init__(self, GUI = None, worktable_template_filename = None, - output_filename = output_filename, + output_filename = None, firstTip = None): self.worktable_template_filename = worktable_template_filename or "" - self.output_filename = output_filename + self.output_filename = output_filename or '../current/AWL' self.GUI = GUI self.firstTip = firstTip or 'A01' @@ -56,7 +56,7 @@ def __init__(self, # worktable_template_fn , self.parameters = parameters or Protocol.Parameter() self.initialized = False self.Reactives = [] - self. nTips = nTips + self.nTips = nTips self.EvoMode = None self.set_EvoMode() @@ -77,7 +77,9 @@ def init_EvoMode(self): self.comments_ ]) EvoMode.current = self.EvoMode - self.worktable = self.iRobot.robot.worktable + self.worktable = self.iRobot.robot.worktable # shortcut !! + self.robot = self.iRobot.robot + assert (self.iRobot.robot.curArm().nTips == self.nTips ) def set_EvoMode(self): if not self.EvoMode: @@ -181,9 +183,9 @@ def moveTips(zMove, zTarget, offset, speed, TIP_MASK=-1): pass # Itr.moveLiha def getTips(TIP_MASK=-1, type=None, selected_samples=None): - robot = Rbt.Robot.current - mask = TIP_MASK = TIP_MASK if TIP_MASK != -1 else Rbt.tipsMask[Rbt.nTips] + robot = Rbt.Robot.current # todo revice !!! assert isinstance(robot, Rbt.Robot) + mask = TIP_MASK = TIP_MASK if TIP_MASK != -1 else Rbt.tipsMask[robot.curArm().nTips] #if not Rbt.Robot.reusetips: # and Rbt.Robot.droptips if robot.usePreservedtips: diff --git a/protocols/KingFisher_RNAextNucleoMag_EtOH80p/KingFisher_RNAextNucleoMag_EtOH80p.py b/protocols/KingFisher_RNAextNucleoMag_EtOH80p/KingFisher_RNAextNucleoMag_EtOH80p.py index e9bf32b..bb3a030 100644 --- a/protocols/KingFisher_RNAextNucleoMag_EtOH80p/KingFisher_RNAextNucleoMag_EtOH80p.py +++ b/protocols/KingFisher_RNAextNucleoMag_EtOH80p/KingFisher_RNAextNucleoMag_EtOH80p.py @@ -71,7 +71,7 @@ def Run(self): SampleLiqClass = "Serum Asp" # = TissueHomLiqClass # SerumLiqClass="Serum Asp preMix3" all_samples = range(NumOfSamples) - maxTips = min (Rbt.nTips, NumOfSamples) + maxTips = min (self.nTips, NumOfSamples) maxMask = Rbt.tipsMask[maxTips] diff --git a/protocols/PreKingFisher_RNAextNucleoMag/PreKingFisher_RNAextNucleoMag.py b/protocols/PreKingFisher_RNAextNucleoMag/PreKingFisher_RNAextNucleoMag.py index 78cf260..0da06cd 100644 --- a/protocols/PreKingFisher_RNAextNucleoMag/PreKingFisher_RNAextNucleoMag.py +++ b/protocols/PreKingFisher_RNAextNucleoMag/PreKingFisher_RNAextNucleoMag.py @@ -76,7 +76,7 @@ def Run(self): all_samples = range(NumOfSamples) - maxTips = min (Rbt.nTips, NumOfSamples) + maxTips = min (self.nTips, NumOfSamples) maxMask = Rbt.tipsMask[maxTips] diff --git a/protocols/PreKingFisher_RNAextNucleoMag_EtOH80p/PreKingFisher_RNAextNucleoMag_EtOH80p.py b/protocols/PreKingFisher_RNAextNucleoMag_EtOH80p/PreKingFisher_RNAextNucleoMag_EtOH80p.py index 378b3c8..dea38b8 100644 --- a/protocols/PreKingFisher_RNAextNucleoMag_EtOH80p/PreKingFisher_RNAextNucleoMag_EtOH80p.py +++ b/protocols/PreKingFisher_RNAextNucleoMag_EtOH80p/PreKingFisher_RNAextNucleoMag_EtOH80p.py @@ -71,7 +71,7 @@ def Run(self): SampleLiqClass = "Serum Asp" # = TissueHomLiqClass # SerumLiqClass="Serum Asp preMix3" all_samples = range(NumOfSamples) - maxTips = min (Rbt.nTips, NumOfSamples) + maxTips = min (self.nTips, NumOfSamples) maxMask = Rbt.tipsMask[maxTips] diff --git a/protocols/Prefill_plates_VEW1_ElutionBuffer_VEW2/Prefill_plates_VEW1_ElutionBuffer_VEW2.py b/protocols/Prefill_plates_VEW1_ElutionBuffer_VEW2/Prefill_plates_VEW1_ElutionBuffer_VEW2.py index 32fa5be..1069ba2 100644 --- a/protocols/Prefill_plates_VEW1_ElutionBuffer_VEW2/Prefill_plates_VEW1_ElutionBuffer_VEW2.py +++ b/protocols/Prefill_plates_VEW1_ElutionBuffer_VEW2/Prefill_plates_VEW1_ElutionBuffer_VEW2.py @@ -17,7 +17,7 @@ class Prefill_plates_VEW1_ElutionBuffer_VEW2(Evo100_FLI): """ Prefill plates with VEW1, Elution buffer and VEW2 for the Implementation of the protocol for RNA extraction using the NucleoMag® VET kit from MACHEREY-NAGEL - with watching in the Fischer Robot. + with washes in the Fischer Robot. """ name = "Prefill plates with VEW1, Elution buffer and VEW2 for KingFisher" @@ -73,7 +73,7 @@ def Run(self): all_samples = range(NumOfSamples) - maxTips = min (Rbt.nTips, NumOfSamples) + maxTips = min (self.nTips, NumOfSamples) maxMask = Rbt.tipsMask[maxTips] diff --git a/protocols/RNAextractionMN_Mag/RNAextractionMN_Mag_Vet.py b/protocols/RNAextractionMN_Mag/RNAextractionMN_Mag_Vet.py index a22e769..a185db9 100644 --- a/protocols/RNAextractionMN_Mag/RNAextractionMN_Mag_Vet.py +++ b/protocols/RNAextractionMN_Mag/RNAextractionMN_Mag_Vet.py @@ -91,9 +91,9 @@ def Run(self): SampleLiqClass ="Serum Asp" # = TissueHomLiqClass # SerumLiqClass="Serum Asp preMix3" all_samples = range(NumOfSamples) - maxTips = min(Rbt.nTips, NumOfSamples) + maxTips = min(self.nTips, NumOfSamples) maxMask = Rbt.tipsMask[maxTips] - par = TeMag.parallelOrder(Rbt.nTips, all_samples) + par = TeMag.parallelOrder(self.nTips, all_samples) LysisBuffer = Rtv.Reactive("VL - Lysis Buffer " , LysBuf, volpersample=LysisBufferVolume ,defLiqClass=B_liquidClass) @@ -178,7 +178,7 @@ def Run(self): with group("Wash in TeMag with " + EtOH80p.name), tips(): spread( reactive=EtOH80p,to_labware_region= TeMag.selectOnly(all_samples)) - with parallel_execution_of(mix_mag_sub, repeat=NumOfSamples//Rbt.nTips +1): + with parallel_execution_of(mix_mag_sub, repeat=NumOfSamples//self.nTips +1): mix( TeMag.selectOnly(all_samples), EtOH80p.defLiqClass) with incubation(minutes=0.5): Te_MagS_MoveToPosition(Te_MagS_MoveToPosition.Aspirate, z_pos=24).exec() @@ -195,7 +195,7 @@ def Run(self): Te_MagS_MoveToPosition(Te_MagS_MoveToPosition.Incubation).exec() Te_MagS_MoveToPosition(Te_MagS_MoveToPosition.Dispense).exec() - with parallel_execution_of(mix_mag_eluat, repeat=NumOfSamples//Rbt.nTips+1): + with parallel_execution_of(mix_mag_eluat, repeat=NumOfSamples//self.nTips+1): mix(TeMag.selectOnly(all_samples), ElutionBuffer.defLiqClass) with tips(usePreserved=preserveingTips(), preserve=False, drop=True): @@ -228,7 +228,7 @@ def wash_in_TeMag( self, reactive, wells=None, using_liquid_class=None, vol=None Te_MagS_MoveToPosition(Te_MagS_MoveToPosition.Dispense).exec() spread(reactive=reactive, to_labware_region=self.TeMag.selectOnly(wells)) - with parallel_execution_of(mix_mag_sub, repeat=self.NumOfSamples//Rbt.nTips +1): + with parallel_execution_of(mix_mag_sub, repeat=self.NumOfSamples//self.nTips +1): mix(self.TeMag.selectOnly(wells), using_liquid_class, vol) with incubation(minutes=0.5, timer=2):