traytable methods

Note that the submodules traytable.screens, traytable.wells, traytable.csv exist purely for bookkeeping, and all methods below are available from the top-level import traytable.

Making screens and trays

traytable.screens.clonetray(oldtray, **kwargs)

Copy a tray, overriding parameters as desired

Parameters
  • oldtray (dict) – Tray to be copied

  • **kwargs (any type) – Accepts all arguments accepted by tray(), including rows and cols. Any parameters extant in oldtray not specified here will be copied into newtray

Returns

newtray – Dictionary to be passed to well() for logging hits from this tray

Return type

dict

traytable.screens.screen(row, col, maxwell, **kwargs)

Create a screen with global parameters

Parameters
  • row (string) – Parameter encoded by the row letter

  • col (string) – Parameter encoded by the column number

  • maxwell (string) – Name of the well in the bottom-right corner of each tray, e.g. ‘H6’

  • **kwargs (any type) – Any named arguments become global parameters to be applied to all wells in all trays in the screen

Returns

screen – A dictionary containing the screen

Return type

dict

traytable.screens.tray(screen, rows, cols, **kwargs)

Create a tray, based on a screen and row/column specifications

Parameters
  • screen (dict) – Screen from which the tray inherits global parameters

  • rows (list or float) – Value(s) to be used as row specifications. Must be a single number, a list of two numbers, or a list of length matchng the number of rows.

  • cols (list or float) – Value(s) to be used as column specifications. Must be a single number, a list of two numbers, or a list of length matching the number of columns.

  • **kwargs (any type) – Set any named parameters to apply them to all wells in the tray

Returns

tray – Dictionary to be passed to well() for logging hits from this tray

Return type

dict

Logging crystals

traytable.wells.well(tray, well, quality, old_df=None, **kwargs)

Add one or more rows to a dataframe of crystal hits

Parameters
  • tray (dict) – Tray, as created by traytable.tray()

  • well (string or list of strings) – Well name(s), in format ‘[letter][number]’

  • quality (string) – Short categorical description, e.g. “good” or “needles”

  • old_df (pandas.core.frame.DataFrame, optional) – Working dataframe to append to. If None, creates a new dataframe.

  • **kwargs (any type) – Any additional named arguments will become columns in the dataframe

Raises
  • TypeError – Improper type for well name

  • ValueError – Row or column specified by ‘well’ is out of the range specified by tray[‘maxwell’]

Returns

df – Dataframe containing the new reults, optionally concatenated with old_df

Return type

pandas.core.frame.DataFrame

The methods setrows() and setcols() are exported by the package, but not documented here because their use is not recommended, and they may be deprecated in a future version.