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.5 KiB
1.5 KiB
Semantic Description of obiseq Expression-Based Workers
This module provides expression-driven transformation workers for biological sequence objects (BioSequence). It leverages a custom expression language (via OBILang) to dynamically compute values based on sequence metadata and content.
Core Components
-
Expression(expression string):
Returns a function that evaluates the given expression in context. The evaluation scope includes:annotations: sequence annotations (metadata).sequence: the fullBioSequenceobject itself.
-
EditIdWorker(expression string):
A sequence worker that updates the ID of aBioSequenceby evaluating the expression.- On success: sets
sequence.Id()to string representation of result. - On failure: logs and returns an error with context.
- On success: sets
-
EditAttributeWorker(key string, expression string):
A sequence worker that sets a custom attribute (identified bykey) on the sequence, using evaluated expression result.- Supports arbitrary metadata enrichment.
- Errors are reported with sequence ID and failed expression.
Use Cases
- Generate new IDs from annotation fields (e.g.,
"gene_" + annotations["locus_tag"]). - Compute and store derived attributes (e.g., GC content, ORF length) as sequence metadata.
- Apply conditional logic or transformations across large sets of sequences in pipelines.
All workers conform to the SeqWorker interface, enabling composition and chaining.