Skip to content

Commit

Permalink
FIX global Lab.WorkTable.curWorkTable, now run multiple protocols !!!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
qPCR4vir committed Jul 17, 2018
1 parent d5760f8 commit 2ae99ca
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 16 deletions.
15 changes: 9 additions & 6 deletions EvoScriPy/EvoMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,26 @@ class Script(ScriptBody):
""" Create a full and executable script for the evoware soft. Take an existing script or script-template as a base.
"""

def __init__(self, filename=None, template=None, arms=None, robot=None):
def __init__(self, filename=None, template=None, robot=None):
ScriptBody.__init__(self, filename)
assert isinstance(robot, Rbt.Robot)
self.robot = robot # ?? may be None?
self.robot.set_as_current()
self.set_template(arms, template) # ??
self.set_template(template) # ??

def set_template(self, arms, template):
def set_template(self, template):
self.robot.set_as_current()
self.robot.set_worktable(template) # ????
self.templateNotAdded = True

def exec(self, instr):
self.robot.set_as_current()
def add_template(self):
if self.templateNotAdded:
for line in self.robot.worktable.template:
self.f.write((line[:-1] + "\n")) # .encode('Latin-1') \r
self.templateNotAdded = False

def exec(self, instr):
self.robot.set_as_current()
self.add_template()
ScriptBody.exec(self, instr)


Expand Down
7 changes: 4 additions & 3 deletions EvoScriPy/Labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def put(self, reactive, pos=None, replicas=None)->list:
and return a list of the wells used
:param reactive:
:param pos:
:param pos: [wells];
:param replicas: number of replicas
:return:
"""
Expand All @@ -420,10 +420,11 @@ def put(self, reactive, pos=None, replicas=None)->list:
str(pos) # replicas = len(pos) # todo What to do?

elif isinstance(pos, list):
if replicas is None: # put one replica on each of the given position
if replicas is None: # put one replica on each of the given wells position
replicas = len(pos)
else:
assert (replicas == len(pos))
assert (replicas == len(pos)), self.label + ": Can not put " + reactive.name + " in position " + str(
w.offset + 1) + " already occupied by " + w.reactive.name
else:
replicas = replicas or 1 # put one replica beginning from the given position
if isinstance(pos, Well):
Expand Down
2 changes: 1 addition & 1 deletion EvoScriPy/Reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, name, labware, volpersample=0, single_use=None,
:param name: str; Reactive name. Ex: "Buffer 1", "forward primer", "IC MS2"
:param labware: Labware;
:param volpersample: float; in uL
:param pos: if not set (=None) we will try to assign consecutive wells for all the replicas
:param pos: [wells]; if not set (=None) we will try to assign consecutive wells for all the replicas
:param replicas: int; def 1, number of replicas
:param defLiqClass: str;
:param excess: float; in %
Expand Down
15 changes: 9 additions & 6 deletions EvoScriPy/Robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,27 +229,30 @@ def __init__(self, index = None,
self.arms = arms if isinstance(arms, dict ) else \
{arms.index: arms} if isinstance(arms, Robot.Arm) else \
{ index: Robot.Arm(nTips, index, workingTips, tipsType)}
self.worktable = None
self.set_worktable(templateFile)
self.def_arm = index # or Pipette.LiHa1
self.droptips = True
self.reusetips = False
self.preservetips = False
self.usePreservedtips = False
self.allow_air = 0.0
self.set_as_current()
# self.preservedtips = {} # order:well
# self.last_preserved_tips = None # Lab.DITIrack, offset

def set_worktable(self,templateFile):
w = Lab.WorkTable.curWorkTable
if not w:
w = Lab.WorkTable(templateFile)
# w = Lab.WorkTable.curWorkTable
if templateFile is None: return
if isinstance(self.worktable, Lab.WorkTable): # todo temp? really to set
assert self.worktable.templateFileName == templateFile, 'Attemp to reset wortable from '\
+ self.worktable.templateFileName + ' into ' + templateFile
else:
w.parseWorTableFile(templateFile)
self.worktable = w
self.worktable = Lab.WorkTable(templateFile)

def set_as_current(self):
Robot.current = self
Lab.curWorkTable=self.worktable
Lab.curWorkTable=self.worktable # todo inconsistent duplication? allow for manuall actions?

def setUsed(self, tipMask, labware_selection):
# Deprecated ??????
Expand Down
63 changes: 63 additions & 0 deletions current/Prefill_plates_VEW1_ElutionBuffer_VEW2.gwl
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,66 @@ B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1
B;Aspirate(15,"Eluat","900.00","900.00","900.00","900.00",0,0,0,0,0,0,0,0,7,0,1,"0108l0",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080000000000l000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C0800000000000�00",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C08000000000000�1",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080000000000000N",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C08000000000000?0",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080000000000p700",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C08000000000�3000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C0800000000�10000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080000000�000000",0,0);
B;Aspirate(15,"Eluat","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,7,0,1,"0108l0",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C08000000l0000000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C0800000N00000000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080000?000000000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C0800p70000000000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C080�300000000000",0,0);
B;Dispense(15,"Eluat","100.00","100.00","100.00","100.00",0,0,0,0,0,0,0,0,25,1,1,"0C08�1000000000000",0,0);
B;Comment("Spread: 600.0 �L of VEW2 - WashBuffer 59904.0 �L total from [grid:23 site:5 well:1] into Plate VEW2[grid:25 site:3] in order [1, 2, 3, 4, 9, 10, 11, 12, 17, 18, 19, 20, 25, 26, 27, 28, 33, 34, 35, 36, 41, 42, 43, 44, 49, 50, 51, 52, 57, 58, 59, 60, 65, 66, 67, 68, 73, 74, 75, 76, 81, 82, 83, 84, 89, 90, 91, 92, 93, 94, 95, 96, 85, 86, 87, 88, 77, 78, 79, 80, 69, 70, 71, 72, 61, 62, 63, 64, 53, 54, 55, 56, 45, 46, 47, 48, 37, 38, 39, 40, 29, 30, 31, 32, 21, 22, 23, 24, 13, 14, 15, 16, 5, 6, 7, 8]:");
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08?0000000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080N000000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800l00000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000�0000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000�100000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800000�30000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000p7000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800000000?00000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000000N0000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000000000l000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800000000000�00",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000000000�1",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000000000000N",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000000000?0",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000000000p700",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000000�3000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800000000�10000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000000�000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08000000l0000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800000N00000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080000?000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C0800p70000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C080�300000000000",0,0);
B;Aspirate(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,23,4,1,"0108l0",0,0);
B;Dispense(15,"Water free cuvette","600.00","600.00","600.00","600.00",0,0,0,0,0,0,0,0,25,2,1,"0C08�1000000000000",0,0);
Loading

0 comments on commit 2ae99ca

Please sign in to comment.