mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Start to use leveled log
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package obiconvert
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obiconvert
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obidistribute
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiformats"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
|
||||
@@ -2,7 +2,7 @@ package obidistribute
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obimultiplex
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obingslibrary"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obipairing
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"math"
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obipcr
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiapat"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
|
||||
@@ -10,22 +10,29 @@ var _Keys = make([]string, 0, 10)
|
||||
var _OnDisk = 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(&_OnDisk, "on-disk", true,
|
||||
options.BoolVar(&_NoSingleton, "no-singleton", _NoSingleton,
|
||||
options.Description("If set, sequences occurring a single time in the data set are discarded."))
|
||||
|
||||
options.BoolVar(&_OnDisk, "on-disk", _OnDisk,
|
||||
options.Description("Allows for using a disk cache during the dereplication process. "))
|
||||
|
||||
options.IntVar(&_chunks, "chunk-count", _chunks,
|
||||
@@ -49,7 +56,7 @@ func CLIKeys() []string {
|
||||
}
|
||||
|
||||
func CLIUniqueInMemory() bool {
|
||||
return _OnDisk
|
||||
return !_OnDisk
|
||||
}
|
||||
|
||||
func CLINumberOfChunks() int {
|
||||
@@ -63,3 +70,7 @@ func CLINumberOfChunks() int {
|
||||
func CLINAValue() string {
|
||||
return _NAValue
|
||||
}
|
||||
|
||||
func CLINoSingleton() bool {
|
||||
return _NoSingleton
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package obiuniq
|
||||
|
||||
import (
|
||||
"log"
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obichunk"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
|
||||
@@ -24,6 +24,13 @@ func Unique(sequences obiiter.IBioSequenceBatch) obiiter.IBioSequenceBatch {
|
||||
options = append(options, obichunk.OptionSortOnDisk())
|
||||
}
|
||||
|
||||
if CLINoSingleton() {
|
||||
log.Printf("Removing sigletons from the output")
|
||||
options = append(options, obichunk.OptionsNoSingleton())
|
||||
} else {
|
||||
log.Printf("Keep sigletons in the output")
|
||||
}
|
||||
|
||||
options = append(options,
|
||||
obichunk.OptionStatOn(CLIStatsOn()...))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user