autoprotocol.builders

Builders Module containing builders, which help build inputs for Instruction parameters

copyright:2019 by The Autoprotocol Development Team, see AUTHORS for more details.
license:BSD, see LICENSE for more details

Summary

These builder methods are used to generate and validate complex data structures used in Autoprotocol specification. Each of them is capable of using their own output as input. Therefore these builders are also used as inline checks in Protocol methods.

Notes

Generally these builders should not be called from this file directly. They’re more easily accessible by referencing a specific Instruction’s builders attribute (e.g. Spectrophotometry.Builders.mode_params).

See also

Instruction
Instructions corresponding to each of the builders
class autoprotocol.builders.InstructionBuilders[source]

General builders that apply to multiple instructions

shape(rows=1, columns=1, format=None)[source]

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.ThermocycleBuilders[source]

These builders are meant for helping to construct the groups argument in the Protocol.thermocycle method

dyes(**kwargs)[source]

Helper function for creating a dye parameter

Parameters:

**kwargs (dict(str: int or list(int))) – A mapping from a dye (str) to the index of a well

Returns:

A thermocycling dye to well mapping

Return type:

dict

Raises:
  • ValueError – If any of the specified dyes are not valid
  • ValueError – If wells is not an int, str, list(int), or list(str)
dyes_from_well_map(well_map)[source]

Helper function for creating a dye parameter from a well_map

Take a map of wells to the dyes it contains and returns a map of dyes to the list of wells that contain it.

Parameters:well_map (dict(well, str)) – A thermocycling well to dye mapping
Returns:A thermocycling dye to well mapping
Return type:dict

See also

Thermocycle.Builders.dyes()
standard constructor for the dyes parameter
static melting(start=None, end=None, increment=None, rate=None)[source]

Helper function for creating melting parameters

Generates melt curve parameters for Thermocycle Instructions.

Parameters:
  • start (str or Unit) – The starting temperature for the melt curve
  • end (str or Unit) – The ending temperature for the melt curve
  • increment (str or Unit) – The temperature increment of the melt curve
  • rate (str or Unit) – The duration the individual increments
Returns:

A thermocycling melt curve specification

Return type:

dict

Raises:

ValueError – If some, but not all melt curve parameters are specified

group(steps, cycles=1)[source]

Helper function for creating a thermocycle group, which is a series of steps repeated for the number of cycles

Parameters:
  • steps (list(ThermocycleBuilders.step)) – Steps to be carried out. At least one step has to be specified. See ThermocycleBuilders.step for more information
  • cycles (int, optional) – Number of cycles to repeat the specified steps. Defaults to 1
Returns:

A thermocycling group

Return type:

dict

Raises:
  • TypeError – Invalid input types, i.e. cycles is not of type int and steps is not of type list
  • ValueErrorcycles is not positive
  • ValueErrorsteps does not contain any elements
static step(temperature, duration, read=None)[source]

Helper function for creating a thermocycle step.

Parameters:
  • temperature (Unit or dict(str, Unit)) –

    Block temperature which the contents should be thermocycled at.

    If a gradient thermocycle is desired, specifying a dict with “top” and “bottom” keys will control the desired temperature at the top and bottom rows of the block, creating a gradient along the column.

    ..code-block:: python

    temperature = {“top”: “50:celsius”, “bottom”: “45:celsius”}
  • duration (str or Unit) – Duration where the specified temperature parameters will be applied
  • read (Boolean, optional) – Determines if a read at wavelengths specified by the dyes in the parent thermocycle instruction will be enabled for this particular step. Useful for qPCR applications.
Returns:

A thermocycling step

Return type:

dict

Raises:
  • TypeError – Invalid input types, e.g. read is not of type bool
  • ValueError – Invalid format specified for temperature dict
  • ValueError – Duration is not greater than 0 second
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.SPEBuilders[source]

These builders are meant for helping to construct arguments for the SPE instruction.

mobile_phase_params(volume, loading_flowrate, settle_time, processing_time, flow_pressure, resource_id=None, is_sample=False, destination_well=None, is_elute=False)[source]

Create a dictionary with mobile phase parameters which can be used as input for instructions.

Parameters:
  • volume (str or Unit) – the duration to shake the plate for
  • loading_flowrate (str or Unit, optional) – amplitude of shaking between 1 and 6:millimeter
  • settle_time (bool, optional) – True for orbital and False for linear shaking
  • processing_time (str or Unit) – Duration for which pressure is applied to the cartridge after settle_time has elapsed.
  • flow_pressure (str or Unit) – Pressure applied to the column.
  • resource_id (str) – Resource ID of desired solvent.
  • is_sample (bool) – If a sample is processed.
  • destination_well (Well) – Destination well for eluate. Required parameter for each elute mobile phase parameter
  • is_elute (bool) – If an elute is processed.
Returns:

spe mobile_phase_params

Return type:

dict

Raises:
  • ValueError – if shake flow_pressure is not positive
  • ValueError – if mobile phase solvent and resource_id not included
  • TypeError – if resource_id is not a string
  • ValueError – if settle_time is not positive
  • ValueError – if processing_time is not positive
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.DispenseBuilders[source]

These builders are meant for helping to construct arguments in the Protocol.dispense method.

static nozzle_position(position_x=None, position_y=None, position_z=None)[source]

Generates a validated nozzle_position parameter.

Parameters:
  • position_x (Unit, optional) –
  • position_y (Unit, optional) –
  • position_z (Unit, optional) –
Returns:

Dictionary of nozzle position parameters

Return type:

dict

static column(column, volume)[source]

Generates a validated column parameter.

Parameters:
  • column (int) –
  • volume (str, Unit) –
Returns:

Column parameter of type {“column”: int, “volume”: Unit}

Return type:

dict

columns(columns)[source]

Generates a validated columns parameter.

Parameters:

columns (list({"column": int, "volume": str, Unit})) –

Returns:

List of columns of type ({“column”: int, “volume”: str, Unit})

Return type:

list

Raises:
  • ValueError – No column specified for columns
  • ValueError – Non-unique column indices
shake_after(duration, frequency=None, path=None, amplitude=None)[source]

Generates a validated shake_after parameter.

Parameters:
  • duration (Unit, str) –
  • frequency (Unit, str, optional) –
  • path (str, optional) –
  • amplitude (Unit, str, optional) –
Returns:

Shake after dictionary of type {“duration”: Unit, “frequency”: Unit, “path”: str, “amplitude”: Unit}

Return type:

dict

Raises:

ValueError – Invalid shake path specified

shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.SpectrophotometryBuilders[source]

These builders are meant for helping to construct arguments for the Spectrophotometry instruction.

static wavelength_selection(shortpass=None, longpass=None, ideal=None)[source]

Generates a representation of a wavelength selection by either filters (using shortpass/longpass) or monochromators (using ideal)

Parameters:
  • shortpass (Unit, str, optional) –
  • longpass (Unit, str, optional) –
  • ideal (Unit, str, optional) –
Returns:

Wavelength selection parameters.

Return type:

dict

groups(groups)[source]
Parameters:groups (list(dict)) – A list of spectrophotometry groups.
Returns:A list of spectrophotometry groups.
Return type:list(dict)
group(mode, mode_params)[source]
Parameters:
  • mode (str) – A string representation of a valid spectrophotometry mode.
  • mode_params (dict) – A dict of mode_params corresponding to the mode.
Returns:

A spectrophotometry group.

Return type:

dict

Raises:

ValueError – Invalid mode specified

absorbance_mode_params(wells, wavelength, num_flashes=None, settle_time=None, read_position=None, position_z=None)[source]
Parameters:
  • wells (iterable(Well) or WellGroup) – Wells to be read.
  • wavelength (Unit or str) – The wavelengths at which to make absorbance measurements.
  • num_flashes (int, optional) – The number of discrete reads to be taken and then averaged.
  • settle_time (Unit or str, optional) – The time to wait between moving to a well and reading it.
  • read_position (Enum("top", "bottom"), optional) – The position of the probe relative to the plate for the read
  • position_z (dict, optional) – This should be specified with either position_z_manual or position_z_calculated
Returns:

Formatted mode_params for an absorbance mode.

Return type:

dict

Raises:
  • TypeError – Invalid type specified for input parameters, e.g. num_flashes not of type int
  • ValueError – Invalid wells specified
fluorescence_mode_params(wells, excitation, emission, num_flashes=None, settle_time=None, lag_time=None, integration_time=None, gain=None, read_position=None, position_z=None)[source]
Parameters:
  • wells (iterable(Well) or WellGroup) – Wells to be read.
  • excitation (list(dict)) – A list of SpectrophotometryBuilders.wavelength_selection to determine the wavelegnth(s) of excitation light used.
  • emission (list(dict)) – A list of SpectrophotometryBuilders.wavelength_selection to determine the wavelegnth(s) of emission light used.
  • num_flashes (int, optional) – The number of discrete reads to be taken and then combined.
  • settle_time (Unit or str, optional) – The time to wait between moving to a well and reading it.
  • lag_time (Unit or str, optional) – The time to wait between excitation and reading.
  • integration_time (Unit or str, optional) – Time over which the data should be collected and integrated.
  • gain (int, optional) – The amount of gain to be applied to the readings.
  • read_position (str, optional) – The position from which the wells should be read.
  • position_z (dict, optional) – This should be specified with either position_z_manual or position_z_calculated
Returns:

Formatted mode_params for a fluorescence mode.

Return type:

dict

Raises:
  • TypeError – Invalid input types, e.g. settle_time is not of type Unit(second)
  • ValueError – Invalid wells specified
  • ValueError – Gain is not between 0 and 1
luminescence_mode_params(wells, num_flashes=None, settle_time=None, integration_time=None, gain=None, read_position=None, position_z=None)[source]
Parameters:
  • wells (iterable(Well) or WellGroup) – Wells to be read.
  • num_flashes (int, optional) – The number of discrete reads to be taken and then combined.
  • settle_time (Unit or str, optional) – The time to wait between moving to a well and reading it.
  • integration_time (Unit or str, optional) – Time over which the data should be collected and integrated.
  • gain (int, optional) – The amount of gain to be applied to the readings.
  • read_position (Enum("top", "bottom"), optional) – The position of the probe relative to the plate for the read
  • position_z (dict, optional) – This should be specified with either position_z_manual or position_z_calculated
Returns:

Formatted mode_params for a luminescence mode.

Return type:

dict

Raises:
  • TypeError – Invalid input types, e.g. settle_time is not of type Unit(second)
  • ValueError – Gain is not between 0 and 1
shake_mode_params(duration=None, frequency=None, path=None, amplitude=None)[source]
Parameters:
  • duration (Unit or str, optional) – The duration of the shaking incubation, if not specified then the incubate will last until the end of read interval.
  • frequency (Unit or str, optional) – The frequency of the shaking motion.
  • path (str, optional) – The name of a shake path. See the spectrophotometry ASC for diagrams of different shake paths.
  • amplitude (Unit or str, optional) – The amplitude of the shaking motion.
Returns:

Formatted mode_params for a shake mode.

Return type:

dict

shake_before(duration, frequency=None, path=None, amplitude=None)[source]
Parameters:
  • duration (Unit or str) – The duration of the shaking incubation.
  • frequency (Unit or str, optional) – The frequency of the shaking motion.
  • path (str, optional) – The name of a shake path. See the spectrophotometry ASC for diagrams of different shake paths.
  • amplitude (Unit or str, optional) – The amplitude of the shaking motion.
Returns:

Formatted mode_params for a shake mode.

Return type:

dict

position_z_manual(reference=None, displacement=None)[source]

Helper for building position_z parameters for a manual position_z configuration

Parameters:
  • reference (str, optional) – Must be one of “plate_top”, “plate_bottom”, “well_top”, “well_bottom”
  • displacement (Unit or str, optional) – Displacement from reference position. Negative would refer to the well_top to well_bottom direction, while positive would refer to the opposite direction.
Returns:

position_z parameters for a Spectrophotometry instruction

Return type:

dict

Raises:
  • ValueError – If reference was not in the allowed list
  • ValueError – If invalid displacement was provided
position_z_calculated(wells, heuristic=None)[source]

Helper for building position_z parameters for a calculated position_z configuration

Parameters:
  • wells (list(Well)) – List of wells to calculate the z-position from
  • heuristic (str, optional) – Must be one of “max_mean_read_without_saturation” or “closest_distance_without_saturation”. Please refer to ASC-041 for the full explanation
Returns:

position_z parameters for a Spectrophotometry instruction

Return type:

dict

Raises:
  • ValueError – If a list of wells is not provided
  • ValueError – If an invalid heuristic is specified
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.LiquidHandleBuilders[source]

Builders for LiquidHandle Instructions

location(location=None, transports=None)[source]

Helper for building locations

Parameters:
  • location (Well or str, optional) – Location refers to the well location where the transports will be carried out
  • transports (list(dict), optional) – Transports refer to the list of transports that will be carried out in the specified location See Also LiquidHandle.builders.transport
Returns:

location parameters for a LiquidHandle instruction

Return type:

dict

Raises:
  • TypeError – If locations aren’t str/well
  • ValueError – If transports are specified, but empty
transport(volume=None, pump_override_volume=None, flowrate=None, delay_time=None, mode_params=None)[source]

Helper for building transports

Parameters:
  • volume (Unit or str, optional) – Volume to be aspirated/dispensed. Positive volume -> Dispense. Negative -> Aspirate
  • pump_override_volume (Unit or str, optional) – Calibrated volume, volume which the pump will move
  • flowrate (dict, optional) – Flowrate parameters See Also LiquidHandle.builders.flowrate
  • delay_time (Unit or str, optional) – Time spent waiting after executing mandrel and pump movement
  • mode_params (dict, optional) – Mode parameters See Also LiquidHandle.builders.mode_params
Returns:

transport parameters for a LiquidHandle instruction

Return type:

dict

static flowrate(target, initial=None, cutoff=None, acceleration=None, deceleration=None)[source]

Helper for building flowrates

Parameters:
  • target (Unit or str) – Target flowrate
  • initial (Unit or str, optional) – Initial flowrate
  • cutoff (Unit or str, optional) – Cutoff flowrate
  • acceleration (Unit or str, optional) – Volumetric acceleration for initial to target (in ul/s^2)
  • deceleration (Unit or str, optional) – Volumetric deceleration for target to cutoff (in ul/s^2)
Returns:

flowrate parameters for a LiquidHandle instruction

Return type:

dict

mode_params(liquid_class=None, position_x=None, position_y=None, position_z=None, tip_position=None)[source]

Helper for building transport mode_params

Mode params contain information about tip positioning and the liquid being manipulated

Parameters:
  • liquid_class (Enum({"default", "air"}), optional) – The name of the liquid class to be handled. This affects how vendors handle populating liquid handling defaults.
  • position_x (dict, optional) – Target relative x-position of tip in well. See Also LiquidHandle.builders.position_xy
  • position_y (dict, optional) – Target relative y-position of tip in well. See Also LiquidHandle.builders.position_xy
  • position_z (dict, optional) – Target relative z-position of tip in well. See Also LiquidHandle.builders.position_z
  • tip_position (dict, optional) – A dict of positions x, y, and z. Should only be specified if none of the other tip position parameters have been specified.
Returns:

mode_params for a LiquidHandle instruction

Return type:

dict

Raises:
  • ValueError – If liquid_class is not in the allowed list
  • ValueError – If both position_x|y|z and tip_position are specified
static move_rate(target=None, acceleration=None)[source]

Helper for building move_rates

Parameters:
  • target (Unit or str, optional) – Target velocity. Must be in units of
  • acceleration (Unit or str, optional) – Acceleration. Must be in units of
Returns:

move_rate parameters for a LiquidHandle instruction

Return type:

dict

position_xy(position=None, move_rate=None)[source]

Helper for building position_x and position_y parameters

Parameters:
  • position (Numeric, optional) – Target relative x/y-position of tip in well in unit square coordinates.
  • move_rate (dict, optional) – The rate at which the tip moves in the well See Also LiquidHandle.builders.move_rate
Returns:

position_xy parameters for a LiquidHandle instruction

Return type:

dict

Raises:
  • TypeError – If position is non-numeric
  • ValueError – If position is not in range
position_z(reference=None, offset=None, move_rate=None, detection_method=None, detection_threshold=None, detection_duration=None, detection_fallback=None, detection=None)[source]

Helper for building position_z parameters

Parameters:
  • reference (str, optional) –
    Must be one of “well_top”, “well_bottom”, “liquid_surface”,
    ”preceding_position”
  • offset (Unit or str, optional) – Offset from reference position
  • move_rate (dict, optional) – Controls the rate at which the tip moves in the well See Also LiquidHandle.builders.move_rate
  • detection_method (str, optional) – Must be one of “tracked”, “pressure”, “capacitance”
  • detection_threshold (Unit or str, optional) – The threshold which must be crossed before a positive reading is registered. This is applicable for capacitance and pressure detection methods
  • detection_duration (Unit or str, optional) – The contiguous duration where the threshold must be crossed before a positive reading is registered. This is applicable for pressure detection methods
  • detection_fallback (dict, optional) – Fallback option which will be used if sensing fails See Also LiquidHandle.builders.position_z
  • detection (dict, optional) – A dict of detection parameters. Should only be specified if none of the other detection parameters have been specified.
Returns:

position_z parameters for a LiquidHandle instruction

Return type:

dict

Raises:
  • ValueError – If reference was not in the allowed list
  • ValueError – If both detection_method|duration|threshold|fallback and detection are specified
  • ValueError – If detection_method is not in the allowed list
  • ValueError – If detection parameters were specified, but the reference position doesn’t support detection
static instruction_mode_params(tip_type=None)[source]

Helper for building instruction mode_params

Parameters:tip_type (str, optional) – the string representation ofa tip_type See Also tip_type.py
Returns:mode_params for a LiquidHandle instruction
Return type:dict
mix(volume, repetitions, initial_z, asp_flowrate=None, dsp_flowrate=None)[source]

Helper for building mix params for Transfer LiquidHandleMethods

Parameters:
  • volume (Unit or str) – the volume of the mix step
  • repetitions (int) – the number of times that the mix should be repeated
  • initial_z (dict) – the position that the tip should move to prior to mixing See Also LiquidHandle.builders.position_z
  • asp_flowrate (dict, optional) – the flowrate of the aspiration portions of the mix See Also LiquidHandle.builders.flowrate
  • dsp_flowrate (dict, optional) – the flowrate of the dispense portions of the mix See Also LiquidHandle.builders.flowrate
Returns:

mix parameters for a LiquidHandleMethod

Return type:

dict

Raises:

TypeError – If repetitions is not an int

blowout(volume, initial_z, flowrate=None)[source]

Helper for building blowout params for LiquidHandleMethods

Parameters:
  • volume (Unit or str) – the volume of the blowout step
  • initial_z (dict) – the position that the tip should move to prior to blowing out See Also LiquidHandle.builders.position_z
  • flowrate (dict, optional) – the flowrate of the blowout See Also LiquidHandle.builders.flowrate
Returns:

blowout params for a LiquidHandleMethod

Return type:

dict

shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.PlateReaderBuilders[source]

Helpers for building parameters for plate reading instructions

incubate_params(duration, shake_amplitude=None, shake_orbital=None, shaking=None)[source]

Create a dictionary with incubation parameters which can be used as input for instructions. Currently supports plate reader instructions and could be extended for use with other instructions.

Parameters:
  • duration (str or Unit) – the duration to shake the plate for
  • shake_amplitude (str or Unit, optional) – amplitude of shaking between 1 and 6:millimeter
  • shake_orbital (bool, optional) – True for orbital and False for linear shaking
  • shaking (dict, optional) – A dict of amplitude and orbital: should only be specified if none of the other tip shake parameters have been specified. Dictionary of incubate parameters
Returns:

plate reader incubate_params

Return type:

dict

Raises:
  • ValueError – if shake duration is not positive
  • ValueError – if only one of shake_amplitude or shake_orbital is set
  • TypeError – if shake_orbital is not a bool
  • ValueError – if shake_amplitude is not positive
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.EvaporateBuilders[source]

Helpers for building Evaporate instructions

get_mode_params(mode, mode_params)[source]

Checks on the validity of mode and mode_params, and creates a dictionary for mode_params

Parameters:
  • mode (Str) – Mode of the evaporate method.
  • mode_params (Dict) – Method parameters for each mode.
Returns:

Dictionary of mode_params

Return type:

Dict

Raises:
  • ValueError – If mode is not specified.
  • ValueError – If specified mode is not a valid mode.
  • ValueError – If mode_params contain key(s) that are not applicable for the specified mode.
  • TypeError – If there are multiple speed parameters.
  • ValueError – If container agitation speed is less than 0.
  • ValueError – If vacuum_pressure is less than 0 torr.
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.GelPurifyBuilders[source]

Helpers for building GelPurify instructions

extract(source, band_list, lane=None, gel=None)[source]

Helper for building extract params for gel_purify

Parameters:
  • source (Well) – The Well that contains the sample be purified
  • band_list (list(dict)) – A list of bands to be extracted from the source sample
  • lane (int, optional) – The gel lane for the source sample to be run on
  • gel (int, optional) – The number of the gel if using multiple gels
Returns:

gel_purify extract parameters

Return type:

dict

Raises:

TypeError – If source is not a Well

band(elution_buffer, elution_volume, destination, min_bp=None, max_bp=None, band_size_range=None)[source]

Helper for building band params for gel_purify

Parameters:
  • elution_buffer (str) – The type of elution buffer to be used
  • elution_volume (str or Unit) – The volume of sample to be eluted
  • destination (Well) – The Well the extracted samples should be eluted into
  • min_bp (int, optional) – The minimum size sample to be removed.
  • max_bp (int, optional) – The maximum size sample to be removed.
  • band_size_range (dict, optional) – A dict of band size parameters. Should only be specified if none of the other band size parameters have been specified.
Returns:

gel_purify band parameters

Return type:

dict

Raises:
  • TypeError – If destination is not a Well
  • TypeError – If min_bp is not an int
  • TypeError – If max_bp is not an int
  • ValueError – If min_bp is not less than max_bp
shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.MagneticTransferBuilders[source]

Helpers for building MagneticTransfer instruction parameters

static mag_dry(object, duration)[source]

Helper for building mag_dry sub operations for MagneticTransfer

Parameters:
  • object (Container) – The Container to be operated on
  • duration (str or Unit) – The duration of the operation
Returns:

mag_dry parameters

Return type:

dict

Raises:

TypeError – If object is not a Container

See also

Protocol.mag_dry()

static mag_incubate(object, duration, magnetize, tip_position, temperature=None)[source]

Helper for building mag_incubate sub operations for MagneticTransfer

Parameters:
  • object (Container) – The Container to be operated on
  • duration (str or Unit) – The duration of the operation
  • magnetize (bool) – Whether the magnetic head should be engaged during the operation
  • tip_position (float) – Position relative to well height that magnetic head is held
  • temperature (str or Unit, optional) – The temperature of the operation
Returns:

mag_incubate parameters

Return type:

dict

Raises:
  • TypeError – If object is not a Container
  • TypeError – If magnetize is not a bool
  • ValueError – If tip_position is not a positive number

See also

Protocol.mag_incubate()

static mag_collect(object, cycles, pause_duration, bottom_position=None, temperature=None)[source]

Helper for building mag_collect sub operations for MagneticTransfer

Parameters:
  • object (Container) – The Container to be operated on
  • cycles (int) – The number of times the operation should be repeated
  • pause_duration (str or Unit) – The delay time between each repetition of the operation
  • bottom_position (float, optional) – Position relative to well height where the magnetic head pauses
  • temperature (str or Unit, optional) – The temperature of the operation
Returns:

mag_collect parameters

Return type:

dict

Raises:
  • TypeError – If object is not a Container
  • TypeError – If cycles is not an int
  • ValueError – If bottom_position is not a positive number

See also

Protocol.mag_collect()

static mag_release(object, duration, frequency, center=None, amplitude=None, temperature=None)[source]

Helper for building mag_release sub operations for MagneticTransfer

Parameters:
  • object (Container) – The Container to be operated on
  • duration (str or Unit) – The duration of the operation
  • frequency (str or Unit) – The frequency of the magnetic head during the operation
  • center (float, optional) – Position relative to well height where oscillation is centered
  • amplitude (float, optional) – Distance relative to well height to oscillate around center
  • temperature (str or Unit, optional) – The temperature of the operation
Returns:

mag_release parameters

Return type:

dict

Raises:
  • TypeError – If object is not a Container
  • ValueError – If center is less than 0
  • ValueError – If amplitude is greater than center

See also

Protocol.mag_release()

static mag_mix(object, duration, frequency, center=None, amplitude=None, magnetize=None, temperature=None)[source]

Helper for building mag_mix sub operations for MagneticTransfer

Parameters:
  • object (Container) – The Container to be operated on
  • duration (str or Unit) – The duration of the operation
  • frequency (str or Unit, optional) – The frequency of the magnetic head during the operation
  • center (float, optional) – Position relative to well height where oscillation is centered
  • amplitude (float, optional) – Distance relative to well height to oscillate around center
  • magnetize (bool, optional) – Whether the magnetic head should be engaged during the operation
  • temperature (str or Unit, optional) – The temperature of the operation
Returns:

mag_mix parameters

Return type:

dict

Raises:
  • TypeError – If object is not a Container
  • ValueError – If center is less than 0
  • ValueError – If amplitude is greater than center
  • TypeError – If magnetize is not a bool

See also

Protocol.mag_mix()

shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format
class autoprotocol.builders.FlowCytometryBuilders[source]

Builders for FlowCytometry instructions.

laser(excitation, channels, power=None, area_scaling_factor=None)[source]

Generates a dict of laser parameters.

Parameters:
  • excitation (Unit or str) – Excitation wavelength.
  • channels (list(dict)) – See FlowCytometryBuilders.channel().
  • power (Unit or str, optional) – Laser power.
  • area_scaling_factor (Number, optional) – Value to scale height and area equivalently.
Raises:
  • TypeError – If channels is not a list of dict.
  • TypeError – If channels is not a list of dict.
  • TypeError – If area_scaling_factor is not a number.
Returns:

A dict of laser parameters.

Return type:

dict

channel(emission_filter, detector_gain, measurements=None, trigger_threshold=None, trigger_logic=None)[source]

Generates a dict of channel parameters.

Parameters:
  • emission_filter (dict) – See FlowCytometryBuilders.emission_filter().
  • detector_gain (Unit or str) – Detector gain.
  • measurements (dict, optional) – Pulse properties to record. See FlowCytometryBuilders.measurements().
  • trigger_threshold (int, optional) – Channel intensity threshold. Events below this threshold.
  • trigger_logic (Enum({"and", "or"}), optional) – Operator used to combine threshold.
Raises:
  • TypeError – If trigger_threshold is not of type int.
  • ValueError – If trigger_logic is not one of {“and”, “or”}.
Returns:

A dict of channel parameters.

Return type:

dict

emission_filter(channel_name, shortpass=None, longpass=None)[source]

Generates a dict of emission filter parameters.

Parameters:
  • channel_name (str) – Specifies the channel name.
  • shortpass (Unit or str) – Shortpass filter wavelength.
  • longpass (Unit or str) – Longpass filter wavelength.
Raises:

ValueError – If values for longpass or shortpass are provided and channel_name is “FSC” or “SSC”.

Returns:

A dict of emission_filter params.

Return type:

dict

static measurements(area=None, height=None, width=None)[source]

Generates a dict of measurements parameters.

Parameters:
  • area (bool, optional) – Area measurement.
  • height (bool, optional) – Height measurement.
  • width (bool, optional) – Width measurement.
Raises:

TypeError – If any of area | height | width are not of type bool.

Returns:

A dict of measurements params.

Return type:

dict

collection_conditions(acquisition_volume, flowrate, wait_time, mix_cycles, mix_volume, rinse_cycles, stop_criteria=None)[source]

Generates a dict of collection_conditions parameters.

Parameters:
  • acquisition_volume (Unit or str) – Acquisition volume.
  • flowrate (Unit or str) – Flow rate.
  • wait_time (Unit or str) – Waiting time.
  • mix_cycles (int) – Number of mixing cycles before acquisition.
  • mix_volume (Unit or str) – Mixing volume.
  • rinse_cycles (int) – Number of rinsing cycles.
  • stop_criteria (dict, optional) – See FlowCytometryBuilders.stop_criteria().
Raises:
  • TypeError – If rinse_cycles is not of type int.
  • TypeError – If mix_cycles is not of type int.
Returns:

A dict of collection_condition parameters.

Return type:

dict

static stop_criteria(volume=None, events=None, time=None)[source]

Generates a dict of stop_criteria parameters.

Parameters:
  • volume (Unit or str, optional) – Stopping volume.
  • events (int, optional) – Number of events to trigger stop.
  • time (Unit or str, optional) – Stopping time.
Raises:

TypeError – If events is not of type int.

Returns:

A dict of stop_criteria params.

Return type:

dict

shape(rows=1, columns=1, format=None)

Helper function for building a shape dictionary

Parameters:
  • rows (int, optional) – Number of rows to be concurrently transferred
  • columns (int, optional) – Number of columns to be concurrently transferred
  • format (str, optional) – Plate format in String form. e.g. “SBS96” or “SBS384”
Returns:

shape parameters

Return type:

dict

Raises:
  • TypeError – If rows/columns aren’t ints
  • ValueError – If an invalid row/column count is given
  • ValueError – If an invalid shape is given
  • ValueError – If rows/columns are greater than what is allowed for the format