Files
obitools4/autodoc/docmd/pkg/obiformats/fastqseq_write_generic.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.2 KiB

Semantic Description of obiformats Package

The obiformats package provides core formatting utilities for biological sequence data in standard FASTX formats (FASTA and FASTQ). It defines two functional types:

  • BioSequenceFormater: Converts a single biological sequence (*obiseq.BioSequence) into its string representation.
  • BioSequenceBatchFormater: Converts a batch of sequences (obiiter.BioSequenceBatch) into raw bytes, suitable for file or stream output.

Two main constructor functions enable flexible formatting:

  • BuildFastxSeqFormater(format, header) returns a sequence-level formatter based on the requested format ("fasta" or "fastq"), applying optional header metadata via FormatHeader.
  • BuildFastxFormater(format, header) builds a batch formatter by composing the sequence-level function over all sequences in an iterator-driven batch, concatenating results with newline separators.

The package supports extensibility and type safety through function composition while integrating logging (via logrus) for critical errors—e.g., unsupported formats trigger a fatal log. It abstracts away low-level I/O, focusing purely on semantic formatting logic, making it ideal for pipeline integration in NGS data processing tools.