Files
obitools4/autodoc/docmd/pkg/obiseq/eval.md
T
Eric Coissac 8c7017a99d ⬆️ version bump to v4.5
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5"
- Update version.txt from 4.29 → .30
(automated by Makefile)
2026-04-13 13:34:53 +02:00

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 full BioSequence object itself.
  • EditIdWorker(expression string):
    A sequence worker that updates the ID of a BioSequence by evaluating the expression.

    • On success: sets sequence.Id() to string representation of result.
    • On failure: logs and returns an error with context.
  • EditAttributeWorker(key string, expression string):
    A sequence worker that sets a custom attribute (identified by key) 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.