Make obitag able to use the taxonomic path included in reference database as taxonomy

This commit is contained in:
Eric Coissac
2025-01-30 11:50:03 +01:00
parent 0df082da06
commit d3dac1b21f
3 changed files with 18 additions and 5 deletions

View File

@ -47,12 +47,27 @@ func main() {
obiconvert.OpenSequenceDataErrorMessage(args, err) obiconvert.OpenSequenceDataErrorMessage(args, err)
taxo := obitax.DefaultTaxonomy() taxo := obitax.DefaultTaxonomy()
references := obitag.CLIRefDB()
if references == nil {
log.Panicln("No loaded reference database")
}
if taxo == nil {
taxo, err = references.ExtractTaxonomy(nil)
if err != nil {
log.Fatalf("No taxonomy specified or extractable from reference database: %v", err)
}
taxo.SetAsDefault()
}
if taxo == nil { if taxo == nil {
log.Panicln("No loaded taxonomy") log.Panicln("No loaded taxonomy")
} }
references := obitag.CLIRefDB()
var identified obiiter.IBioSequence var identified obiiter.IBioSequence
if obitag.CLIGeometricMode() { if obitag.CLIGeometricMode() {

View File

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

View File

@ -6,7 +6,6 @@ import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiformats" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiformats"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
@ -43,7 +42,6 @@ func TagOptionSet(options *getoptions.GetOpt) {
// the obiuniq command // the obiuniq command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(options)
obioptions.LoadTaxonomyOptionSet(options, true, false)
TagOptionSet(options) TagOptionSet(options)
} }