Checking That Containers Are Named Appropriately

When samples are placed onto containers in BaseSpace Clarity LIMS, the default operation is that containers produced by the system are named with their LIMS ID (for example 27-1234 etc). The expectation is that after samples have been placed, the user will rename the containers with the barcode that is on the plate, chip, or other container.

There are places in the workflow in which issues will occur with integrations if the user renames the container incorrectly.

For example, when loading libraries onto a flow cell for sequencing, the flow cell container must be renamed with the actual ID/barcode of the flow cell in order for the Illumina integration to complete its work successfully.

This example provides a short script that checks to see if the user has correctly renamed containers after the placement of samples. It also shows what occurs in the Clarity LIMS Web Interface when the script encounters a naming issue.

Solution

Protocol Step Configuration

In this example, the protocol step is configured to invoke the script when the user exits the step's Sample Placement screen.

Parameters

The EPP 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/validateContainerNames.py -l 122-7953 -u admin -p securepassword -s http://192.168.9.123:8080/api/v2/steps/122-5601 

User Interaction

When the user enters the Sample Placement screen, the rightmost Placed Samples area will show the containers created with their default, system-assigned names:

When the user tries to leave the Sample Placement screen, the script is invoked:

If the script finds any containers that still have their default, system-assigned names, an error message is generated:

To complete the protocol step, the user must first rename the containers:

About the Code

The main method of interest is validateContainerNames().

  1. This method queries the placements resource for the current step, and gathers the LIMS IDs of the selected containers.

  2. For each selected container associated with the protocol step, the containers resource is called:

    • The container name is compared to the LIMS ID.

    • If the values are identical, an error message is generated.

  3. Additional validation: Ideally, this script is set up to also validate the renamed containers against a specific goal. For example, the attached example script checks to see that the new name is at least 10 characters in length. You may choose to replace or supplement this optional, additional validation to provide specific logic to suit your business needs.\

    if cName == cLUID:
                containers.append( cName )
            else:
                ## optional, additional validation here
                if len(cName) < 10:
                    containers.append( cName )    

Assumptions and Notes

  • Both of the attached files are placed on the Clarity LIMS server, in the /opt/gls/clarity/customextensions folder.

  • You will need to update the HOSTNAME global variable such 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

validateContainerNames.py:

Last updated