Negative Sigmoid Control Rule
Version: v3.0.0 Status: Normative (text), Illustrative (diagrams only) Scope: NEGATIVE_SIGMOID_CONTROL rule for validating sigmoid curve patterns in negative control wells Domain: RULES-NEGSIGMOIDCTRL Precedence: After well classification
Statement
The system shall detect and flag control wells that exhibit an upward sigmoid amplification pattern but have a negative final classification, indicating a potential quality issue requiring investigation.
The rule applies only to control wells (not patient wells) and can be bypassed via resolution codes or manual classification overrides. When triggered, the rule assigns error codes at both well and target levels, which are displayed in the Assay Summary report grouped by mix and target.
Quick Reference
| ID | Core Behavior | Priority | Status |
|---|---|---|---|
| REQ-RULES-NEGSIGMOIDCTRL-001 | Detects upward sigmoid + negative classification and assigns error codes | HIGH | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-002 | Excludes patient wells from rule execution | HIGH | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-003 | Skips rule when bypassed by resolution code | HIGH | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-004 | Skips rule when manual classification exists | HIGH | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-005 | Displays errors in Assay Summary by mix/target | MEDIUM | Draft |
Key Integration Points: Well data processing, Resolution code system, Manual classification, Assay Summary
Rule Summary
| Property | Value |
|---|---|
| Name | NEGATIVE_SIGMOID_CONTROL |
| Triggers | Upward sigmoid pattern + negative classification on control wells |
| Output | Well error INCORRECT_NEGATIVE_SIGMOID, Target error INCORRECT_NEGATIVE_SIGMOID_TARGET |
Rule Flowchart (Illustrative)
This diagram illustrates the rule execution flow. It does not specify UI layout, styling, or interaction details.
Definitions
| Term | Definition |
|---|---|
| Sigmoid Pattern | The shape of the amplification curve over time (upward or downward) |
| Upward Sigmoid | Amplification curve that increases over time; typical of positive wells |
| Downward Sigmoid | Amplification curve that decreases over time; expected for negative wells |
| Final Classification | The system-determined classification of a well (Positive or Negative) after automated analysis |
| Manual Classification | A user-assigned classification that overrides automated classification |
| Resolution Code | A code applied to a well to acknowledge and bypass specific validation rules |
| Control Well | A well used for quality control purposes (non-patient) |
| Patient Well | A well containing patient sample material |
Assumptions
- Wells have been processed and have a final classification assigned before rule execution
- Sigmoid pattern analysis has been performed and pattern type (upward/downward) is available
- Well type (Patient, Control) has been determined
- Resolution codes and manual classifications, if present, are available for evaluation
Requirements
Core Validation (REQ-RULES-NEGSIGMOIDCTRL-001)
FR-NEGSIGMOIDCTRL-001: Detect Invalid Upward Sigmoid Patterns in Negative Wells
The system shall detect and flag control wells where the amplification curve exhibits an upward sigmoid pattern but the final classification is negative.
Acceptance Criteria
Detection Logic:
- Given a control well has an upward sigmoid reading pattern AND a negative final classification, the system shall assign error code
INCORRECT_NEGATIVE_SIGMOIDto the well - Given a control well has an upward sigmoid reading pattern AND a negative final classification, the system shall assign error code
INCORRECT_NEGATIVE_SIGMOID_TARGETto the associated target - When the rule triggers, the system shall assign both well-level and target-level error codes simultaneously
- The system shall trigger the rule only on the specific combination of upward sigmoid pattern AND negative classification
Non-Triggering Conditions:
- Given a control well has an upward sigmoid reading pattern AND a positive final classification, the system shall NOT assign any error code
- Given a control well has a downward sigmoid reading pattern AND a negative final classification, the system shall NOT assign any error code
- Given a control well has a downward sigmoid reading pattern AND a positive final classification, the system shall NOT assign any error code
- The system shall NOT trigger the rule for downward sigmoid patterns regardless of classification
Error Handling
- No sigmoid pattern available: do not execute rule (precondition not met)
- No classification available: do not execute rule (precondition not met)
Trace: Source: 3.0.0-Negative Sigmoid Control Rule (Row 1) | Jira: BT-5014 | X-ray: BT-5045 | Epic: BT-5015 | Tests: See scenarios
Well Type Exclusions (REQ-RULES-NEGSIGMOIDCTRL-002)
FR-NEGSIGMOIDCTRL-002: Exclude Patient Wells from Rule Execution
The system shall not execute the Negative Sigmoid Control rule for wells designated as Patient well type.
Acceptance Criteria
Patient Well Exclusion:
- Given a well with upward sigmoid readings and negative final classification, when the well type is Patient, the system shall NOT assign the
INCORRECT_NEGATIVE_SIGMOIDerror code - Given a well with upward sigmoid readings and negative final classification, when the well type is Patient, the system shall NOT assign the
INCORRECT_NEGATIVE_SIGMOID_TARGETerror code
Trace: Source: 3.0.0-Negative Sigmoid Control Rule (Row 2) | Jira: [Pending] | Tests: See scenarios
Rule Bypass Mechanisms (REQ-RULES-NEGSIGMOIDCTRL-003 & 004)
FR-NEGSIGMOIDCTRL-003: Skip Rule Execution When Bypassed by Resolution Code
The system shall not execute the Negative Sigmoid Control rule when the well has an active resolution code of NEGATIVE_SIGMOID_CONTROL.
Acceptance Criteria
Resolution Code Bypass:
- Given a well with upward sigmoid readings and negative final classification, when the well has resolution code
NEGATIVE_SIGMOID_CONTROLapplied, the system shall NOT assign theINCORRECT_NEGATIVE_SIGMOIDerror code - Given a well with upward sigmoid readings and negative final classification, when the well has resolution code
NEGATIVE_SIGMOID_CONTROLapplied, the system shall NOT assign theINCORRECT_NEGATIVE_SIGMOID_TARGETerror code
Trace: Source: 3.0.0-Negative Sigmoid Control Rule (Row 3) | Jira: [Pending] | Tests: See scenarios
FR-NEGSIGMOIDCTRL-004: Skip Rule Execution When Manual Classification Exists
The system shall not execute the Negative Sigmoid Control rule when the well has a manual classification assigned.
Acceptance Criteria
Manual Classification Bypass:
- Given a well with upward sigmoid readings and negative final classification, when the well has a manual classification assigned, the system shall NOT assign the
INCORRECT_NEGATIVE_SIGMOIDerror code - Given a well with upward sigmoid readings and negative final classification, when the well has a manual classification assigned, the system shall NOT assign the
INCORRECT_NEGATIVE_SIGMOID_TARGETerror code - The system shall bypass the rule when a manual classification of any value (positive or negative) is assigned
Trace: Source: 3.0.0-Negative Sigmoid Control Rule (Row 4) | Jira: [Pending] | Tests: See scenarios
Error Reporting (REQ-RULES-NEGSIGMOIDCTRL-005)
FR-NEGSIGMOIDCTRL-005: Display Negative Sigmoid Control Errors in Assay Summary
The system shall display Negative Sigmoid Control errors in the Assay Summary report, aggregated by mix and target.
Acceptance Criteria
Assay Summary Display:
- Given a control well has error code
INCORRECT_NEGATIVE_SIGMOIDfor a specific mix and target, the Assay Summary shall displayINCORRECT_NEGATIVE_SIGMOID_TARGETunder that mix and target combination - The error display shall be associated with the specific mix and target combination where the error occurred
Trace: Source: 3.0.0-Negative Sigmoid Control Rule (Row 5) | Jira: [Pending] | Tests: See scenarios
Configuration Options
| Option | Default | Description | Affects |
|---|---|---|---|
| Rule Name | NEGATIVE_SIGMOID_CONTROL | Programmatic identifier for the rule | All requirements |
| Resolution Code | NEGATIVE_SIGMOID_CONTROL | Code used to skip rule execution via resolutions | REQ-RULES-NEGSIGMOIDCTRL-003 |
UI Notes (Illustrative)
FR-NEGSIGMOIDCTRL-005 UI Specifications
Assay Summary Display:
- Errors are grouped by Mix (e.g., "Mix A")
- Within each mix, errors are displayed by Target (e.g., "Target A")
- The target-level error code (
INCORRECT_NEGATIVE_SIGMOID_TARGET) is displayed
Implementation (Illustrative)
| Component | Location |
|---|---|
| Rule Class | Analyzer/Rules/NegativeSigmoidControlRule.php |
| Sigmoid Identifier | Support/SigmoidIdentifier.php |
| Error Setter | Analyzer/Rules/Concerns/SetErrorToWell.php |
Traceability Matrix
| Requirement | Title | Verification | Implementation | Test Cases | Status |
|---|---|---|---|---|---|
| REQ-RULES-NEGSIGMOIDCTRL-001 | Detect Invalid Upward Sigmoid Patterns | Test | NegativeSigmoidControlRule | BT-5045 | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-002 | Exclude Patient Wells | Test | NegativeSigmoidControlRule | [Pending] | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-003 | Skip on Resolution Code | Test | NegativeSigmoidControlRule | [Pending] | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-004 | Skip on Manual Classification | Test | NegativeSigmoidControlRule | [Pending] | Draft |
| REQ-RULES-NEGSIGMOIDCTRL-005 | Display in Assay Summary | Test | NegativeSigmoidControlRule | [Pending] | Draft |
Notes
- This rule is part of the Sigmoid Rule Update epic (BT-5015), which separates sigmoid validation logic for positive and negative wells
- Related rule: Positive Sigmoid Control Rule (validates sigmoid patterns in positive wells)
- The rule execution order follows: Well Type check -> Manual Classification check -> Resolution Code check -> Classification check -> Sigmoid Pattern check
Known Issue: Source Documentation Contradiction (Row 2 Case 2)
The source documentation for Row 2 (Patient Well Exclusion) contains two test cases with contradictory expected results:
- Case 1: Patient well = NO ERROR (correct per requirement statement)
- Case 2: Patient well = ERROR (contradicts requirement statement)
Analysis: The requirement clearly states "does not execute for patient wells." Case 2 may be a documentation error, a counter-example, or an incomplete conditional scenario.
Resolution: Implementation follows the requirement statement. Patient wells shall not trigger errors. This is flagged for validation during testing.
Open Questions
| ID | Question | Source | Owner | Date Raised |
|---|---|---|---|---|
| OQ-001 | Row 2 Case 2 documentation contradiction - verify intended behavior for patient wells | Source Validation | @tbd | 2026-01-23 |
Acceptance Tests
Test: REQ-RULES-NEGSIGMOIDCTRL-001
Test: Upward sigmoid with negative classification triggers error
Given: A control well exists
And: The well has upward sigmoid readings
And: The well has negative final classification
When: The Negative Sigmoid Control rule executes
Then: The system shall assign error code INCORRECT_NEGATIVE_SIGMOID to the well
And: The system shall assign error code INCORRECT_NEGATIVE_SIGMOID_TARGET to the target
Test: Upward sigmoid with positive classification does not trigger error
Given: A control well exists
And: The well has upward sigmoid readings
And: The well has positive final classification
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign any error code
Test: Downward sigmoid with negative classification does not trigger error
Given: A control well exists
And: The well has downward sigmoid readings
And: The well has negative final classification
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign any error code
Test: Downward sigmoid with positive classification does not trigger error
Given: A control well exists
And: The well has downward sigmoid readings
And: The well has positive final classification
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign any error code
Test: REQ-RULES-NEGSIGMOIDCTRL-002
Test: Patient wells are excluded from rule execution
Given: A patient well exists
And: The well has upward sigmoid readings
And: The well has negative final classification
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID error code
And: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID_TARGET error code
Test: REQ-RULES-NEGSIGMOIDCTRL-003
Test: Resolution code bypasses rule execution
Given: A control well exists
And: The well has upward sigmoid readings
And: The well has negative final classification
And: The well has resolution code NEGATIVE_SIGMOID_CONTROL applied
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID error code
And: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID_TARGET error code
Test: REQ-RULES-NEGSIGMOIDCTRL-004
Test: Manual classification bypasses rule execution
Given: A control well exists
And: The well has upward sigmoid readings
And: The well has negative final classification
And: The well has a manual classification assigned
When: The Negative Sigmoid Control rule executes
Then: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID error code
And: The system shall NOT assign the INCORRECT_NEGATIVE_SIGMOID_TARGET error code
Test: REQ-RULES-NEGSIGMOIDCTRL-005
Test: Error displays in Assay Summary by mix and target
Given: A control well exists in Mix A
And: The well has error code INCORRECT_NEGATIVE_SIGMOID
And: The well has an observation with Target A
When: The user views the Assay Summary
Then: The Assay Summary shall display INCORRECT_NEGATIVE_SIGMOID_TARGET under Mix A, Target A
Related Design Documents
| Design Document | Relevant Sections |
|---|---|
| SDD Algorithms | Sigmoid Analysis Algorithm |
Appendix: Process Artifacts
Completion Checklist
- All requirements are capability-level (describe behavior, not UI)
- Requirement variants consolidated (no requirement explosion) - N/A: distinct behaviors preserved per RULES guidance
- 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 - N/A: rule does not involve I/O
- Open questions documented with owners assigned
- Consolidations documented in Reviewer Notes with reversibility info
- Module can survive a full UI redesign unchanged
- Refinements folded into acceptance criteria
- Traceability matrix is complete
- Statement section present
- Mermaid diagram present and marked as (Illustrative)
- No "non-normative" text (replaced with "Illustrative")
- Tests at end with back-links
Reviewer Notes
No Consolidation Required
The five requirements in this domain represent distinct, non-overlapping rule behaviors:
| Requirement | Behavior Type | Rationale for Preservation |
|---|---|---|
| REQ-RULES-NEGSIGMOIDCTRL-001 | Core detection logic | Primary rule behavior - independently testable |
| REQ-RULES-NEGSIGMOIDCTRL-002 | Exclusion condition | Distinct bypass condition (well type) |
| REQ-RULES-NEGSIGMOIDCTRL-003 | Bypass condition | Distinct bypass condition (resolution code) |
| REQ-RULES-NEGSIGMOIDCTRL-004 | Bypass condition | Distinct bypass condition (manual classification) |
| REQ-RULES-NEGSIGMOIDCTRL-005 | Reporting behavior | Distinct output/display behavior |
Rationale: Per RULES domain guidance, analytics rules require conservative consolidation to preserve test precision. Each requirement represents a separately testable rule behavior with distinct trigger conditions.
Reversibility: Source requirements preserved 1:1.
- Source:
output/pilot/rules/rule-negative-sigmoid-control/rule-negative-sigmoid-control-restructured.md - Original SRS:
output/srs/rules/rule-negative-sigmoid-control.md