moonbit-gffkit is a MoonBit toolkit for GFF3 and GTF genome annotation files. It parses annotation rows, keeps attributes queryable, builds a gene-transcript-exon model, and exports compact JSON or BED output for downstream scripts.
The project is intentionally small at the edges and solid in the middle: pure MoonBit library code, a native CLI, fixture-driven tests, and no runtime service requirement.
Features
Parse GFF3 and GTF records with checked coordinate validation.
Preserve GFF3 key=value attributes, flags, and common percent escapes.
Preserve GTF quoted attributes, including values with spaces.
Query features by type, attribute, and genomic interval.
Reference catalogs expose common feature terms, attributes, biotypes, validation rules, evidence labels, and sequence region labels.
Scope
The first release focuses on annotation text processing. It does not implement tabix indexing, BGZF compression, FASTA sequence extraction, or a genome browser. The public model is shaped so those pieces can be added later without replacing the parser.
Repository Notes
The repository is prepared for hackathon review with source files, tests, CI, license, examples, and submission notes. The current MoonBit source scale is about 5.4k lines including generated interface information. See docs/source-notes.md and docs/competition-checklist.md.
moonbit-gffkit
moonbit-gffkitis a MoonBit toolkit for GFF3 and GTF genome annotation files. It parses annotation rows, keeps attributes queryable, builds a gene-transcript-exon model, and exports compact JSON or BED output for downstream scripts.The project is intentionally small at the edges and solid in the middle: pure MoonBit library code, a native CLI, fixture-driven tests, and no runtime service requirement.
Features
key=valueattributes, flags, and common percent escapes.gene -> transcript -> exon/CDS/UTRhierarchies.gffkitCLI.Install
This repository targets the current MoonBit toolchain used during development:
Build and test:
CLI Usage
Example output:
Library Example
API Overview
parse_gff3(text)parses GFF3 text.parse_gtf(text)parses GTF text.parse_auto(text)detects GFF3/GTF from headers and attribute style.Annotation::filter_by_type(type)returns features of a type.Annotation::find_by_attribute(key, value)returns matching features.Annotation::overlapping(seqid=..., start=..., end=...)returns interval overlaps.Annotation::to_gene_models()builds gene-centric models.Annotation::to_bed()exports BED6.Annotation::to_json()exports stable JSON.Annotation::summary()returns count totals.Scope
The first release focuses on annotation text processing. It does not implement tabix indexing, BGZF compression, FASTA sequence extraction, or a genome browser. The public model is shaped so those pieces can be added later without replacing the parser.
Repository Notes
The repository is prepared for hackathon review with source files, tests, CI, license, examples, and submission notes. The current MoonBit source scale is about 5.4k lines including generated interface information. See
docs/source-notes.mdanddocs/competition-checklist.md.License
MIT.