mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 03:50:39 +00:00
⬆️ 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)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# `FormatHeader` Function Type in `obiformats`
|
||||
|
||||
The `obiformats` package defines a core functional interface for sequence formatting within the OBITools4 ecosystem.
|
||||
|
||||
- **Package**: `obiformats`
|
||||
Provides utilities for formatting biological sequences according to various output standards (e.g., FASTA, GenBank).
|
||||
|
||||
- **Type Definition**:
|
||||
```go
|
||||
type FormatHeader func(sequence *obiseq.BioSequence) string
|
||||
```
|
||||
- A `FormatHeader` is a *function type* that takes a pointer to an `obiseq.BioSequence` and returns its formatted header as a string.
|
||||
|
||||
- **Semantic Role**:
|
||||
Encapsulates the logic for generating *header lines* (e.g., `>id description`) in sequence file formats.
|
||||
Decouples header formatting from core data structures (`BioSequence`), enabling modular and reusable format adapters.
|
||||
|
||||
- **Usage Context**:
|
||||
- Used by writers/formatters to produce standardized headers when exporting sequences.
|
||||
- Allows custom header generation (e.g., for MIxS-compliant metadata, user-defined tags).
|
||||
- Supports polymorphism: different `FormatHeader` implementations can be swapped per output format.
|
||||
|
||||
- **Dependencies**:
|
||||
- Relies on `obiseq.BioSequence`, the core sequence data model (ID, description, annotations, etc.).
|
||||
|
||||
- **Design Intent**:
|
||||
Promotes clean separation of concerns: data (sequence) ↔ formatting logic.
|
||||
Facilitates extensibility for new output formats without modifying core types.
|
||||
Reference in New Issue
Block a user