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.6 KiB
1.6 KiB
ExtractTaxonomy Function — Semantic Description
The ExtractTaxonomy method is a core utility in the obiiter package, designed to aggregate taxonomic information across biological sequences processed by an iterator.
-
Input:
- A pointer to
IBioSequence, representing a sequence iterator over biological data. - A boolean flag
seqAsTaxa: if true, each full sequence is treated as a single taxonomic unit; otherwise, individual elements within slices are processed separately.
- A pointer to
-
Process:
- Iterates through all sequences via
iterator.Next()and retrieves each current slice usingGet().Slice(). - For every slice, it calls the underlying
.ExtractTaxonomy()method (fromobitax), progressively building or updating a shared*obitax.Taxonomyobject. - Stops and returns immediately upon encountering the first error during taxonomy extraction.
- Iterates through all sequences via
-
Output:
- Returns a fully populated
*obitax.Taxonomyobject (or partial result if early failure occurs). - Returns
nilerror on success; otherwise, returns the first encountered error.
- Returns a fully populated
-
Semantic Role:
Enables scalable taxonomic profiling of high-throughput sequencing data by delegating per-slice extraction logic to theobitaxmodule, while ensuring robust iteration and error handling. -
Dependencies:
Relies onobitax.Taxonomyfor structured taxonomic representation and assumes slices implement the.ExtractTaxonomy()interface.
This function exemplifies a map-reduce-style pattern: mapping taxonomy extraction over slices, and reducing results into a unified taxonomic summary.