Skip to content

sample_carrier#

zen_api_utils.sample_carrier #

Classes:

  • WellPlate –

    Immutable description of a rectangular sample carrier (plate).

WellPlate dataclass #

WellPlate(rows: int, cols: int)

Immutable description of a rectangular sample carrier (plate).

Methods:

  • index_to_well –

    Convert a 0-based (row, col) index into a well label.

  • well_to_index –

    Converts a well identifier (e.g., "A1", "B12") into a tuple of zero-based row and column indices.

index_to_well #

index_to_well(row: int, col: int) -> str

Convert a 0-based (row, col) index into a well label.

Parameters:

  • row (int) –

    The 0-based row index.

  • col (int) –

    The 0-based column index.

Returns:

  • str ( str ) –

    The well label in the format of a letter (row) followed by a number (column), e.g., 'B3' for row 1 and column 2.

Raises:

  • ValueError –

    If the provided row or column index is out of bounds.

well_to_index #

well_to_index(well: str) -> tuple[int, int]

Converts a well identifier (e.g., "A1", "B12") into a tuple of zero-based row and column indices. Args: well (str): The well identifier to convert. It should be in the format of letters followed by digits (e.g., "A1", "B12"). The letters represent the row, and the digits represent the column. Returns: Tuple[int, int]: A tuple containing the zero-based row index and column index. Raises: ValueError: If the provided well identifier is invalid or does not match the expected format.