Applying Indexing Patterns to Containers Automatically
The indexing of samples is often performed in patterns, based upon the location of the samples in the container.
This example shows how to automate the default placing of reagents on samples, based on their container position. This greatly reduces the amount of time spent on the Add Labels screen (LIMS v6.x) and also reduces user error.
In this example, reagent labels are assigned to samples in a predetermined pattern as the user enters the Add Reagents screen. This pattern is applied to all containers entering this stage.
Solution
The example AssignIndexPattern.groovy script is configured to run on the Adenylate Ends & Ligate Adapters (TruSeq DNA) 4.0 step.
Parameters
The script accepts the following parameters:
An example command line is shown below:
NOTE: The location of Groovy on your server may be different from the one shown in this example. If this is the case, modify the script accordingly.
Step Configuration
In the Clarity LIMS web interface, for the Adenylate Ends & Ligate Adapters (TruSeq DNA) 4.0 step (in the TruSeq DNA Sample Prep protocol), configure Automation as follows:
Clarity LIMS v6.x
Trigger Location: Add Labels
Trigger Style: Automatic upon entry
User Interaction
Assuming the user has added 96 samples and has reached the Adenylate Ends & Ligate Adapters (TruSeq DNA) 4.0 step:
The user transfers all 96 samples to a new 96-well plate and proceeds with step.
When the user enters the Add Labels screen, the script is initiated. A message box alerts the user that a custom script is in progress.
Upon completion, the previously defined success message displays.
When the success message is closed, the Add Labels screen loads, and the pattern shown below is applied to samples.
About the code
Once the script has processed the input and ensured that all the required information is available, we can start applying the reagents to our samples.
To begin, we need to define the reagents and pattern to apply.
The storing of reagents can be accomplished by placing the reagents in a Map, comprised of the reagent names indexed by their respective number, i.e. 'AD030' indexed at 30.
The pattern can be stored as a List of Lists. This can be arranged as a visual representation of the pattern to be applied.\
Once we have our reagents and pattern defined, we can start processing the samples:
We start by retrieving the node from the reagent setup endpoint. We use this node as a base for subsequent commands.
We then gather the unique output artifact URIs and retrieve the output artifacts using batchGET:\
Next, we iterate through our list of output artifacts.
For each artifact, we determine its position and use its components to index our pattern. This allows us to determine which reagent should be placed on which sample.
Once we determine the reagent's name, we create a reagent-label node with a name attribute equal to the desired reagent name.
In the list of output-reagents in the reagent setup node, we find the output that corresponds to the output artifact that we are processing and add our reagent-label node to it. NOTE: We must strip off the state from our artifact's URI. The URIs stored in the step setup node are stateless and will not match the URI returned from our output artifact.
Once we have processed all of our output artifacts, we POST our modified setup node to the reagentSetup endpoint. This updates the default placement in the API.
We then define our success message to display to the user upon the script's completion.\
Assumptions and Notes
Your configuration conforms with the script requirements documented in Solution.
You are running a version of Groovy that is supported by Clarity LIMS, as documented in the Clarity LIMS Technical Requirements.
The attached Groovy file is placed on the LIMS server, in the following location: /opt/gls/clarity/customextensions
GLSRestApiUtils.groovy is placed in your Groovy lib folder.
You have imported the attached Reagent XML file into your system using the Config Slicer tool.
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
Single Indexing ReagentTypes.xml:
AssignIndexPattern.groovy:
Last updated