normalize the usage of obitaxonomy

This commit is contained in:
Eric Coissac
2025-03-08 13:00:55 +01:00
parent b18c9b7ac6
commit 65bd29b955
4 changed files with 15 additions and 9 deletions

View File

@ -20,6 +20,19 @@ func main() {
var iterator *obitax.ITaxon
if obitaxonomy.CLIDownloadNCBI() {
err := obitaxonomy.CLIDownloadNCBITaxdump()
if err != nil {
log.Errorf("Cannot download NCBI taxonomy: %s", err.Error())
os.Exit(1)
}
os.Exit(0)
}
if !obidefault.HasSelectedTaxonomy() {
log.Fatal("you must indicate a taxonomy using the -t or --taxonomy option")
}
switch {
case obitaxonomy.CLIDownloadNCBI():
err := obitaxonomy.CLIDownloadNCBITaxdump()

View File

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

View File

@ -68,7 +68,7 @@ func CLICSVTaxaIterator(iterator *obitax.ITaxon) *obiitercsv.ICSVRecord {
obitax.OptionsWithRank(CLIWithRank()),
obitax.OptionsWithScientificName(CLIWithScientificName()),
obitax.OptionsWithPath(CLIWithPath()),
obitax.OptionsRawTaxid(CLIRawTaxid()),
obitax.OptionsRawTaxid(obidefault.UseRawTaxids()),
obitax.OptionsSource(obidefault.SelectedTaxonomy()),
)

View File

@ -18,7 +18,6 @@ var __with_query__ = false
var __without_rank__ = false
var __without_parent__ = false
var __without_scientific_name__ = false
var __raw_taxid__ = false
var __taxid_path__ = "NA"
var __taxid_sons__ = "NA"
var __restrict_rank__ = ""
@ -67,8 +66,6 @@ func OptionSet(options *getoptions.GetOpt) {
options.BoolVar(&__without_scientific_name__, "without-scientific-name", __without_scientific_name__,
options.Alias("S"),
options.Description("Supress the column containing the scientific name from the output."))
options.BoolVar(&__raw_taxid__, "raw-taxid", false,
options.Description("Displays the raw taxid for each displayed taxon."))
options.StringVar(&__to_dump__, "dump", __to_dump__,
options.Alias("D"),
options.ArgName("TAXID"),
@ -132,10 +129,6 @@ func CLIWithScientificName() bool {
return !__without_scientific_name__
}
func CLIRawTaxid() bool {
return __raw_taxid__
}
func CLIRankRestriction() string {
return __restrict_rank__
}