pyplate.pyplate.PlateSlicer

class PlateSlicer(plate, item)[source]

Bases: Slicer

Represents a slice of a Plate.

__init__(plate, item)[source]
Parameters:
  • array_obj (numpy.ndarry) – Array to slice.

  • row_labels (list) – Row labels.

  • col_labels (list) – Column labels.

  • item – Slice(s) passed to __getitem__.

Methods

__init__(plate, item)

param array_obj:

Array to slice.

apply(func)

Apply function to data pointed to by slices.

copy()

dataframe([unit, substance, cmap, highlight])

param unit:

unit to return quantities in.

fill_to(solvent, quantity)

Fills all wells in slice with solvent up to quantity.

get()

Get data pointed to by slices.

get_dataframe()

get_moles(substance[, unit])

param unit:

unit to return moles in. ('mol', 'mmol', 'umol', etc.)

get_substances()

Returns: A set of substances present in the plate.

get_volumes([substance, unit])

param unit:

unit to return volumes in.

highlight_wells(styler)

parse_single(single)

Convert a single index to a tuple of integers.

parse_slice(item, labels)

Convert a slice to a tuple of integers.

parse_tuple(item)

Handle cases where item is a tuple.

remove([what])

Removes substances from slice

resolve_labels(item, labels)

Convert argument passed into __getitem__ to only contain integer indices.

set(values)

Replace data pointed to by slice(s).

Attributes

array

@private

name

shape

Gets shape of selected slice(s).

size

Gets size of selected slice(s).

apply(func)

Apply function to data pointed to by slices.

Parameters:

func – Function to apply.

Returns:

Result of function.

property array

@private

copy()
dataframe(unit: str | None = None, substance: str | Substance | Iterable[Substance] = 'all', cmap: str | None = None, highlight: bool = False)[source]
Parameters:
  • unit – unit to return quantities in.

  • substance – Substance or Substances to display quantity of.

  • cmap – Colormap to shade dataframe with.

  • highlight – Highlight wells in slice(s).

Returns: Shaded dataframe of quantities in each well.

fill_to(solvent: Substance, quantity: str)[source]

Fills all wells in slice with solvent up to quantity.

Parameters:
  • solvent – Substance to use to fill.

  • quantity – Desired final quantity in each well.

Returns: New Plate with desired final quantity in each well.

get()

Get data pointed to by slices.

get_dataframe()[source]
get_moles(substance: Substance | Iterable[Substance], unit: str = 'mol') ndarray[source]
Parameters:
  • unit – unit to return moles in. (‘mol’, ‘mmol’, ‘umol’, etc.)

  • substance – Substance to display moles of.

Returns: moles of substance in each well.

get_substances() set[Substance][source]

Returns: A set of substances present in the plate.

get_volumes(substance: Substance | Iterable[Substance] | None = None, unit: str | None = None) ndarray[source]
Parameters:
  • unit – unit to return volumes in.

  • substance – (optional) Substance to display volumes of.

Returns:

numpy.ndarray of volumes for each well in uL

highlight_wells(styler: pandas.io.formats.style.Styler) pandas.io.formats.style.Styler[source]
property name
parse_single(single) Tuple[int, int]

Convert a single index to a tuple of integers.

Parameters:

single – Index to parse, i.e. ‘A:1’ or (‘A’,’1’) or (1, 1).

static parse_slice(item, labels: List[str]) slice

Convert a slice to a tuple of integers.

Parameters:
  • labels – Row or column labels.

  • item – Slice to parse, i.e. slice(1, None, None) or slice(‘A’, None, None).

parse_tuple(item)

Handle cases where item is a tuple.

Parameters:

item – Tuples from slice(s) passed to __getitem__.

Returns:

Resolved tuples(s).

remove(what: Substance | int = 2)[source]

Removes substances from slice

Parameters:

what – What to remove. Can be a type of substance or a specific substance. Defaults to LIQUID.

Returns: New Plate with requested substances removed.

static resolve_labels(item: str | slice, labels: List[str]) int | slice

Convert argument passed into __getitem__ to only contain integer indices.

Parameters:
  • item – String or slice passed to __getitem__.

  • labels – Row or column labels.

Returns: Converted item.

set(values)

Replace data pointed to by slice(s).

Shape and size of values must match the shape and size of stored slice(s).

Parameters:

values – Data to store.

Raises:

ValueError – Shape or size doesn’t match.

property shape

Gets shape of selected slice(s).

property size

Gets size of selected slice(s).