TS Raw-to-IDS Task Scripts

📘

NOTE:

This instruction is for protocols that use TetraScience raw-to-ids task scripts. If your protocol is not using TS raw-to-ids task script as one of the steps, you can skip this instruction.

First, you can find TS raw-to-ids task script information on the Tetra Data Platform "View Artifacts" page. For example, if you want to use the BMG CLARIOstar raw-to-ids parser, you first search for "BMG" in the search bar on that page and find the common/bmg-labtech-util task script (shown in the screenshot below. By now you will see the script namespace is "common", script slug is "common/bmg-labtech-clariostar-raw-to-ids" and script version is "v2.0.0".

1176

And click on the "build-record.json" button you can find the function slug you will use is "clariostar-raw-csv-to-ids".

953

So in your protocol.json, you can define this step in steps to be:

{
  "slug": "clariostar-raw-to-ids",
  "description": "",
  "type": "parser",
  "script": {
    "namespace": "common",
    "slug": "bmg-labtech-util",
    "version": "v2.0.0"
  },
  "functionSlug": "clariostar-raw-csv-to-ids"
}

For raw-to-ids task script functions that will create an IDS JSON file, TetraScience is following these conventions:

  1. The input to the function will always be an object/dictionary of the following:
{
  "input_file_pointer": dict, <S3 location pointer of the input file>,
  "ids_file_category": str, <which category to save the IDS JSON. "IDS", "TMP" or "PROCESSED">
}
  1. The output will be:

If the raw-to-ids function creates one IDS JSON, the output will be the return of context.write_file function - an object/dictionary of the S3 location pointer, example:

{
  type: 's3file',
  bucket: 'bucket',
  fileKey: 'fileKey',
  fileId: 'fileId',
  version: 'versionId'
}

If the raw-to-ids function creates multiple IDS JSON, the output will be an array/list of the return of context.write_file function - an array/list of the S3 location pointers, example:

[{
  type: 's3file_1',
  bucket: 'bucket_1',
  fileKey: 'fileKey_1',
  fileId: 'fileId_1',
  version: 'versionId_1'
}, {
  type: 's3file_2',
  bucket: 'bucket_2',
  fileKey: 'fileKey_2',
  fileId: 'fileId_2',
  version: 'versionId_2'
}]