Maintaining Sample Syntaxes

Overview

Sample syntaxes are used generate a sample's code, name, client sample name and description.

Process

Configure a syntax to generate sample codes

When a sample is created the sample's Code is generated using syntax from the current laboratory or organisation, where the syntax's Syntax Type is Other and the Syntax Code is SAMPLE_CODE_SYNTAX. Only one syntax per job type should be in use per current lab or organisation.

Configure a syntax to generate sample names

When a sample is created the sample's Name is generated using syntax from the current laboratory or organisation, where the syntax's Syntax Type is Sample and the Syntax Code is SAMPLE_NAME_SYNTAX. A common configuration is for the sample name to be generated by a concatenation of the Job Name + "." + a running sequence of numbers (001 onwards).

Configure a syntax to generate client sample names

When a sample is created the sample's Client Sample Name can be generated from syntax from the current laboratory or organisation by using the format: Syntax(SYNTAX_CODE). To create multiple outputs, use the format: {<SyntaxDefinition>}n. Note that the length of the sample's Client Sample Name field is 4000 characters to cater for example, 200 sample where each client sample name is 20 characters.

When a sample is created the sample's Description can be generated from syntax from the current laboratory or organisation by using the format: Syntax(SYNTAX_CODE). To create multiple outputs, use the format: {<SyntaxDefinition>}n. Note that the length of the sample's Description field is 4000 characters to cater for example, 200 samples where each description is 20 characters.

Syntax Generation Process

The syntax comprises a pattern (for example, $yyyy_###), a floor, ceiling and increment value, and the last number used for both the inner and outer patterns. Note that the magnitude of the ceiling must match the available size of pattern, for example, #### could only fit a number up to 9999.

Org-scope and lab-scope variables are available for use in the syntaxes. Variables can include references to properties of objects exposed to the syntax generator and can invoke custom scripts. Refer to Maintaining and Using Syntax Variables.

Multiple syntaxes can be generated in one run. When a syntax is generated, the last number is updated.

Examples

  1. A sample code syntax of fixed characters followed by an incrementing number:
    ${
    String Lab="ZTF"
    return Lab}_S##########
  2. A sample name syntax of the job name and an incrementing sequence within the job, and LastJobSampleSequence is a variable established for the syntax (refer to the Syntax API):
    ${
    String JobNo=Job.name.asEllipseValue
    LastJobSampleSequence++
    String seq="000"+LastJobSampleSequence
    seq = seq.substring(seq.length()-3,seq.length())
    return JobNo+"."+seq
    }
  3. A client sample name syntax for one client sample name with an exact name:
    New_Client

    Result, one client sample name is created:

    New_Client
  4. A client sample name syntax for multiple client sample names with an exact name:
    {New_Client}3

    Result, 3 samples are created with this exact same name:

    New_Client
    New_Client
    New_Client

Using Pre-defined Variables

  1. A syntax for one client sample name using a pre-defined variable:

    New_Client$DateNew_Client

    Result, one sample is created with the name derived from the text and the evaluation of a pre-defined variable:

    New_Client23/07/2014New_Client
  2. A syntax for multiple client sample names using a pre-defined variable:

    {New_Client$DateNew_Client}3

    Result, 3 samples are created with the same names derived from the text and the evaluation of a pre-defined variable:

    New_Client23/07/2014New_Client
    New_Client23/07/2014New_Client
    New_Client23/07/2014New_Client
  3. A syntax using date replacement:

    {CONCENTRATE $dd-$mm-$yy}2

    Result, 2 samples are created with the same names derived from the text and the evaluation of a predefined variable:

    CONCENTRATE 001 23-07-14
    CONCENTRATE 002 23-07-14
  4. A syntax where there are no inner or outer sequences, but set to an exact name using a pre-defined variable, for one output, where the $yyyy variable is set to the current year:

    ANNUAL_$yyyy-SILO1

    Result, one client sample name is created:

    ANNUAL_2017-SILO1
  5. A syntax where there are no inner or outer sequences, but set to an exact name using a pre-defined variable, for a specified number of outputs where the $yyyy variable is set to the current year, the $MM variable is set to the current month, and the $dd variable is set to the current day:

    {FEED $yyyy$MM$dd}2

    Result, two client sample names are created:

    FEED 20140815
    FEED 20140815

Using Groovy Script that refers to Objects and Field Names

  1. A syntax for one client sample name using Groovy script to establish a variable:

    TEXT_${<GroovyScript>}TEXT
  2. A syntax for multiple client sample names using Groovy script to establish a variable:

    {TEXT_${<GroovyScript>}TEXT}n
  3. A syntax where there are no inner or outer sequences, but set to an exact name using a pre-defined variable, for one output, and the $yyyy variable is set to the current year:
    ${
    String Lab=Laboratory.name.asEllipseValue
    return Lab}_SAMP_$yy######

    Result, outputs 1 client sample name:

    ANNUAL_2017-SILO1

Using Pre-defined Syntaxes

  1. A syntax where there are no outer nor inner sequences, but set to an exact name using a pre-defined syntax, for one output, and LOT is a valid syntax set to "New_Client":
    Syntax(LOT)

    Result, outputs 1 client sample name using the LOT syntax:

    New_Client
  2. A syntax where there are no outer nor inner sequences, but set to an exact name using a pre-defined syntax, for a specified number of outputs, and LOT is a valid syntax set to "New_Client":
    {Syntax(LOT)}2

    Result, outputs 2 client sample names using the LOT syntax:

    New_Client
    New_Client

Using Outer Sequences

Syntax for one client sample name using an outer sequence:

TEXT_##,start,increment

Syntax for multiple client sample names using an outer sequence:

{TEXT_##, start, increment}n
  1. A syntax where there is an outer sequence only and the sequence starts with 1 and increments by 1, for one output:
    SAMP_##,1,1

    Result, outputs 1 client sample name:

    SAMP_01
  2. A syntax where there is an outer sequence only and the sequence starts with 1 and increments by 1, for a specified number of outputs:
    {SAMP#,1,1}5

    Result, outputs 5 client sample names:

    SAMP1
    SAMP2
    SAMP3
    SAMP4
    SAMP5
  3. A syntax where there is an outer sequence only and the sequence starts with 2 and increments by 2, for a specified number of outputs:
    {POINT_##,2,2}3

    Result, outputs 3 client sample names:

    POINT_02
    POINT_04
    POINT_06

Using Outer Sequences with String Replacement

Syntax for multiple client sample names using an outer sequence with string replacement:

{TEXT ##-!,start,increment,[STRING1, STRING2, STRING3,…]}n
  1. A syntax where there is an outer sequence only and string replacement:

    {Sam ##-!,1,1,[A,BB,CCC]}6

    Result, 6 samples are created with each name derived from the dynamic syntax:

    Sam 01-A
    Sam 01-BB
    Sam 01-CCC
    Sam 02-A
    Sam 02-BB
    Sam 02-CCC

Using Outer and Inner Sequences

Syntax for one client sample name using outer and inner sequences:

TEXT_##-&&,OuterStart, OuterIncrement, InnerStart, InnerIncrement, InnerCeiling, IsInnerResetEachUse

Syntax for multiple client sample names using outer and inner sequences:

{TEXT_##-&&,OuterStart, OuterIncrement, InnerStart, InnerIncrement, InnerCeiling, IsInnerResetEachUse}n
  1. A syntax with outer and inner sequences, where the outer sequence starts with 1 and increments by 1, and the inner sequence starts at 1 and increments by 1, up to 100 after which it is reset for the next outer loop (though it does not get there as only one output is required), for one output:
    SAMPLE _###-&&&, 1,1,1,1,100,T

    Result, outputs 1 client sample name:

    SAMPLE_001_001
  2. A syntax with outer and inner sequences, where the outer sequence starts with 1 and increments by 1, and the inner sequence starts at 1 and increments by 1, up to 100 after which it is reset for the next outer loop, for a specified number of outputs:
    { SAMPLE _###-&&&, 1,1,1,1,100,T}120

    Result, outputs 120 client sample names:

    SAMPLE_001-001
    SAMPLE_001-002
    SAMPLE_001-099
    SAMPLE_001-100
    SAMPLE_002-001
    SAMPLE_002-002
    SAMPLE_002-020

    The next use of this would be 001-001 because the inner sequence is reset upon use (T=true). If the inner sequence was not to be reset (F=false) then the next use of this would be 001-021.

Using a Text List

Syntax for one client sample name using a text list:

TEXT_##-!, start, increment,[STRING1, STRING2, STRING3,…]

Syntax for multiple client sample names using a text list:

{TEXT_##-!, start, increment,[STRING1, STRING2, STRING3,…]}n
  1. A syntax with outer sequence and a text list that contains three comma-separated strings, where the outer sequence starts at 1 and increments by 1, for a specified number of outputs:
    {SAMPLE_##-!,1,1,[A,B,C]}10

    Result, outputs 10 client sample names:

    SAMPLE_01-A
    SAMPLE_01-B
    SAMPLE_01-C
    SAMPLE_02-A
    SAMPLE_02-B
    SAMPLE_02-C
    SAMPLE_03-A
    SAMPLE_03-B
    SAMPLE_03-C
    SAMPLE_04-A