Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labelling labware wells #25

Merged
merged 3 commits into from
Feb 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion BiomationScripter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def __init__(self, Name, Type):
self.columns = None
self.content = {}
self.available_wells = None
self.well_labels = {}

def define_format(self, Rows, Columns):
self.rows = Rows
Expand Down Expand Up @@ -270,6 +271,22 @@ def add_content(self, Well, Reagent, Volume, Liquid_Class = False):
else:
self.content[Well] = [ [Reagent,float(Volume), Liquid_Class] ]

def add_well_label(self, Well: str, Label: str):
for well in self.well_labels:
if self.well_labels[well] == Label:
raise ValueError('Label "{}" is already used as a label in {}'.format(Label, well))
self.well_labels[Well] = Label

def get_well_content_by_label(self, Label: str):
for well in self.well_labels:
if self.well_labels[well] == Label:
return(self.content[well])

def get_well_location_by_label(self, Label: str):
for well in self.well_labels:
if self.well_labels[well] == Label:
return(well)

def get_content(self):
return(self.content)

Expand Down Expand Up @@ -333,7 +350,6 @@ def print(self):
print(well+"\t"+str(c[1])+"\t\t"+c[2]+"\t\t"+c[0])
return(content_return)


# create a dummy PlateLayout object before running this method
def import_plate(self, filename, path="~", ext=".xlsx"):
# check if filename contains the extension
Expand Down