Automatic Placement of Samples Based on Input Plate Map

The Clarity LIMS interface offers tremendous flexibility when placing the outputs of a protocol step into new containers. Consider if your protocol step always involves the placement of samples using the plate map of the input plate. If yes, it makes sense to automate sample placement.

This example provides a script that allows sample 'autoplacement' to occur. It also describes how the script can be triggered, and what the lab scientist sees when the script is running.

For an example script that automates sample placement using multiple plates, see the Automatic Placement of Samples Based on Input Plate Map (Multiple Plates) example.

Solution

In this example, samples are placed according to the following logic:

  • The step produces one output sample for every input sample.

  • The output samples are placed on a 96 well plate.

  • Each occupied well on the source 96 well place populates the corresponding well on the destination 96 well plate.

Step Configuration

In this example, the step is configured to invoke the script on entry to the Sample Placement screen.

Parameters

The EPP / automation command is configured to pass the following parameters:

-l

The luid of the process invoking the script (Required)

-u

The username of the current user (Required)

-p

The password of the current user (Required)

-s

The URI of the step that launches the script - the {stepURI:v2:http} token (Required)

An example of the full syntax to invoke the script is as follows:

/usr/bin/python /opt/gls/clarity/customextensions/autoplaceSamplesDefault.py -l 122-7953 -u admin -p securepassword -s http://192.168.9.123:8080/api/v2/steps/122-5601 

User Interaction

When the script has completed, the rightmost Placed Samples area of the Placement screen will display the container of auto-placed samples:

At this point the lab scientist can review the constituents of the container, and complete the step as normal.

About the Code

The main method in the script is autoPlace(). This method in turn carries out several operations:

  1. A call to createContainer() prompts the creation of the destination 96 well plate.

  2. The method harvests enough information so that the objects required by the subsequent code can retrieve the required objects using the 'batch' API operations. You add additional code to build and manage the cache of objects retrieved in the batch operations:

    • cacheArtifact()

    • prepareCache()

    • getArtifact()

  3. The cached analytes are accessed and the source well to which each analyte maps is determined.

  4. Output placement can then be set. This information is presented in XML that can be POSTed back to the server in the correct format required for the placements resource.

  5. After the analytes have been processed, the placements XML is further supplemented with required information, and POSTed to the ../steps/<stepID>/placements API resource.

  6. Finally, 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.

  • The HOSTNAME global variable must be updated 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

autoplaceSamplesDefault.py:

Last updated