Compute Replicate Average

The Clarity LIMS NGS Extensions Package v5.14 includes the computeReplicateAverage script, which automates calculation of replicate (referred to as derivatives in the LIMS) average values. The script can also optionally calculate standard deviation and %CV values.

This section provides details on the script, its parameters, and LIMS configuration requirements.

Script Overview

The computeReplicateAverage script uses data stored in a source UDF / custom field (specified by the src parameter) to calculate the average across replicates, and writes the resulting value to a destination UDF / custom field (specified by the dest parameter).

  • The script assumes the step has input analytes / derived samples with replicated per-input results / measurements.

  • The script groups the per-input results / measurements by their parent analyte / derived sample.

  • For each group, the script calculates the average of the result UDFs / measurement custom fields specified by the src parameter, ignoring any results that:

    • Are missing src values, or

    • Have an exclude field set to true

  • The resulting averages are written back into the parent analyte / derived sample field specified by the dest parameter for each group.

  • The exclude parameter is optional and no exclusions are performed if it is missing.

The script can also be used to calculate standard deviation and %CV values and add these results back to the corresponding UDF / field in the parent analyte / derived sample. The names of the Standard Deviation and %CV UDFs must be given to the script for it to update the values.

Script Parameters

Parameter

Description

-u {username} -username {username}

(Required) LIMS login username

-p {password} -password {password}

(Required) LIMS login password

-i {stepURI:v2} -stepURI {stepURI:v2}

(Required) LIMS step URI

-log {logFileLIMSID} -logFileName {logFileLIMSID}

(Required) LIMS ID of the log file placeholder

-src <srcUDF> -srcUDF <srcUDF>

(Required) Source UDF / custom field name

-dest <destUDF> -destUDF <destUDF>

(Required) Destination UDF / custom field name

-exclude <excludeUDF> -excludeUDF <excludeUDF>

(Optional) Exclude UDF / custom field name

-sd <sdUDF> -stdDevUDF <sdUDF>

(Optional) Standard deviation UDF / custom field name

-cv <cvUDF> -cvUDF <cvUDF>

(Optional) %CV UDF / custom field name

Command Line Example

When working with the computeReplicateAverage script, the automation command line must be constructed as follows:

bash -l -c "/opt/gls/clarity/bin/java -jar \
/opt/gls/clarity/extensions/ngs-common/v5/EPP/ngs-extensions.jar \
-i {stepURI:v2} \
-u {username} \
-p {password} \
script:computeReplicateAverage \
-src '' \
-dest '' \
-exclude ''
-log {}"
Example 1
script:computeReplicateAverage \
-src 'Concentration' \
-dest 'Avg Concentration' \
-exclude 'Ignore' \
-log {compoundOutputFileLuid0}"

In this example, the script will:

  1. Average the values captured in the replicate Concentration fields. Replicates whose Ignore field value is set to True will be excluded from the calculation.

  2. Copy the result to the Avg Concentration field configured on the parent derived sample.

Example 2
script:computeReplicateAverage \
-src 'Concentration' \
-dest 'Avg Concentration' \
-sd 'Std Dev' \
-cv '%CV' \
-exclude 'Ignore' \
-log {compoundOutputFileLuid0}"

In this example, the script will:

  1. Average the values captured in the replicate Concentration fields. Replicates whose Ignore field value is set to True will be excluded from the calculation.

  2. Copy the replicate average result to the Avg Concentration field configured on the parent derived sample.

  3. Calculate standard deviation and %CV values.

  4. Copy the standard deviation and %CV results to the Std Dev and %CV fields configured on the parent derived sample.

Example 3
script:computeReplicateAverage \
-src 'Raw CP' \
-dest 'Raw CP' \
-log {compoundOutputFileLuid0}"

In this example, the script will:

  1. Average the values captured in the replicate Raw CP fields. No replicates will be excluded from the calculation.

  2. Copy the result to the Raw CP field configured on the parent derived sample. No values will be ignored.

Configuration

The inputs to the step must have values for the analyte UDF / derived sample custom field to be used as the source field. There must be an additional analyte UDF / derived sample custom field configured as the destination field - to capture the calculated replicate average. Both field types must be Numeric.

The following table provides example field configuration details.The field names used correspond to those used in the command line Example 1 shown above.

Configured on ResultFile in LIMS v4.2.x and Measurement in LIMS v5.x & later

Field Name

Field Type

Field Constraints / Options

Preset Values / Additional Options

Concentration In example 1, this is the field specified by the -src parameter

Numeric

  • Required: Yes

  • Read Only: No

Decimal Places Displayed: 2

Ignore In example 1, this is the field specified by the -exclude parameter

  • Boolean (v4.2.x)

  • Toggle Switch (v5.x)

  • Required: No

  • Read Only: No

Default: None Set

Configured on Analyte in LIMS v4.2.x and Derived Sample in LIMS v5.x & later

Field Name

Field Type

Field Constraints / Options

Preset Values / Additional Options

Avg Concentration In example 1, this is the field specified by the -dest parameter

Numeric

Required: Yes Read Only: No

Decimal Places Displayed: 2

Last updated