Resource Helper Functions

ResourceIDs

class autoprotocol_utilities.resource_helpers.ResourceIDs[source]

Common resource ids

A list of resource identification numbers used to provision resources using Autoprotocol.

Example

from autoprotocol-utilities import ResourceIDs

res = ResourceIDs()
res.water
res.te
res.zymo_10b
res.zymo_dh5a
res.zymo_jm109
res.ampicillin_100mg_ml
res.chloramphenicol_34mg_ml
res.kanamycin_50mg_ml
res.mytaq_poly
res.dpn_neb
res.phusion_poly
res.orange_g_100
res.orange_g_500
Returns:resource id of the reagent
Return type:str

ResourceIDs methods

ResourceIDs.bacteria(bact=None)[source]

Return competent bacteria id

Parameters:bact (string) – Bacteria name, one of: ‘Zymo 10B’, ‘Zymo DH5a’, ‘Zymo JM109’
Returns:resource id for the bacteria requested, None if bact could not be found
Return type:string
ResourceIDs.diluents(dil=None)[source]

Return diluent id

Parameters:dil (string) – Diluent name, one of: ‘water’, ‘TE’
Returns:resource id for the diluent requested, None if dil could not be found
Return type:string
ResourceIDs.transformation_controls(media=None)[source]

Return transformation controls

Parameters:media (string) – Media for which to select the control. One of: ‘lb_miller_50ug_ml_kan’, ‘lb_miller_100ug_ml_amp’
Returns:resource id for the positive control requested, None if media could not be found
Return type:string
ResourceIDs.t4_ligase(ligase_type=None)[source]

Return T4 ligase reagents

Parameters:media (string) – Vendor to use. ‘neb’ or ‘thermo’.
Returns:‘buffer’ - resource id for the buffer ‘ligase’ - resource id for the ligase
Return type:dict
ResourceIDs.restriction_enzyme_buffers(enzyme)[source]

Returns a tuple of enzyme_id and buffer_id for a given enzyme

Restriction enzymes need to be digested with a certain buffer. This function returns the correct resource id for the enzyme as well as for the matching buffer.

Parameters:enzyme (string) – name of enzyme, all lower caps such as dpni_neb or ncoi_hf
Returns:enzyme_id, buffer_id, errors
Return type:namedtuple

oligo_scale_default

autoprotocol_utilities.resource_helpers.oligo_scale_default(length, scale, label)[source]

Detects if the oligo length matches the selected scale

Every oligo provider has a length limit on the oligos based on the selected scale. The larger the scale, the longer or shorter the oligo can be. This function checks for IDT limits

Parameters:
  • length (int) – Length of the oligo in question.
  • scale (str) – Scale of the oligo in question.
  • label (str) – Name of the oligo.
Returns:

‘success’ (bool) and ‘error_message’ (string) that is empty upon success

Return type:

namedtuple

oligo_dilution_table

autoprotocol_utilities.resource_helpers.oligo_dilution_table(conc=None, sc=None)[source]

Return dilution table

Determine the amount of diluent to add to an oligo based on concentration wanted and scale ordered. This function can return the entire dilution table or slices and values as needd

Example Usage:

oligo_dilution_table(conc="100uM")
oligo_dilution_table(conc="100uM", scale="25nm")

Returns:

{"100uM": {"10nm":60, "25nm": 250, "100nm": 1000, "250nm": 2500,
           "1um": 10000}}
250
Parameters:
  • conc (str, optional) – The concentration you wish to select for. Currently 100uM or 1mM.
  • sc (str, optional) – The scale you wish to select for. Currently ‘10nm’, ‘25nm’, ‘100nm’, ‘250nm’ or ‘1um’.
Returns:

  • int – If concentration and scale are given this returns the dilution volume only
  • dict – If only one of concentration or scale is provided this function returns a dict. If a concentration is selected it returns a dict where scales are the keys and dilution volumes the values. If a scale is selected it returns a dict with concentrations as keys and dicts of scale (key) and dilution volume (value). If nothing is selected the full dict of concentrations with dicts of scales and dilution volumes is returned.

Raises:
  • ValueError – If conc is not a valid concentration: ‘100uM’, ‘1mM’
  • ValueError – If sc is is not a valid scale: ‘10nm’, ‘25nm’, ‘100nm’, ‘250nm’, ‘1um’

return_dispense_media

autoprotocol_utilities.resource_helpers.return_dispense_media()[source]

Returns a dict of media for reagent dispenser.

Example Usage:

from autoprotocol.protocol import Protocol
from autoprotocol-utilities import return_dispense_media

p = Protocol()
media = return_dispense_media()["50_ug/ml_Kanamycin"]
plate = p.ref("myplate", cont_type="96-flat", discard=True)
p.dispense_full_plate(plate, media, "200:microliter")
{
    "refs": {
        "myplate": {
            "new": "96-flat",
            "discard": True
        }
    },
    "instructions": [
        {
            "reagent": "lb_miller_50ug_ml_kan",
            "object": "myplate",
            "columns": [
                {
                    "column": 0,
                    "volume": "200:microliter"
                },
                {
                    "column": 1,
                    "volume": "200:microliter"
                },
                {
                    "column": 2,
                    "volume": "200:microliter"
                },
                {
                    "column": 3,
                    "volume": "200:microliter"
                },
                {
                    "column": 4,
                    "volume": "200:microliter"
                },
                {
                    "column": 5,
                    "volume": "200:microliter"
                },
                {
                    "column": 6,
                    "volume": "200:microliter"
                },
                {
                    "column": 7,
                    "volume": "200:microliter"
                },
                {
                    "column": 8,
                    "volume": "200:microliter"
                },
                {
                    "column": 9,
                    "volume": "200:microliter"
                },
                {
                    "column": 10,
                    "volume": "200:microliter"
                },
                {
                    "column": 11,
                    "volume": "200:microliter"
                }
            ],
            "op": "dispense"
        }
    ]
}
Returns:Media with common display_name as key and identifier for code as value
Return type:dict

return_agar_plates

autoprotocol_utilities.resource_helpers.return_agar_plates(wells=6)[source]

Returns a dict of all available agar plates.

Parameters:wells (integer) – Integer of the number of wells in the plate, 1 or 6. Default: 6 for 6-well plate
Returns:plates with plate identity as key and kit_id as value
Return type:dict
Raises:ValueError – If wells is not a integer equal to 1 or 6

ref_kit_container

autoprotocol_utilities.resource_helpers.ref_kit_container(protocol, name, container, kit_id, discard=True, store=None)[source]

Reserve agar plates for use within a protocol.

In use only to allow booking of agar plates within a protocol.

Example Usage:

from autoprotocol import Protocol
from autoprotocol_utilities import return_dispense_media,             return_agar_plates, ref_kit_container

p = Protocol()
bacteria = p.ref(name="test_bact", id=None,
                 cont_type="micro-1.5", discard=True).well(0)
media = return_dispense_media()["50_ug/ml_Kanamycin"]
agar_id = return_agar_plates(1)[media]
agar_plate = ref_kit_container(p, "my_agar_plate",
                               "6-flat", agar_id, discard=False,
                               store="cold_4")
Parameters:
  • protocol (Protocol) – instance of protocol.
  • name (str) – Name for the plate.
  • container (str) – Container type name.
  • kit_id (str) – Kit item to be created.
  • discard (bool) – Determine if plate is discarded after use.
  • store (str) – If the plate is not discarded, indicate valid storage condition.
Returns:

Return type:

Container