QSSC - Quantify Using Stored Standard Curve
Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: QSSC rule for calculating quantity values from CT using stored standard curve parameters Domain: RULES-QSSC
Statement
The system shall calculate quantity values from Cycle Threshold (CT) measurements using stored standard curve slope and intercept parameters retrieved from the database.
The rule supports three processing paths: resolution code bypass for direct status assignment, normal quantity calculation using the exponential formula, and error handling when configuration is missing. When a QSSC resolution code is present, it takes precedence and bypasses calculation entirely.
Quick Reference
| ID | Core Behavior | Priority | Status |
|---|---|---|---|
| REQ-RULES-QSSC-001 | Assigns LIMS status from resolution code, bypassing calculation | HIGH | Draft |
| REQ-RULES-QSSC-002 | Calculates quantity using exponential formula with stored slope/intercept | HIGH | Draft |
| REQ-RULES-QSSC-003 | Sets QUANT_STANDARDS_MISSING error when configuration is absent | HIGH | Draft |
Key Integration Points: Well/Observation data (CT values), Calculated Quantification Settings, Resolution Code Configuration
Rule Summary
| Property | Value |
|---|---|
| Name | QSSC |
| Triggers | When observation requires quantity calculation from CT |
| Output | Sets quantity on observation, or LIMS status, or error code |
Rule Flowchart (Illustrative)
This diagram illustrates the three processing paths. It does not specify UI layout, configuration interfaces, or implementation details.
Definitions
| Term | Definition |
|---|---|
| CT (Cycle Threshold) | The PCR cycle number at which fluorescence crosses a threshold; lower CT indicates higher initial quantity |
| Standard Curve | A mathematical relationship (slope/intercept) derived from known standards, used to calculate unknown quantities |
| Calculated Quantification Settings | Stored database configuration containing slope and intercept values per target for quantity calculation |
| Resolution Code | A workflow status code that can override normal rule processing and directly assign LIMS status |
| Quantity Multiplier | A well-level scaling factor applied to calculated quantities |
| LIMS Status | Laboratory Information Management System status assigned to wells/observations |
Assumptions
- Calculated Quantification Settings are pre-configured in the database before QSSC rule execution
- Resolution Code configurations are established by system administrators
- CT values provided to the rule have full decimal precision (not pre-rounded)
- The exponential formula is the authoritative calculation method (supersedes earlier linear formulas)
Requirements
Resolution Code Handling (REQ-RULES-QSSC-001)
FR-QSSC-001: Execute QSSC Rule with Resolution Code Status Assignment
The system shall set the LIMS status from resolution code configuration when the QSSC resolution code is present on a well, bypassing quantity calculation.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | Well resolution codes | Well record |
| Input | Resolution code configuration | System configuration |
| Output | LIMS status | Well record |
Acceptance Criteria
Resolution Code Detection:
- Check if the well's resolution codes contain QSSC
- When QSSC resolution code is present, look up the corresponding LIMS status from the resolution code configuration
Status Assignment:
- Apply the configured LIMS status to the well
- No quantification calculation shall be performed when resolution code handling applies
- No error shall be set on the well when LIMS status is successfully assigned
Error Handling
- Resolution code present but no configuration: System behavior undefined (configuration assumed valid)
Trace: Source: 3.0.0-Qssc Rule - multiply calculated quantity by quantity multiplier (Row 1) | Jira: BT-3899 | Tests: See scenarios
Quantity Calculation (REQ-RULES-QSSC-002)
FR-QSSC-002: Calculate Quantity Using Stored Standard Curve Settings
The system shall calculate the quantity for an observation using the exponential formula with slope, intercept from Calculated Quantification Settings, and the accurate (non-rounded) CT value.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | Observation CT value (full precision) | Observation record |
| Input | Target identifier | Observation record |
| Input | Slope, intercept | Calculated Quantification Settings |
| Input | Quantity multiplier | Well record |
| Output | Calculated quantity | Observation record |
Acceptance Criteria
Parameter Retrieval:
- Retrieve slope and intercept from Calculated Quantification Settings for the matching target
Calculation Formula:
- Apply the formula:
quantity = multiplier * pow(10, ((ct - intercept) / slope)) - Use the accurate CT value (not rounded) for calculation
- Apply the well's quantity multiplier to the result
- Use base-10 logarithmic relationship standard in PCR quantification
Precision Requirements:
- Preserve full decimal accuracy of CT values throughout calculation
- The exponential formula is the authoritative calculation method, superseding earlier linear formulas
Validation Examples:
| CT Value | Slope | Intercept | Multiplier | Expected Quantity |
|---|---|---|---|---|
| 28.1235 | -1 | 30 | 1 | 75.248873017358 |
| 28.12345678 | -1 | 30 | 1 | 75.256361986851 |
Error Handling
- Missing quantification settings: Handled by REQ-RULES-QSSC-003
- Invalid CT value: Not specified (assumed valid input)
Trace: Source: 3.0.0-QSSC Rule (Row 1, 2); 3.0.0-Qssc Rule - multiply calculated quantity by quantity multiplier (Row 2); 3.0.0-Qssc Rule - Revert Invalid Requirement or Quantity Calculation (Row 1); 3.0.0-Use accurate CT for Quantity Calculation (Row 1) | Jira: BT-3899, BT-4001, BT-5076 | Tests: See scenarios
Error Handling (REQ-RULES-QSSC-003)
FR-QSSC-003: Set Error When Quantification Standards Are Missing
The system shall set the QUANT_STANDARDS_MISSING error on the well when no matching Calculated Quantification Setting exists for the observation's target.
Inputs/Outputs
| Direction | Data | Source/Target |
|---|---|---|
| Input | Observation target | Observation record |
| Input | Calculated Quantification Settings | Database |
| Output | Error code (QUANT_STANDARDS_MISSING) | Well record |
Acceptance Criteria
Configuration Validation:
- Verify that a Calculated Quantification Setting exists for the observation's target before calculation
- If no matching setting is found, set error code QUANT_STANDARDS_MISSING on the well
Processing Behavior:
- No quantity calculation shall be attempted when configuration is missing
- The error shall be retrievable from the well for downstream processing
Error Handling
- No Calculated Quantification Setting for target: Set QUANT_STANDARDS_MISSING error code on the well
Trace: Source: 3.0.0-Qssc Rule - multiply calculated quantity by quantity multiplier (Row 2, error case) | Jira: [Not specified] | Tests: See scenarios
Configuration Options
| Option | Default | Description | Affects |
|---|---|---|---|
QSSC resolution code | QSSC | Resolution code identifier that triggers status assignment | REQ-RULES-QSSC-001 |
QUANT_STANDARDS_MISSING error code | System-defined | Error code for missing quantification settings | REQ-RULES-QSSC-003 |
UI Notes (Illustrative)
Quantity Multiplier Configuration
The quantity multiplier feature supports per-well scaling of calculated quantities. The configuration interface is documented in the SDD.
Reference: BT-3893 - Nottingham custom quantity multiplier
Implementation (Illustrative)
| Component | Location |
|---|---|
| Rule Class | Analyzer/Rules/QsscRule.php |
| Quantity Calculator | Analyzer/Rules/Concerns/CalculateQuantityUsingQuantificationSettings.php |
| Error Setter | Analyzer/Rules/Concerns/SetErrorToWell.php |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULES-QSSC-001 | Resolution Code Status Assignment | Test | QsscRule | tests-REQ-RULES-QSSC-001 | Draft |
| REQ-RULES-QSSC-002 | Quantity Calculation | Test | QsscRule | tests-REQ-RULES-QSSC-002, BT-5077 | Draft |
| REQ-RULES-QSSC-003 | Missing Standards Error | Test | QsscRule | tests-REQ-RULES-QSSC-003 | Draft |
Notes
- The exponential formula was introduced in BT-4001 to correct an invalid calculation that used a linear model
- CT precision requirement was introduced in BT-5076 to prevent rounding errors affecting quantity accuracy
- Resolution code handling takes precedence over quantity calculation - this supports direct status assignment workflows
- The QUANT_STANDARDS_MISSING error code is standardized for consistent error handling across the analytical rules engine
Open Questions
No open questions identified.
Acceptance Tests
Test: REQ-RULES-QSSC-001
Test: LIMS status assignment from resolution code
Given: Resolution Code configuration with resolution_code=QSSC, lims_status=DETECTED
And: Well with resolution_codes containing QSSC
When: QSSC rule is executed
Then: Well has DETECTED lims status
And: Well has no error
Test: REQ-RULES-QSSC-002
Test: Quantity calculation with multiplier
Given: Target A with Calculated Quantification Setting (slope=0.123, intercept=0.234)
And: Well with quantity_multiplier=100
And: Observation with final_ct=36, target=Target A
When: QSSC rule is executed for Observation
Then: Quantity of observation is 466
Test: Exponential formula verification
Given: Calculated Quantification Setting for Target A (slope=-1, intercept=30)
And: Well with quantity_multiplier=1
And: Observation with target=Target A, ct=40
When: Observation is processed through QSSC rule
Then: Observation quantity = 0.0000000001
Test: CT precision - Case 1
Given: Well with intercept=30, slope=-1, quantity_multiplier=1
When: ct=28.1235
Then: quantity=75.248873017358
Test: CT precision - Case 2
Given: Well with intercept=30, slope=-1, quantity_multiplier=1
When: ct=28.12345678
Then: quantity=75.256361986851
Test: REQ-RULES-QSSC-003
Test: Missing configuration error
Given: Error Code configuration with error_code=QUANT_STANDARDS_MISSING
And: Target A
And: Well with Observation (target=Target A)
And: No Calculated Quantification Setting for Target A
When: QSSC rule is executed
Then: Well has QUANT_STANDARDS_MISSING error
Related Design Documents
| Design Document | Relevant Sections |
|---|---|
| SDD Algorithms | Quantification Algorithms |
Appendix: Process Artifacts
Completion Checklist
- All requirements are capability-level (describe behavior, not UI)
- Requirement variants consolidated (no requirement explosion) - N/A, requirements are distinct
- UI details are fully demoted to Illustrative section
- Configuration options are not encoded as requirements
- Acceptance criteria describe behavior, not UI mechanics
- Every requirement has acceptance criteria and source traceability
- Error handling addressed for I/O, validation, and external system requirements
- Open questions documented with owners assigned - No open questions identified
- Consolidations documented in Reviewer Notes with reversibility info
- Module can survive a full UI redesign unchanged
- Refinements do not introduce new capabilities
- Traceability matrix is complete
Reviewer Notes
Conservative Preservation: QSSC Rule Requirements
The three source requirements represent distinct, non-overlapping capabilities and were preserved without consolidation:
| Original ID | Capability | Disposition |
|---|---|---|
| REQ-RULES-QSSC-001 | Resolution code status assignment | Preserved as REQ-RULES-QSSC-001 |
| REQ-RULES-QSSC-002 | Quantity calculation formula | Preserved as REQ-RULES-QSSC-002 |
| REQ-RULES-QSSC-003 | Missing configuration error handling | Preserved as REQ-RULES-QSSC-003 |
Rationale: These requirements represent three distinct processing paths in the QSSC rule:
- Resolution code bypass (status assignment without calculation)
- Normal calculation flow (exponential formula)
- Error path (missing configuration)
Each is independently testable and represents different system responsibilities. Consolidation would reduce traceability and obscure the distinct error handling path.
CT Precision Test Criteria: AC-05 and AC-06 of REQ-RULES-QSSC-002 contain specific numeric validation criteria. These are preserved as acceptance criteria (not demoted to refinements) because they define the precision boundary that distinguishes correct from incorrect implementation.
Reversibility: Source file: output/srs/rules/rule-qssc.md