How to use the autoprotocol.instruction.Instruction function in autoprotocol

To help you get started, we’ve selected a few autoprotocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
def __init__(
        self, object, acceleration, duration, flow_direction=None, spin_direction=None
    ):
        spin_json = {
            "object": object,
            "acceleration": acceleration,
            "duration": duration,
            "flow_direction": flow_direction,
            "spin_direction": spin_direction,
        }

        super(Spin, self).__init__(op="spin", data=spin_json)


class Thermocycle(Instruction):

    """
    Append a Thermocycle instruction to the list of instructions, with
    groups being a list of dicts in the form of:

    .. code-block:: python

        "groups": [{
            "cycles": integer,
            "steps": [{
              "duration": duration,
              "temperature": temperature,
              "read": boolean // optional (default true)
            },{
              "duration": duration,
              "gradient": {
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
def __init__(self, objects, volume, matrix, ladder, dataref, extract):
        super(GelPurify, self).__init__(
            op="gel_purify",
            data={
                "objects": objects,
                "volume": volume,
                "matrix": matrix,
                "ladder": ladder,
                "dataref": dataref,
                "extract": extract,
            },
        )


class Absorbance(Instruction):

    """
    Read the absorbance for the indicated wavelength for the indicated
    wells. Append an Absorbance instruction to the list of instructions for
    this Protocol object.

    Parameters
    ----------
    object : str or Ref
        Object to execute the absorbance read on
    wells : list(Well) or WellGroup
        WellGroup of wells to be measured or a list of well references in
        the form of ["A1", "B1", "C5", ...]
    wavelength : str or Unit
        wavelength of light absorbance to be read for the indicated wells
    dataref : str
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
raise ValueError(f"melting: {melting} was specified, but dyes was not")

        thermocycle = {
            "object": object,
            "groups": groups,
            "volume": volume,
            "dataref": dataref,
            "dyes": dyes,
            "melting": melting,
            "lid_temperature": lid_temperature,
        }

        super(Thermocycle, self).__init__(op="thermocycle", data=thermocycle)


class Incubate(Instruction):

    """
    Store a sample in a specific environment for a given duration. Once the
    duration has elapsed, the sample will be returned to the ambient environment
    until it is next used in an instruction.

    Parameters
    ----------
    object : Ref or str
        The container to be incubated
    where : Enum({"ambient", "warm_37", "cold_4", "cold_20", "cold_80"})
        Temperature at which to incubate specified container
    duration : Unit or str
        Length of time to incubate container
    shaking : bool, optional
        Specify whether or not to shake container if available at the specified
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
):
        json_dict = {
            "object": object,
            "wells": wells,
            "wavelength": wavelength,
            "num_flashes": flashes,
            "dataref": dataref,
            "incubate_before": incubate_before,
            "temperature": temperature,
            "settle_time": settle_time,
        }

        super(Absorbance, self).__init__(op="absorbance", data=json_dict)


class Fluorescence(Instruction):

    """
    Read the fluorescence for the indicated wavelength for the indicated
    wells.  Append a Fluorescence instruction to the list of instructions
    for this Protocol object.

    Parameters
    ----------
    object : str or Container
        object to execute the fluorescence read on
    wells : list(Well) or WellGroup
        WellGroup of wells to be measured or a list of well references in
        the form of ["A1", "B1", "C5", ...]
    excitation : str or Unit
        wavelength of light used to excite the wells indicated
    emission : str or Unit
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
"""

    def __init__(self, wells, duration, mode, mode_params, frequency, temperature):
        json_dict = {
            "wells": wells,
            "duration": duration,
            "frequency": frequency,
            "mode": mode,
            "mode_params": mode_params,
        }
        if temperature:
            json_dict["temperature"] = temperature
        super(Sonicate, self).__init__(op="sonicate", data=json_dict)


class MeasureMass(Instruction):
    """
    Measure the mass of containers

    Parameters
    ----------
    object : Container
        Container ref
    dataref: str
        Name of the data for the measurement
    """

    def __init__(self, object, dataref):
        json_dict = {"object": object, "dataref": dataref}
        super(MeasureMass, self).__init__(op="measure_mass", data=json_dict)

github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
Sanger sequencing type
    primer : Container, optional
        Tube containing sufficient primer for all RCA reactions.  This field
        will be ignored if you specify the sequencing type as "standard".
        Tube containing sufficient primer for all RCA reactions

    """

    def __init__(self, object, wells, dataref, type, primer=None):
        seq = {"type": type, "object": object, "wells": wells, "dataref": dataref}
        if primer and type == "rca":
            seq["primer"] = primer
        super(SangerSeq, self).__init__(op="sanger_sequence", data=seq)


class GelSeparate(Instruction):
    """
    Separate nucleic acids on an agarose gel.

    Parameters
    ----------
    objects: list or WellGroup or Well
        List of wells or WellGroup containing wells to be
        separated on gel.
    volume : str or Unit
        Volume of liquid to be transferred from each well specified to a
        lane of the gel.
    matrix : str
        Matrix (gel) in which to gel separate samples
    ladder : str
        Ladder by which to measure separated fragment size
    duration : str or Unit
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
shake_before=None,
    ):
        spec = {
            "dataref": dataref,
            "object": object,
            "groups": groups,
            "interval": interval,
            "num_intervals": num_intervals,
            "temperature": temperature,
            "shake_before": shake_before,
        }

        super(Spectrophotometry, self).__init__(op="spectrophotometry", data=spec)


class LiquidHandle(Instruction):
    """Manipulates liquids within locations

    A liquid handle instruction is constructed as a list of locations, where
    each location consists of the well location and the tip transports carried
    out within the well.

    Each liquid handle instruction corresponds to a single tip or set of tips.

    Parameters
    ----------
    locations : list(dict)
        See Also :meth:`LiquidHandle.builders.location`
    shape : dict, optional
        See Also :meth:`LiquidHandle.builders.shape`
    mode : str, optional
        the liquid handling mode
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
}

    droplet_size : str or Unit
        Volume representing a droplet_size.  The volume of each transfer should
        be a multiple of this volume.

    """

    def __init__(self, groups, droplet_size):
        super(AcousticTransfer, self).__init__(
            op="acoustic_transfer",
            data={"groups": groups, "droplet_size": droplet_size},
        )


class Spin(Instruction):
    """
    Apply the specified amount of acceleration to a plate using a centrifuge.

    Parameters
    ----------
    object : Ref or str
        Container to be centrifuged.
    acceleration : str
        Amount of acceleration to be applied to the container, expressed in
        units of "g" or "meter/second^2"
    duration : str or Unit
        Amount of time to apply acceleration.
    flow_direction : str
        Specifies the direction contents will tend toward with respect to
        the container. Valid directions are "inward" and "outward", default
        value is "inward".
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
):
        seq = {
            "flowcell": flowcell,
            "lanes": lanes,
            "sequencer": sequencer,
            "mode": mode,
            "index": index,
            "library_size": library_size,
            "dataref": dataref,
            "cycles": cycles,
        }

        super(IlluminaSeq, self).__init__(op="illumina_sequence", data=seq)


class SangerSeq(Instruction):
    """
    Send the indicated wells of the container specified for Sanger sequencing.
    The specified wells should already contain the appropriate mix for
    sequencing, including primers and DNA according to the instructions
    provided by the vendor.

    Parameters
    ----------
    object : Container or str
      Container with well(s) that contain material to be sequenced.
    wells : list(str)
      Well indices of the container that contain appropriate materials to be
      sent for sequencing.
    dataref : str
      Name of sequencing dataset that will be returned.
    type: Enum({"standard", "rca"})
github autoprotocol / autoprotocol-python / autoprotocol / instruction.py View on Github external
Parameters
    ----------
    object : Container or str
        Container to be flash frozen.
    duration : str or Unit
        Duration to submerge specified container in liquid nitrogen.

    """

    def __init__(self, object, duration):
        super(FlashFreeze, self).__init__(
            op="flash_freeze", data={"object": object, "duration": duration}
        )


class Evaporate(Instruction):
    """
    Removes liquid or moisture from sample.

    Parameters
    ----------
    ref : Container
        Sample container
    mode : str
        Mode of evaporation
    duration : Unit or str
        Duration object is processed
    evaporator_temperature : Unit or str
        Temperature object is exposed to
    mode_params : dict
        Dictionary of parameters for evaporation mode
    """