← All examples
39

Canonical Grid model

HBB Reference — Check the Coding Frame

Check a versioned public HBB transcript against its annotated coding sequence and inspect how a different reading frame changes translation.

Scale
Small
Source
biology-hbb-reference.grid
Length
35 lines
Collection
Advanced language
Level
Intermediate
Runtime
Portable
Version
1.0.0
biology-hbb-reference.grid
Get Grid
MODEL "HBB Reference — Check the Coding Frame"
DESCRIPTION "Check a versioned public HBB transcript against its annotated coding sequence and inspect how a different reading frame changes translation."
VERSION "1.0.0"
AUTHOR "Grid Team"
TAGS "biology", "bioinformatics", "reference", "sequence"

# NCBI RefSeq NM_000518.5, retrieved 13 September 2026 for the retained study.
# GenBank CDS 51..494 is the zero-based half-open interval [50, 494).
input ReadingFrame = 1
  VALIDATE IN {1, 2, 3} MESSAGE "Choose reading frame 1, 2 or 3."

Transcript = "ACATTTGCTTCTGACACAACTGTGTTCACTAGCAACCTCAAACAGACACCATGGTGCATCTGACTCCTGAGGAGAAGTCTGCCGTTACTGCCCTGTGGGGCAAGGTGAACGTGGATGAAGTTGGTGGTGAGGCCCTGGGCAGGCTGCTGGTGGTCTACCCTTGGACCCAGAGGTTCTTTGAGTCCTTTGGGGATCTGTCCACTCCTGATGCTGTTATGGGCAACCCTAAGGTGAAGGCTCATGGCAAGAAAGTGCTCGGTGCCTTTAGTGATGGCCTGGCTCACCTGGACAACCTCAAGGGCACCTTTGCCACACTGAGTGAGCTGCACTGTGACAAGCTGCACGTGGATCCTGAGAACTTCAGGCTCCTGGGCAACGTGCTGGTCTGTGTGCTGGCCCATCACTTTGGCAAAGAATTCACCCCACCAGTGCAGGCTGCCTATCAGAAAGTGGTGGCTGGTGTGGCTAATGCCCTGGCCCACAAGTATCACTAAGCTCGCTTTCTTGCTGTCCAATTTCTATTAAAGGTTCCTTTGTTCCCTAAGTCCAACTACTAAACTGGGGGATATTATGAAGGGCCTTGAGCATCTGGATTCTGCCTAATAAAAAACATTTATTTTCATTGCAA"
CodingText = MID(Transcript, 51, 444)
CodingSequence = BIO_SEQUENCE(CodingText, "dna")

output Translation = BIO_TRANSLATE(CodingSequence, ReadingFrame, TRUE)
output Peptide = TEXTJOIN("", TRUE, MAP(Translation.amino_acids, (code) => CHAR(code)))
output ProteinLength = LEN(Peptide)
output TranscriptLength = LEN(Transcript)
output CodingLength = LEN(CodingText)
output CodingFastaToPaste = ">NM_000518.5_CDS HBB annotated coding sequence\n" & CodingText & "\n"
output ReferenceSource = "https://www.ncbi.nlm.nih.gov/nuccore/NM_000518.5"
output ReferenceAnswer = "Frame 1: transcript 628 bases, CDS 444 bases, peptide 147 residues including the initiator methionine; the peptide matches annotated NP_000509.1."
output Workflow = "Inspect Translation for peptide letters. In Sequence, paste CodingFastaToPaste as FASTA, import it and find ORFs. The imported artifact is separate from the inline ReadingFrame input. Save the baseline before changing the reading frame."
output Scenario = "Change ReadingFrame from 1 to 2: the first stop leaves 3 residues. This deliberately incorrect frame demonstrates sensitivity to annotation; it does not identify a biological isoform. Save and reopen to retain the chosen frame, or reset it to 1."
output Assumptions = "Versioned public reference, not patient data. Standard genetic code; stop at first in-frame stop. The CDS annotation defines the baseline. No variant or disease interpretation is inferred."

Sequence_1!type = "sequence"
Sequence_1!config = <toml>
  version = 1
  kind = "sequence"
  title = "Inspect the public HBB coding sequence"
</toml>

END MODEL