task_script_utils.plate_reader module#

exception InvalidWellLabelError[source]#

Bases: ValueError

Invalid well label error

class WellPosition(row: int, column: int)[source]#

Bases: object

Dataclass to represent well position for a well in a plate reader

row: int#
column: int#
class LabelFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: str, Enum

MIXED = 'mixed'#
DOUBLE = 'double'#
static from_well_label(well_label: str) WellPosition[source]#

For an alphanumeric well_label, return the corresponding well position. A well_label must satisfy following conditions:

  1. It must start with a letter

  2. It can contain at max two letters

    • When it contains two letters, they must both be upper case

  3. Letter(s) may be followed by at least one and at max two digits

If the label cannot be parsed, InvalidWellLabelError is raised.

Parsing for well_label containing single letter is case sensitive. ie. well labels A02 and a02 represent different wells on the plate

And Parsing for well_label containing two letters is limited to uppercase only. ie. AB01 is supported but ab01, Ab01 and aB01 are not supported

The following are the only supported sequence of rows for a plate

  1. A -> Z then a -> z

  2. A -> Z then AA -> AZ

Parameters:

well_label (str) – Alphanumeric string representing the well label.

Returns:

Return the corresponding WellPosition for well_label. eg: A01 -> WellPosition(row=1, column=1) A45 -> WellPosition(row=1, column=45) Z12 -> WellPosition(row=26, column=12) a12 -> WellPosition(row=27, column=12) z34 -> WellPosition(row=62, column=34) BD34 -> WellPosition(row=56, column=34) AA01 -> WellPosition(row=27, column=34)

Return type:

WellPositions

to_label(label_format: LabelFormat = LabelFormat.DOUBLE)[source]#

Convert WellPosition to a label

class Location(*args, **kwargs)[source]#

Bases: Protocol

Protocol for location

row: float | None#
column: float | None#
class SampleWithPk(*args, **kwargs)[source]#

Bases: Protocol[T]

Protocol for samples with pk

pk: Any#
location: T#
create_well_to_pk_map(samples: Sequence[SampleWithPk]) Dict[str, str][source]#

Create a map of wells to pk for samples