mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-06-29 16:20:46 +00:00
add the --raw-taxid option
This commit is contained in:
@ -16,6 +16,12 @@
|
|||||||
- A new option **--csv** is added to every obitools to indicate that the input
|
- A new option **--csv** is added to every obitools to indicate that the input
|
||||||
format is CSV
|
format is CSV
|
||||||
|
|
||||||
|
- The new version of obitools are now printing the taxids in a fancy way
|
||||||
|
including the scientific name and the taxonomic rank (`"taxon:9606 [Homo
|
||||||
|
sapiens]@species"`). But if you need the old fashion raw taxid, a new option
|
||||||
|
**--raw-taxid** has been added to get obitools printing the taxids without any
|
||||||
|
decorations (`"9606"`).
|
||||||
|
|
||||||
|
|
||||||
## March 1st, 2025. Release 4.4.0
|
## March 1st, 2025. Release 4.4.0
|
||||||
|
|
||||||
|
@ -4,6 +4,15 @@ var __taxonomy__ = ""
|
|||||||
var __alternative_name__ = false
|
var __alternative_name__ = false
|
||||||
var __fail_on_taxonomy__ = false
|
var __fail_on_taxonomy__ = false
|
||||||
var __update_taxid__ = false
|
var __update_taxid__ = false
|
||||||
|
var __raw_taxid__ = false
|
||||||
|
|
||||||
|
func UseRawTaxids() bool {
|
||||||
|
return __raw_taxid__
|
||||||
|
}
|
||||||
|
|
||||||
|
func UseRawTaxidsPtr() *bool {
|
||||||
|
return &__raw_taxid__
|
||||||
|
}
|
||||||
|
|
||||||
func SelectedTaxonomy() string {
|
func SelectedTaxonomy() string {
|
||||||
return __taxonomy__
|
return __taxonomy__
|
||||||
|
@ -186,6 +186,10 @@ func LoadTaxonomyOptionSet(options *getoptions.GetOpt, required, alternatiive bo
|
|||||||
options.BoolVar(obidefault.UpdateTaxidPtr(), "update-taxid", obidefault.UpdateTaxid(),
|
options.BoolVar(obidefault.UpdateTaxidPtr(), "update-taxid", obidefault.UpdateTaxid(),
|
||||||
options.Description("Make obitools automatically updating the taxid that are declared merged to a newest one."),
|
options.Description("Make obitools automatically updating the taxid that are declared merged to a newest one."),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
options.BoolVar(obidefault.UseRawTaxidsPtr(), "raw-taxid", obidefault.UseRawTaxids(),
|
||||||
|
options.Description("When set, taxids are printed in files with any supplementary information (taxon name and rank)"),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CLIIsDebugMode returns whether the CLI is in debug mode.
|
// CLIIsDebugMode returns whether the CLI is in debug mode.
|
||||||
|
@ -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 = "706b44c"
|
var _Commit = "78df7db"
|
||||||
var _Version = "Release 4.4.0"
|
var _Version = "Release 4.4.0"
|
||||||
|
|
||||||
// Version returns the version of the obitools package.
|
// Version returns the version of the obitools package.
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -37,6 +38,10 @@ type TaxNode struct {
|
|||||||
// Returns:
|
// Returns:
|
||||||
// - A formatted string representing the TaxNode in the form "taxonomyCode:id [scientificName]@rank".
|
// - A formatted string representing the TaxNode in the form "taxonomyCode:id [scientificName]@rank".
|
||||||
func (node *TaxNode) String(taxonomyCode string) string {
|
func (node *TaxNode) String(taxonomyCode string) string {
|
||||||
|
if obidefault.UseRawTaxids() {
|
||||||
|
return *node.id
|
||||||
|
}
|
||||||
|
|
||||||
if node.HasScientificName() {
|
if node.HasScientificName() {
|
||||||
return fmt.Sprintf("%s:%v [%s]@%s",
|
return fmt.Sprintf("%s:%v [%s]@%s",
|
||||||
taxonomyCode,
|
taxonomyCode,
|
||||||
|
Reference in New Issue
Block a user