FA-12531 / Biological sequence representation / Open access
DNA and RNA normalization silently changes molecule type · case 01
DNA and RNA normalization silently changes molecule type.
ROOT CAUSE
Unconditional U-to-T substitution accepts RNA symbols in DNA input.
VERIFIED REPAIR
Implement the stated sequence contract while preserving its positional and symbol semantics.
Unsuccessful approach: Uppercasing without validating allows mixed alphabets.
Case contract
Return uppercase input if every symbol belongs to ACGTN for type DNA or ACGUN for type RNA; otherwise None. Type is DNA or RNA. No cross-type conversion.
Why this case matters
An offline abstract sequence-data model; useful for testing representation invariants without biological inference.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s,kind):
return s.upper().replace('U','T')
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable mixed DNA', solve('a'*N+'u','DNA'), None)
check('RNA U', solve('acu','RNA'), 'ACU')
check('RNA T rejected', solve('ACT','RNA'), None)
check('DNA valid', solve('actn','DNA'), 'ACTN')
check('empty', solve('','DNA'), '')
check('invalid', solve('AX','RNA'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable mixed DNA | AT | None | Failed |
| RNA U | ACT | ACU | Failed |
| RNA T rejected | ACT | None | Failed |
| DNA valid | ACTN | ACTN | Passed |
| empty | | | Passed |
| invalid | AX | None | Failed |
SHA-256 / 11644dc5fc20d675bf193ddb3c3c537293e60ec1cb293f1526e2afb6f66a7efc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s,kind):
return s.upper()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable mixed DNA', solve('a'*N+'u','DNA'), None)
check('RNA U', solve('acu','RNA'), 'ACU')
check('RNA T rejected', solve('ACT','RNA'), None)
check('DNA valid', solve('actn','DNA'), 'ACTN')
check('empty', solve('','DNA'), '')
check('invalid', solve('AX','RNA'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable mixed DNA | AU | None | Failed |
| RNA U | ACU | ACU | Passed |
| RNA T rejected | ACT | None | Failed |
| DNA valid | ACTN | ACTN | Passed |
| empty | | | Passed |
| invalid | AX | None | Failed |
SHA-256 / 4938b782963449f83160f2267f200179b646a5e7dff8770f47311974739fc98c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s,kind):
s=s.upper()
allowed='ACGTN' if kind=='DNA' else 'ACGUN'
return s if all(c in allowed for c in s) else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable mixed DNA', solve('a'*N+'u','DNA'), None)
check('RNA U', solve('acu','RNA'), 'ACU')
check('RNA T rejected', solve('ACT','RNA'), None)
check('DNA valid', solve('actn','DNA'), 'ACTN')
check('empty', solve('','DNA'), '')
check('invalid', solve('AX','RNA'), None)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable mixed DNA | None | None | Passed |
| RNA U | ACU | ACU | Passed |
| RNA T rejected | None | None | Passed |
| DNA valid | ACTN | ACTN | Passed |
| empty | | | Passed |
| invalid | None | None | Passed |
SHA-256 / 3c4ab799dfd09f6476734d403bbacfd4ed4d8186024dca744655fa877be7d0e2
Verification & scope
Synthetic strings and explicit policies only; no biological interpretation or laboratory workflow. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:57.752152+00:00.
Case digest / dc2c74846ff719ca9613cd95a658e0cf8cab3848798cc239e8bf2548f2052f95