Automatic Placement of Samples Based on Input Plate Map (Multiple Plates)

The BaseSpace Clarity LIMS interface offers tremendous flexibility when placing the outputs of a 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, and describes how the script can be triggered.

This script is similar in concept to the Automatic Placement of Samples Based on Input Plate Map example. The difference being that this updated example is able to work with multiple input plates, which can be of different types.

Solution

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

  • The process type / master step is configured to produce just one output analyte (derived sample) for every input analyte.

  • The output analytes are placed on the same type of container as the corresponding source plate.

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

  • The destination plate is named such that it has the text 'DEST-' prepended to the name of its corresponding source 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:

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

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

About the Code

The main method in the script is autoPlace(). This method executes several operations:

  1. The creation of the destination plates is effected by calls to createContainer().

  2. It harvests just enough information so that the objects required by the subsequent code can retrieve the required objects using the batch API operations. This involves using some additional code to build and manage the cache of objects retrieved in the batch operations, namely:

    • cacheArtifact()

    • prepareCache()

    • getArtifact()

  3. The cached analytes are then accessed. After the source well to which the analyte maps has been determined, the output placement can be set. This information is presented in XML that can be POSTed back to the server in the format required for the placements resource.

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

  5. 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

autoplaceSamplesDefaultMulti.py:

Last updated