Files
obitools4/autodoc/docmd/pkg/obitax/issuubcladeof.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

20 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Semantic Description of `obitax` Taxonomic Functions
The `obitax` package provides two core methods for hierarchical taxon relationship analysis:
- **`IsSubCladeOf(parent *Taxon) bool`**
Determines whether the current taxon is a **descendant** (i.e., subclade) of a given parent taxon.
- Ensures both taxa belong to the *same taxonomy*—fails with a fatal log if not.
- Traverses upward via `taxon.IPath()` (iterative ancestor path) to check if any node matches the parents ID.
- Returns `true` iff a match is found, indicating lineage descent.
- **`IsBelongingSubclades(clades *TaxonSet) bool`**
Checks whether the current taxon—or any of its **ancestors**—belongs to a specified set of clades (`TaxonSet`).
- Starts by testing direct membership via `clades.Contains(taxon.Node.id)`.
- Walks upward through the hierarchy (`taxon = taxon.Parent()`) until either:
- A match is found, or
- The root is reached.
- Final check at the root ensures completeness (e.g., if only root belongs).
Both functions support **robust phylogenetic queries**, enabling classification validation, filtering by clade membership, and hierarchical consistency checks in taxonomic trees.