Rename obifind obitaxonomy and introduce the new CSV format for taxonomy.

This commit is contained in:
Eric Coissac
2025-01-29 10:45:26 +01:00
parent c50a0f409d
commit 00f2dc2697
11 changed files with 4571 additions and 55 deletions

View File

@ -2,6 +2,7 @@ package obitax
import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
log "github.com/sirupsen/logrus"
)
// ITaxon represents an iterator for traversing Taxon instances.
@ -189,12 +190,12 @@ func (taxon *Taxon) ISubTaxonomy() *ITaxon {
go func() {
for i := lpath - 1; i >= 0; i-- {
taxon := path.Taxon(i)
parents[taxon.Node] = true
iter.Push(taxon)
}
pushed := true
log.Warn(parents)
for pushed {
itaxo := taxo.Iterator()
pushed = false
@ -215,3 +216,13 @@ func (taxon *Taxon) ISubTaxonomy() *ITaxon {
return iter
}
func (taxonomy *Taxonomy) ISubTaxonomy(taxid string) *ITaxon {
taxon := taxonomy.Taxon(taxid)
if taxon == nil {
return nil
}
return taxon.ISubTaxonomy()
}