mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 12:00:39 +00:00
8c7017a99d
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
1.7 KiB
1.7 KiB
obilua Package: Biosequence Lua Bindings
The obilua Go package provides Lua bindings for biological sequence objects (obiseq.BioSequence) used in the OBITools4 ecosystem. It enables scripting and automation of sequence analysis directly from Lua.
Core Functionality
- Type Registration: Registers a new userdata type
BioSequencein the Lua state, exposing methods and constructors. - Constructor:
BioSequence.new(id, sequence[, definition]) →BioSequence``` - Accessors & Mutators:
id(),sequence(),definition()– get/set identifiers and sequence data.qualities([table])– handle PHRED-quality scores (as Lua table or string).count(),taxid()– numeric abundance and taxonomic ID.
- Taxonomy Integration:
taxon([Taxon])– get/set taxonomic assignment via integrated taxonomy engine.
- Attributes:
attribute(name[, value])– arbitrary metadata storage (supports tables, strings, numbers).
- Sequence Operations:
len()– length of the sequence.has_sequence(),has_qualities()– boolean checks for presence of data.
- Computation & Transformation:
subsequence(start, end)– extract a region.reverse_complement()→ BioSequence.md5(),md5_string()– compute sequence checksums (raw bytes or hex string).
- Serialization:
fasta([format]),fastq([format])– output in FASTA/FASTQ, supporting"json"or"obi"header formats.string([format])– smart formatting: FASTQ if qualities present, else FASTA.
Implementation Notes
- Uses
gopher-luafor interpreter integration. - UserData wrapping ensures type safety and GC management of Go-backed objects.
- Error handling via Lua
ArgErrororRaiseError.