Files
obitools4/pkg/obitools/obiuniq/options.go
Eric Coissac 8d77cc4133 Change path of the obitools pkg
Former-commit-id: 311cbf8df3b990b393c6f4885d62e74564423b65
2023-11-29 12:14:37 +01:00

77 lines
1.9 KiB
Go

package obiuniq
import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
"github.com/DavidGamba/go-getoptions"
)
var _StatsOn = make([]string, 0, 10)
var _Keys = make([]string, 0, 10)
var _InMemory = false
var _chunks = 100
var _NAValue = "NA"
var _NoSingleton = false
func UniqueOptionSet(options *getoptions.GetOpt) {
options.StringSliceVar(&_StatsOn, "merge",
1, 1,
options.Alias("m"),
options.ArgName("KEY"),
options.Description("Adds a merged attribute containing the list of sequence record ids merged within this group."))
options.StringSliceVar(&_Keys, "category-attribute",
1, 1,
options.Alias("c"),
options.ArgName("CATEGORY"),
options.Description("Adds one attribute to the list of attributes used to define sequence groups (this option can be used several times)."))
options.StringVar(&_NAValue, "na-value", _NAValue,
options.ArgName("NA_NAME"),
options.Description("Value used when the classifier tag is not defined for a sequence."))
options.BoolVar(&_NoSingleton, "no-singleton", _NoSingleton,
options.Description("If set, sequences occurring a single time in the data set are discarded."))
options.BoolVar(&_InMemory, "in-memory", _InMemory,
options.Description("Use memory instead of disk to store data chunks."))
options.IntVar(&_chunks, "chunk-count", _chunks,
options.Description("In how many chunk the dataset is pre-devided for speeding up the process."))
}
// OptionSet adds to the basic option set every options declared for
// the obiuniq command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
UniqueOptionSet(options)
}
func CLIStatsOn() []string {
return _StatsOn
}
func CLIKeys() []string {
return _Keys
}
func CLIUniqueInMemory() bool {
return _InMemory
}
func CLINumberOfChunks() int {
if _chunks <= 1 {
return 1
}
return _chunks
}
func CLINAValue() string {
return _NAValue
}
func CLINoSingleton() bool {
return _NoSingleton
}