add the --raw-taxid option

This commit is contained in:
Eric Coissac
2025-03-08 09:40:06 +01:00
parent 78df7db18d
commit b18c9b7ac6
5 changed files with 25 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"regexp"
"strings"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
log "github.com/sirupsen/logrus"
)
@ -37,6 +38,10 @@ type TaxNode struct {
// Returns:
// - A formatted string representing the TaxNode in the form "taxonomyCode:id [scientificName]@rank".
func (node *TaxNode) String(taxonomyCode string) string {
if obidefault.UseRawTaxids() {
return *node.id
}
if node.HasScientificName() {
return fmt.Sprintf("%s:%v [%s]@%s",
taxonomyCode,