Creating Multiple Containers / Types for Placement
The Clarity LIMS interface offers tremendous flexibility in placing the outputs of a protocol step into new containers.
Sometimes it is necessary that a step produces multiple containers of differing types (for example a 96-well plate and a 384-well plate). Such an interaction is not possible without using the Clarity LIMS API.
This example provides a script that creates a 96-well plate and a 384-well plate in preparation for subsequent manual placement of samples.
Solution
In this example, containers are created according to the following logic:
A 96 well plate is produced along with a 384 well plate.
Neither plate has a user-specified name. The LIMS names them using the LIMS ID of the plates.
Step Configuration
The step is configured:
To allow samples to be placed in 96 or 384 well plates.
To invoke the script as soon as the user enters the step's Sample Placement screen.
Parameters
The EPP / automation command is configured to pass the following parameters:
-l | The limsid of the process invoking the code (Required) | The {processLuid} token |
-u | The username of the current user (Required) | The {username} token |
-p | The password of the current user (Required) | The {password} token |
-s | The URI of the step that launches the script (Required) | The {stepURI:v2:http} token |
An example of the full syntax to invoke the script is as follows:
User Interaction
When the lab scientist enters the Sample Placement screen, the rightmost Placed Samples area displays the first container created (1 of 2). By selecting the second container, the display shows the second container (2 of 2).
The lab scientist manuallys place the samples into the containers and completes the protocol step as normal.
About the Code
Two calls to createContainer() create the destination 96-well and 384-well plates.
To create custom containers, supplement the createContainer() method with the configuration details that apply to your instance of Clarity LIMS.
To name the container with the value of the second argument, pass a non-empty string as the second argument to createContainer() method.
An XML payload is created containing only the details of the created containers, ready for the user to record the actual placements in the Clarity LIMS user interface.
This information is POSTed back to the server, in the format required for the placements resource.
A meaningful message is reported back to the user via the ../steps/<stepID>/programstatus API resource.
Assumptions and Notes
The attached file is placed on the Clarity LIMS server, in the /opt/gls/clarity/customextensions folder.
The Python API Library (glsapiutil.py) is placed on the Clarity LIMS server, in the /opt/gls/clarity/customextensions folder. You can download the latest glsapiutil library from our GitHub page.
Update the HOSTNAME global variable so that it points to your Clarity LIMS server.
The example code is provided for illustrative purposes only. It does not contain sufficient exception handling for use 'as is' in a production environment.
Attachments
createMultipleContainerTypes.py:
Last updated