GenBank & FASTA Nucleotide Sequences (.gb, .gbk, .fasta, .fa)
@modelscript/genbank (languages/genbank) provides native WebAssembly GLR parsing, NCBI genetic code translation verification, 6-frame Open Reading Frame (ORF) discovery, restriction endonuclease digestion mapping, Codon Adaptation Index (DAEBuilder transcriptional/translational lowering, and SBOL3 / Modelica projections for NCBI GenBank and FASTA plasmid, viral, and genomic sequence files.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.gb, .gbk, .genbank | NCBI GenBank Flat File | Annotated nucleotide sequence record (LOCUS, DEFINITION, ACCESSION, FEATURES, ORIGIN, //) |
.fasta, .fa, .fna | FASTA Sequence | Multi-sequence nucleotide or peptide FASTA records (>header) |
Key Capabilities
1. Annotated Feature Tables & Location Operators
- Parses
LOCUStopology (linear/circular), molecular type (DNA,RNA,mRNA), andFEATURESannotations (CDS,promoter,RBS,terminator,gene,rep_origin,misc_feature) withcomplement(...),join(...), and/translationqualifiers.
2. Sequence Analysis, ORFs, Restriction Maps & CAI
- 6-Frame ORF Finder: Identifies start (
ATG,GTG,TTG) to stop (TAA,TAG,TGA) open reading frames across forward and reverse-complement strands. - Restriction Enzyme Mapper: Computes cleavage coordinates and fragment lengths for common Type II endonucleases (
EcoRI,BamHI,HindIII,NotI,XbaI,SpeI,PstI,BsaI). - GC Content, Melting Temperature (
) & CAI: Evaluates GC fraction, primer , and E. coli / mammalian codon usage bias.
3. SBOL3, Modelica & DAE Lowering
- Projects annotated
CDS,promoter,RBS, andterminatorfeatures into SBOL3 genetic circuit components (genbankToSbol), Modelica 3.x gene expression ODEs (genbankToModelica), and@modelscript/runtime'sDAEBuilder.
Pre-Flight Diagnostics
10 rules8 error2 warning
| Code | Rule | Severity | Message |
|---|---|---|---|
M9351 | locus-length-mismatch | error | LOCUS '<locus>' declares length '<declaredLength>' bp, but ORIGIN sequence has '<actualLength>' bp. |
M9352 | invalid-sequence-character | error | Sequence '<locus>' contains non-IUPAC character '<invalidChar>' at position '<position>'. |
M9353 | feature-location-out-of-bounds | error | Feature '<featureName>' location '[<start>..<end>]' is out of bounds for sequence '<locus>' of length '<seqLength>' bp. |
M9354 | cds-missing-start-codon | warning | Coding sequence (CDS) '<cdsName>' begins with '<actualCodon>' instead of a valid start codon ('ATG', 'GTG', or 'TTG'). |
M9355 | cds-missing-stop-codon | warning | Coding sequence (CDS) '<cdsName>' ends with '<actualCodon>' instead of a valid stop codon ('TAA', 'TAG', or 'TGA'). |
M9356 | cds-internal-premature-stop | error | Coding sequence (CDS) '<cdsName>' contains an internal premature stop codon '<stopCodon>' at codon '<codonIndex>'. |
M9357 | cds-translation-mismatch | error | Coding sequence (CDS) '<cdsName>' /translation qualifier '<actualTranslation>' does not match translated sequence '<expectedTranslation>'. |
M9358 | empty-genbank-origin | error | GenBank record '<locus>' has an empty or missing ORIGIN nucleotide sequence. |
M9359 | inverted-feature-span | error | Feature '<featureName>' in non-circular sequence '<locus>' has inverted span '[<start>..<end>]' ('start > end'). |
M9360 | duplicate-locus-identifier | error | LOCUS or FASTA identifier '<locus>' is declared multiple times in the document. |
Generated from languages/genbank/src/errors.ts. All languages →
CLI Usage
bash
# Validate LOCUS length consistency, CDS frame divisibility, and translations
msx lint pUC19_Plasmid.gb
# Parse and inspect GenBank or FASTA records
msx parse pUC19_Plasmid.gb
