Publishing Files to LabLink
Last updated
Last updated
Some steps produce data that you would like your collaborators to have access to.
This example provides an alternative method and uses a script to publish the files programmatically via the API.
In this example, suppose we have a protocol step, based upon a Sanger/capillary sequencing workflow, that produces up to two files per sample (a .seq and a .ab1 file).
Our example script runs at the end of the protocol step. The script publishes the output files so that they are available to collaborators in the LabLink Collaborations Interface.
The EPP / automation command is configured to pass the following parameters:
An example of the full syntax used to invoke the script is as follows:
After the script has completed its execution, collaborators are able to view and download the files from the LabLink Collaborations Interface.
The main method used in the script is publishFiles(). The method in turn carries out several operations:
The limsids of the steps' artifacts are gathered, and the artifacts are retrieved, in a single transaction using the 'batch' method.
Each artifact is investigated. If there is an associated file resource, its limsid is stored.
The files resources are retrieved in a single transaction using the 'batch' method.
For each file resource, the value of the <is-published> node is set to 'true'.
The files resources are saved back to Clarity LIMS in a single transaction using the 'batch' method.
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 example code is provided for illustrative purposes only. It does not contain sufficient exception handling for use 'as is' in a production environment.
publishFilesToLabLink.py:
publishFilesToLabLink_v2.py:
-u
The username of the current user (Required)
-p
The password of the current user (Required)
-s
The URI of the protocol step that launches the script - the {stepURI:v2:http} token (Required)