Linear Regression Calculation

Clarity LIMS NGS Extensions Package v5.17 and later includes computeLinearRegression script. This script calculates values for slope, intercept, and r-squared, and uses these values to populate corresponding fields. The field names are configurable via script parameters, and will differ depending on the LIMS integration.

In addition, the script requires values for y-axis and x-axis. These values are both related to control samples:

  • y-axis: This is configured as an analyte UDF / derived sample custom field on the control sample. The field name is configurable and is passed in as a script parameter.

  • x-axis: This is the control type's concentration (entered in the Conc. field). This is not configurable.

Script Parameters

The following table defines the parameters used by the computeLinearRegression script.

Command Line Example

Example
bash -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} \
-log {compoundOutputFileLuid0} \
script:computeLinearRegression \
-y 'Raw CP' \
-slope 'Slope' \
-ic 'Intercept' \
-rsq 'R-Squared' \
-logX 'true' \
-minData '4' \
-select '(Control Name 1)|(Control Name 2)'"

Configuration

This section describes the configuration required for the linear regression calculation.

Step UDFs /Custom Fields

Three step UDFs / custom fields must be configured on the master step / process type, to capture the linear regression slope, intercept, and r-squared values. These fields should display on the Record Details screen at run time.

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

Global Custom Fields / UDFs

The control samples in the step must have values for a specific derived sample custom field / analyte UDF.

The following table provides example configuration details for this field. The field name used corresponds to the name used in the command line example above.

The field is configured on Analyte in LIMS v4.2.x and Derived Sample in LIMS v5.x and later.

Rules and Constraints

  • Control samples used in the step must have valid concentration values:

    • Concentration must be a numeric value.

    • Optionally, the numeric concentration value can have text following it to specify the units, for example - 10.02 nM. Note that units are for display purposes only and are not factored into the calculation.

    • Concentration must be a value other than 0. Controls with 0 concentration value are ignored.

  • Slope, intercept, r-squared and -y (Raw CP in the example) field values must all be numeric.

  • There must be 4 or more control samples in the step that can be used in the calculation - i.e., after passing validation.

    • Number of control samples can be configured through -minData parameter.

  • Control samples must have:

    • A name that matches the pattern provided by the -select parameter (if provided).

    • A y-axis field filled in with a numeric value.

    • A concentration value filled in for their control type, with a non-zero numeric value.

    • If any of these conditions is not met, the control samples fail validation and are excluded from the calculation. These do not count towards the minimum number of control samples.

  • If -logX parameter is specified as 'true', the calculated log10(concentration) value is used as the x-axis value (see Script Parameters).

Last updated