MoonBit GenBank/INSDC flat-file parser for small bioinformatics tools, teaching
examples, and data-conversion pipelines.
The library focuses on annotated sequence records rather than broad
bioinformatics algorithms. It parses LOCUS metadata, FEATURES entries, ORIGIN
sequence text, common feature locations, qualifiers, CDS translation checks, and
compact JSON export.
Why this project
MoonBit already has early bioinformatics ecosystem work, but GenBank flat-file
annotation parsing is still a useful standalone building block. Keeping this
package focused makes it suitable for:
validating small submitted sequence records
querying genes and CDS annotations in teaching examples
converting GenBank snippets to JSON for web or CLI tools
extending toward INSDC feature-table edge cases over time
This repository is developed as an original MoonBit OSC2026 project. No source
code is copied from existing GenBank parsers.
Features
LOCUS parsing: record name, length, molecule type, topology, division, date
FEATURES parsing: feature key, location expression, slash qualifiers
Location support: point ranges, start..end, join(...), complement(...),
partial markers such as <1..>90
ORIGIN cleanup: sequence lines are normalized to uppercase bases
Generated public interfaces are committed in pkg.generated.mbti.
Scope
Implemented:
single-record GenBank flat files
multi-record streams separated by //
common feature-table qualifiers
multi-line qualifier values
simple range, join, and complement locations
standard genetic code translation
Planned extension points:
multi-record streams
fuzzy locations and remote accessions
richer feature-table normalization
selectable genetic codes
file-reading CLI once native toolchain setup is available in common
development environments
Validation
The CI workflow installs the latest MoonBit toolchain and runs on Linux, macOS,
and Windows:
moon fmt followed by git diff --exit-code
moon info followed by git diff --exit-code
moon check --target all --deny-warn
moon test --target all --deny-warn
Locally, this repository was checked with:
moon check --deny-warn
moon test --deny-warn
moon info
The current local Windows environment has no system C compiler, so native
--target all execution is delegated to CI, where gcc is installed explicitly.
License
Apache-2.0.
关于
MoonBit GenBank/INSDC annotation parser with feature queries, CDS validation, JSON export, and CI
moonbit-genbank
MoonBit GenBank/INSDC flat-file parser for small bioinformatics tools, teaching examples, and data-conversion pipelines.
The library focuses on annotated sequence records rather than broad bioinformatics algorithms. It parses LOCUS metadata, FEATURES entries, ORIGIN sequence text, common feature locations, qualifiers, CDS translation checks, and compact JSON export.
Why this project
MoonBit already has early bioinformatics ecosystem work, but GenBank flat-file annotation parsing is still a useful standalone building block. Keeping this package focused makes it suitable for:
This repository is developed as an original MoonBit OSC2026 project. No source code is copied from existing GenBank parsers.
Features
start..end,join(...),complement(...), partial markers such as<1..>90/translation--jsonQuick Start
Library Example
API Surface
The main package exposes:
parse_record(text) -> Record raise GenBankErrorparse_records(text) -> Array[Record] raise GenBankErrorparse_locus(line) -> Locus raise GenBankErrorparse_location(text) -> Location raise GenBankErrorGenBankError::messageRecord::features_by_keyRecord::features_with_qualifierFeature::qualifierFeature::overlapsRecord::sequence_forRecord::check_cds_translationsRecord::sequence_statsRecord::to_json_stringtranslate_dnareverse_complementGenerated public interfaces are committed in
pkg.generated.mbti.Scope
Implemented:
//Planned extension points:
Validation
The CI workflow installs the latest MoonBit toolchain and runs on Linux, macOS, and Windows:
moon fmtfollowed bygit diff --exit-codemoon infofollowed bygit diff --exit-codemoon check --target all --deny-warnmoon test --target all --deny-warnLocally, this repository was checked with:
The current local Windows environment has no system C compiler, so native
--target allexecution is delegated to CI, where gcc is installed explicitly.License
Apache-2.0.