science_jubilee.labware.Labware
#
Module Contents#
Classes#
A class representing a well of a labware. |
|
A class defining a set of wells expressed as a dictionary in which each keys is the |
|
A class representing a row of a labware, for example 'A', 'B', etc |
|
A class representing a column of a labware, for example 1, 2, etc. |
|
A class representing a basic laboratory labware made up of a set of wells/pipette tips. |
|
A point in the Jubilee 3D coordinate system. |
|
A location to target as a motion. |
- class science_jubilee.labware.Labware.Well#
A class representing a well of a labware.
Each Well is associated with a specific name, depth, total liquid volume, shape, diameter, x, y, and z dimension, y-dimension, as well as its coordinates and any applied offset
- Returns:
A
Well
object with various information about the geometry of the well and its position in the labware- Return type:
- property x#
Offsets the x-position of the each well with respect to the deck-slot coordinates
- Returns:
The x-coordinate of the well
- Return type:
float
- property y#
Offsets the y-position of the each well with respect to the deck-slot coordinates
- Returns:
The y-coordinate of the well
- Return type:
float
- property z#
Offsets the z-position of each well with respect to the deck-slot coordinates
- Returns:
The z-coordinate of the well
- Return type:
float
- property top_#
Defines the top-most point of the well
- Returns:
The z-coordinate of the top of the well
- Return type:
float
- property bottom_#
Defines the bottom-most point of the well
- Returns:
The z-coordinate of the bottom of the well
- Return type:
float
- name: str#
- depth: float#
- totalLiquidVolume: float#
- shape: str#
- diameter: float#
- xDimension: float#
- yDimension: float#
- x: float#
- y: float#
- z: float#
- offset: Tuple[float]#
- slot: int#
- has_tip: bool = False#
- clean_tip: bool = False#
- labware_name: str#
- apply_offset(offset: Tuple[float])#
Allows the user to offset the coordinates of the well with respect to the deck-slot coordinates
- Parameters:
offset (Tuple[float]) – A tuple of floats with the new offset of the well
- bottom(z: float, check=False)#
Allows the user to dinamically indicate a new Z location relative to the bottom of the well.
- Parameters:
z (float) – the distance in mm to offset the coordinates from the bottom of the well. Should be +
check (bool, optional) – the ‘z’ parameters can either be + or -. If negative, an assert error is raised to avoid collision with the labware. However, there might be instances of custom labware where the bottom of the well is purposely set as higher during the generation of its config .json file., defaults to False
- Returns:
A
Location
which contains information about the new coordinates generated and theWell
object- Return type:
- top(z: float)#
Allows the user to dinamically indicate a new Z location relative to the top of the well.
- __repr__()#
Displayed representation of a
Well
object indicating its name and its coordinates- Returns:
A string representation of the name and coordinates of a well
- Return type:
str
- set_has_tip(value: bool)#
Set the value of the has_tip attribute.
- Parameters:
value (bool) – The new value for the has_tip attribute
- set_clean_tip(value: bool)#
Returns the value of the clean_tip attribute.
- Parameters:
value (bool) – The new value for the clean_tip attribute
- class science_jubilee.labware.Labware.WellSet#
A class defining a set of wells expressed as a dictionary in which each keys is the the :attribute:`Well.name` object and the value is the
Well
object itself.- __repr__()#
Displays the wellset as a :list: of wells and the deck-slot nunmber
- Returns:
A :list: of
Well
objects diplayed by their :attribute:`Well.name`- Return type:
- __getitem__(id_: str | int)#
- Allows the user to select a
Well
object by either their :attribute:`Well.name` or their index in a :list:
- Parameters:
id (Union[str, int]) – The :attribute:`Well.name` or index representing a
Well
in the labware- Returns:
The
Well
object- Return type:
- Allows the user to select a
- class science_jubilee.labware.Labware.Row#
Bases:
WellSet
A class representing a row of a labware, for example ‘A’, ‘B’, etc
- Parameters:
WellSet (Dict[str, Well]) – A dictionary of
Well
objects in which each keys is the the :attribute:`Well.name` object and the value is theWell
object itself.
- identifier: str#
- class science_jubilee.labware.Labware.Column#
Bases:
WellSet
A class representing a column of a labware, for example 1, 2, etc.
- Parameters:
WellSet (Dict[str, Well]) – A dictionary of
Well
objects in which each keys is the the :attribute:`Well.name` object and the value is theWell
object itself.
- identifier: int#
- class science_jubilee.labware.Labware.Labware(labware_filename: str, offset: Tuple[float] = None, order: str = 'rows', path: str = os.path.join(os.path.dirname(__file__), 'labware_definition'))#
Bases:
WellSet
A class representing a basic laboratory labware made up of a set of wells/pipette tips.
- Parameters:
labware_filename (str) – The name of the config .json
offset (Tuple[float], optional) – Coordinates to use to offset all the wells in a labware for easier handling of coordinates. For example this is called by the :method:`Deck.load_labware` when assignign a labware to a deck slot, defaults to None
order (str, optional) – Option to order the wells of a labware either by row or columns, defaults to ‘rows’
path (str, optional) – Path to the folder containing the configuration .json files for the labware, defaults to the ‘labware_definition/’ in the science_jubilee/labware directory.
- property shape#
Returns the shape of the labware as a tuple of (rows, columns)
- Returns:
A tuple of (rows, columns)
- Return type:
Tuple[int, int]
- property ordering: List[List[str]]#
Returns the ordering of the wells in the labware as a list of lists. Each list represents a row of the labware.
- Returns:
A list of lists of
Well.name
objects- Return type:
List[List[str]]
- property brand: dict#
Returns the brand of the labware as a strin
- Returns:
A string with the brand of the labware
- Return type:
str
- property display_name#
Returns the display name of the labware as a string
- Returns:
A string with the display name of the labware
- Return type:
str
- property labware_type#
Returns the type of labware as a string
The type fo labware will generally either be a tiprack, wellplate, reservoir, etc.
- Returns:
A string with the type of labware
- Return type:
str
- property volume_units#
Returns the units of volume of the labware as a string
The volume units will be either uL or mL.
- Returns:
A string with the units of volume of the labware
- Return type:
str
- property dimensions: dict#
Returns the dimensions of the labware as a dictionary
- Returns:
A dictionary with the x,y, and z dimensions of the labware
- Return type:
dict
- property is_tip_rack#
Returns a boolean indicating if the labware is a tiprack
- Returns:
True if the labware is a tiprack, False otherwise
- Return type:
bool
- property load_name#
Returns the name of the labware as a string
- Returns:
A string with the name of the labware
- Return type:
str
- property tip_length#
Returns the length of the tip of the labware as a float if the labware is a tiprack, otherwise returns None
- Returns:
A float with the length of the tip of the labware or None otherwise
- Return type:
float
- property tip_overlap#
Returns the overlap of the tip of the labware as a float if the labware is a tiprack, otherwise returns None
- Returns:
A float with the overlap of the tip of the labware or None otherwise
- Return type:
float
- property offset#
Returns the offset of the labware as a tuple of floats
- Returns:
A tuple of floats with the offset of the labware
- Return type:
Tuple[float]
- __repr__()#
Displayed representation of a
Labware
object indicating the type of labware and its name. Additionally, it will show the :attribute:`Deck.slots` number if the labware has been already assigned to it.
- _create_rows_and_columns()#
Creates a dictionary of
Row
andColumn
andWell
objects from the data in the config .json file.
- get_row(row_id: str) Row #
Fucntions to fetch the
Well.name
of the indicated row.- Parameters:
row_id (str) – The name of a row of the labware, usually indicated by a capital letter (e.g., A, B, etc.)
- Returns:
A list of
Well
objects diplayed by their :attribute:`Well.name`- Return type:
- get_column(col_id: int) Column #
Fucntions to fetch the
Well.name
of the indicated column.- Parameters:
col_id (str) – The name of a column of the labware, usually indicated by an integer number (e.g., 1, 2, etc.)
- Returns:
A list of
Well
objects diplayed by their :attribute:`Well.name`- Return type:
- metadata() dict #
Returns the metadata of the labware as a dictionary
The metadata of a labware will generally contain the display name, the type of labware, and the units of volume. These can also be found as attributes of the
Labware
object.- Returns:
A dictionary with the metadata of the labware
- Return type:
dict
- parameters() dict #
Returns the parameters describing certain features of the labware as a dictionary
The parameters genereally include whether the shape of the labware is regular or irregular, if it is a tiprack, and other Opentrons specific parameters as we are using their ‘Custom Labware Page’ to generate the .json config files.
- Returns:
A dictionary with the parameters of the labware
- Return type:
dict
- add_slot(slot_)#
Add name of deck slot after labware has been loaded
- Parameters:
slot (str) – The name of the deck slot
- withWellOrder(order) list #
Reorders the wells by rows or by columns. Automatically updates the :attribute:`Labware.wells`
- Parameters:
order (str) – The order in which to reorder the wells. Can be either ‘rows’ or ‘columns’
- Returns:
A list of
Well
objects diplayed by their :attribute:`Well.name`- Return type:
list
- _translate_point(well: Well, theta: float, x_space: float, y_space: float, upper_left: Tuple[float])#
Helper function to translate the coordinates of a well by a given angle theta.
- static _nominal_coordinates(well: Well, x_space: float, y_space: float)#
Helper function to calculate the nominal coordinates of a well in a labware based on its row and column index.
- manual_offset(corner_wells: List[Tuple[float]], save: bool = False)#
Allows the user to manually offset the coordinates of the labware based on three corner wells.
Adapted from https://github.com/machineagency/sonication_station labware calibration procedure.
- load_manualOffset(apply: bool = True)#
Loads the manual offset of a labware from its config .json file for a specific slot
- Parameters:
apply (bool, optional) – Option to apply the manual offset to the labware or return values, defaults to False
- Returns:
A list of tuples containing the manual offset of the labware
- Return type:
List[Tuple[float]]
- static _getxyz(location: Well | Tuple | Location)#
Helper function to extract the x, y, z coordinates of a location object.
- Parameters:
location (Union[Well, Tuple, Location]) – The location object to extract the coordinates from. This can either be a
Well
, a :tuple: of x, y, z coordinates, or aLocation
object- Raises:
ValueError – If the location is not a
Well
, atuple
, or aLocation
object- Returns:
The x, y, z coordinates of the location
- Return type:
float, float, float
- class science_jubilee.labware.Labware.Point#
Bases:
NamedTuple
A point in the Jubilee 3D coordinate system.
- Parameters:
NamedTuple (
NamedTuple
) – A list-like container with a fixed number of elements- Returns:
A tuple of coordinates (x,y,z)
- Return type:
- x: float = 0.0#
- y: float = 0.0#
- z: float = 0.0#
- add(other)#
Adds the coordinates of two points
- substract(other)#
Substracts the coordinates of two points
- multiply(other: int | float)#
Multiplies the coordinates of a point by a scalar
- absolute()#
Returns the absolute value of the coordinates of a point.
- __repr__() str #
Returns a string representation of the coordinates of a point.
- Returns:
A string representation of the coordinates of a point
- Return type:
str
- class science_jubilee.labware.Labware.Location(point: Point, labware: Well | Labware)#
A location to target as a motion.
The location contains a
Point
and possibly an associatedLabware
orWell
instance.- property point: Point#
The coordinates (x,y,z) of a Well or a Labware
- Returns:
A tuple of coordinates (x,y,z)
- Return type:
- __iter__() Iterable[Point | Well | Labware] #
Iterable interface to support unpacking of
Location
objects.