Make sequence files recognized as a taxonomy

This commit is contained in:
Eric Coissac
2025-03-14 14:22:22 +01:00
parent d1c31c54de
commit 8448783499
21 changed files with 657 additions and 467 deletions

View File

@ -4,8 +4,10 @@ import (
"fmt"
"os"
"runtime"
"sync"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiformats"
log "github.com/sirupsen/logrus"
"github.com/DavidGamba/go-getoptions"
@ -20,6 +22,8 @@ var _Pprof = false
var _PprofMudex = 10
var _PprofGoroutine = 6060
var __defaut_taxonomy_mutex__ sync.Mutex
type ArgumentParser func([]string) (*getoptions.GetOpt, []string)
func GenerateOptionParser(program string,
@ -87,6 +91,22 @@ func GenerateOptionParser(program string,
os.Exit(0)
}
if options.Called("taxonomy") {
__defaut_taxonomy_mutex__.Lock()
defer __defaut_taxonomy_mutex__.Unlock()
taxonomy, err := obiformats.LoadTaxonomy(
obidefault.SelectedTaxonomy(),
!obidefault.AreAlternativeNamesSelected(),
)
if err != nil {
log.Fatalf("Cannot load default taxonomy: %v", err)
}
taxonomy.SetAsDefault()
}
log.SetLevel(log.InfoLevel)
if options.Called("debug") {
log.SetLevel(log.DebugLevel)

View File

@ -8,7 +8,7 @@ import (
// corresponds to the last commit, and not the one when the file will be
// commited
var _Commit = "7a9dc1a"
var _Commit = "d1c31c5"
var _Version = "Release 4.4.0"
// Version returns the version of the obitools package.