Adds the --silent-warning options to the obitools commands and removes the --pared-with option from some of the obitols commands.

This commit is contained in:
Eric Coissac
2025-03-25 16:44:46 +01:00
parent 2ab6f67d58
commit 5a3705b6bb
52 changed files with 151 additions and 90 deletions

View File

@ -14,7 +14,7 @@ func main() {
optionParser := obioptions.GenerateOptionParser( optionParser := obioptions.GenerateOptionParser(
"obicomplement", "obicomplement",
"reverse complement of sequences", "reverse complement of sequences",
obiconvert.OptionSet) obiconvert.OptionSet(true))
_, args := optionParser(os.Args) _, args := optionParser(os.Args)

View File

@ -17,7 +17,7 @@ func main() {
optionParser := obioptions.GenerateOptionParser( optionParser := obioptions.GenerateOptionParser(
"obiconvert", "obiconvert",
"convertion of sequence files to various formats", "convertion of sequence files to various formats",
obiconvert.OptionSet) obiconvert.OptionSet(true))
_, args := optionParser(os.Args) _, args := optionParser(os.Args)

View File

@ -169,7 +169,7 @@ func BuildQualityConsensus(seqA, seqB *obiseq.BioSequence, path []int, statOnMis
right = len(*bufferQA) - right right = len(*bufferQA) - right
// log.Warnf("BuildQualityConsensus: left = %d right = %d\n", left, right) // obilog.Warnf("BuildQualityConsensus: left = %d right = %d\n", left, right)
for i, qA = range *bufferQA { for i, qA = range *bufferQA {
nA := (*bufferSA)[i] nA := (*bufferSA)[i]

View File

@ -117,7 +117,7 @@ func _MatchScoreRatio(QF, QR byte) (float64, float64) {
term1 := _Logaddexp(qF, qR) term1 := _Logaddexp(qF, qR)
term2 := _Logdiffexp(term1, qF+qR) term2 := _Logdiffexp(term1, qF+qR)
// log.Warnf("MatchScoreRatio: %v, %v , %v, %v", QF, QR, term1, term2) // obilog.Warnf("MatchScoreRatio: %v, %v , %v, %v", QF, QR, term1, term2)
match_logp := _Log1mexp(term2 + l3 - l4) match_logp := _Log1mexp(term2 + l3 - l4)
match_score := match_logp - _Log1mexp(match_logp) match_score := match_logp - _Log1mexp(match_logp)

View File

@ -152,7 +152,7 @@ func LocatePattern(id string, pattern, sequence []byte) (int, int, int) {
} }
// log.Warnf("from : %d to: %d error: %d match: %v", // obilog.Warnf("from : %d to: %d error: %d match: %v",
// i, end+1, -buffer[buffIndex(len(sequence)-1, len(pattern)-1, width)], // i, end+1, -buffer[buffIndex(len(sequence)-1, len(pattern)-1, width)],
// string(sequence[i:(end+1)])) // string(sequence[i:(end+1)]))
return i, end + 1, -buffer[buffIndex(len(sequence)-1, len(pattern)-1, width)] return i, end + 1, -buffer[buffIndex(len(sequence)-1, len(pattern)-1, width)]

View File

@ -53,10 +53,10 @@ func ReadAlign(seqA, seqB *obiseq.BioSequence,
over = min(seqA.Len(), seqB.Len()) over = min(seqA.Len(), seqB.Len())
} }
// log.Warnf("fw/fw: %v shift=%d fastCount=%d/over=%d fastScore=%f", // obilog.Warnf("fw/fw: %v shift=%d fastCount=%d/over=%d fastScore=%f",
// directAlignment, shift, fastCount, over, fastScore) // directAlignment, shift, fastCount, over, fastScore)
// log.Warnf(("seqA: %s\nseqB: %s\n"), seqA.String(), seqB.String()) // obilog.Warnf(("seqA: %s\nseqB: %s\n"), seqA.String(), seqB.String())
// At least one mismatch exists in the overlaping region // At least one mismatch exists in the overlaping region
if fastCount+3 < over { if fastCount+3 < over {

View File

@ -410,8 +410,8 @@ func (pattern ApatPattern) FilterBestMatch(sequence ApatSequence, begin, length
best := [3]int{0, 0, 10000} best := [3]int{0, 0, 10000}
for _, m := range res { for _, m := range res {
// log.Warnf("Current : Begin : %d End : %d Err : %d", m[0], m[1], m[2]) // obilog.Warnf("Current : Begin : %d End : %d Err : %d", m[0], m[1], m[2])
// log.Warnf("Best : Begin : %d End : %d Err : %d", best[0], best[1], best[2]) // obilog.Warnf("Best : Begin : %d End : %d Err : %d", best[0], best[1], best[2])
if (m[0] - m[2]) < best[1]+best[2] { if (m[0] - m[2]) < best[1]+best[2] {
// match are overlapping // match are overlapping
// log.Warnln("overlap") // log.Warnln("overlap")
@ -467,7 +467,7 @@ func (pattern ApatPattern) AllMatches(sequence ApatSequence, begin, length int)
// Recompute the start and end position of the match // Recompute the start and end position of the match
// when the pattern allows for indels // when the pattern allows for indels
if m[2] > 0 && pattern.pointer.pointer.hasIndel { if m[2] > 0 && pattern.pointer.pointer.hasIndel {
// log.Warnf("Locating indel on sequence %s[%s]", sequence.pointer.reference.Id(), pattern.String()) // obilog.Warnf("Locating indel on sequence %s[%s]", sequence.pointer.reference.Id(), pattern.String())
start := m[0] - m[2]*2 start := m[0] - m[2]*2
start = max(start, 0) start = max(start, 0)
end := start + int(pattern.pointer.pointer.patlen) + 4*m[2] end := start + int(pattern.pointer.pointer.patlen) + 4*m[2]
@ -489,7 +489,7 @@ func (pattern ApatPattern) AllMatches(sequence ApatSequence, begin, length int)
m[0] = start + pb m[0] = start + pb
m[1] = start + pe m[1] = start + pe
// log.Warnf("seq[%d@%d:%d] %d: %s %d - %s:%s:%s", i, m[0], m[1], olderr, sequence.pointer.reference.Id(), score, // obilog.Warnf("seq[%d@%d:%d] %d: %s %d - %s:%s:%s", i, m[0], m[1], olderr, sequence.pointer.reference.Id(), score,
// frg, (*cpattern)[0:int(pattern.pointer.pointer.patlen)], sequence.pointer.reference.Sequence()[m[0]:m[1]]) // frg, (*cpattern)[0:int(pattern.pointer.pointer.patlen)], sequence.pointer.reference.Sequence()[m[0]:m[1]])
} }

11
pkg/obidefault/logger.go Normal file
View File

@ -0,0 +1,11 @@
package obidefault
var __silent_warning__ = false
func SilentWarning() bool {
return __silent_warning__
}
func SilentWarningPtr() *bool {
return &__silent_warning__
}

View File

@ -213,7 +213,7 @@ func _ParseFastaFile(
for chunks := range input { for chunks := range input {
sequences, err := parser(chunks.Source, chunks.Raw) sequences, err := parser(chunks.Source, chunks.Raw)
// log.Warnf("Chunck(%d:%d) -%d- ", chunks.Order, l, sequences.Len()) // obilog.Warnf("Chunck(%d:%d) -%d- ", chunks.Order, l, sequences.Len())
if err != nil { if err != nil {
log.Fatalf("File %s : Cannot parse the fasta file : %v", chunks.Source, err) log.Fatalf("File %s : Cannot parse the fasta file : %v", chunks.Source, err)

View File

@ -17,7 +17,7 @@ import (
func EndOfLastFastqEntry(buffer []byte) int { func EndOfLastFastqEntry(buffer []byte) int {
var i int var i int
// log.Warnf("EndOfLastFastqEntry(%d): %s", len(buffer), string(buffer[0:20])) // obilog.Warnf("EndOfLastFastqEntry(%d): %s", len(buffer), string(buffer[0:20]))
imax := len(buffer) imax := len(buffer)
state := 0 state := 0
restart := imax - 1 restart := imax - 1
@ -74,7 +74,7 @@ func EndOfLastFastqEntry(buffer []byte) int {
state = 3 state = 3
} else { } else {
// it was not the sequence part // it was not the sequence part
// log.Warnf("it was not the sequence part : %c", C) // obilog.Warnf("it was not the sequence part : %c", C)
state = 0 state = 0
i = restart i = restart
} }
@ -101,7 +101,7 @@ func EndOfLastFastqEntry(buffer []byte) int {
// log.Warn("====> End of the last sequence") // log.Warn("====> End of the last sequence")
state = 7 state = 7
} else { } else {
// log.Warnf("%s: Strange it was not the end of the last sequence : %c : %s", string(buffer[0:40]), C, string(buffer[i-20:i+5])) // obilog.Warnf("%s: Strange it was not the end of the last sequence : %c : %s", string(buffer[0:40]), C, string(buffer[i-20:i+5]))
state = 5 state = 5
} }
} }

View File

@ -12,6 +12,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
) )
@ -106,7 +107,7 @@ func FormatFastaBatch(batch obiiter.BioSequenceBatch, formater FormatHeader, ski
// Handle empty sequences // Handle empty sequences
if skipEmpty { if skipEmpty {
// Skip empty sequences if skipEmpty is true // Skip empty sequences if skipEmpty is true
log.Warnf("Sequence %s is empty and skipped in output", seq.Id()) obilog.Warnf("Sequence %s is empty and skipped in output", seq.Id())
} else { } else {
// Terminate the program if skipEmpty is false // Terminate the program if skipEmpty is false
log.Fatalf("Sequence %s is empty", seq.Id()) log.Fatalf("Sequence %s is empty", seq.Id())

View File

@ -9,6 +9,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
) )
@ -75,7 +76,7 @@ func FormatFastqBatch(batch obiiter.BioSequenceBatch,
} else { } else {
if skipEmpty { if skipEmpty {
log.Warnf("Sequence %s is empty and skiped in output", seq.Id()) obilog.Warnf("Sequence %s is empty and skiped in output", seq.Id())
} else { } else {
log.Fatalf("Sequence %s is empty", seq.Id()) log.Fatalf("Sequence %s is empty", seq.Id())
} }

View File

@ -172,7 +172,7 @@ func ReadFileChunk(
} else { } else {
end = -1 end = -1
} }
// log.Warnf("Splitter not found, attempting %d to read in %d B increments : len(buff) = %d/%d", ic, fileChunkSize, len(extbuff), len(buff)) // obilog.Warnf("Splitter not found, attempting %d to read in %d B increments : len(buff) = %d/%d", ic, fileChunkSize, len(extbuff), len(buff))
} }
pieces = pieces.Head().Pack() pieces = pieces.Head().Pack()
@ -204,7 +204,7 @@ func ReadFileChunk(
} }
if len(pieces.data) > 0 { if len(pieces.data) > 0 {
// log.Warnf("chuck %d :Read %d bytes from file %s", i, io.Len(), source) // obilog.Warnf("chuck %d :Read %d bytes from file %s", i, io.Len(), source)
chunk_channel <- pieces.FileChunk(source, i) chunk_channel <- pieces.FileChunk(source, i)
i++ i++
} }

View File

@ -13,6 +13,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obingslibrary" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obingslibrary"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
@ -663,7 +664,7 @@ func ReadCSVNGSFilter(reader io.Reader) (*obingslibrary.NGSLibrary, error) {
if ok { if ok {
setparam(&ngsfilter, data...) setparam(&ngsfilter, data...)
} else { } else {
log.Warnf("At line %d: Skipping unknown parameter %s: %v", i, param, data) obilog.Warnf("At line %d: Skipping unknown parameter %s: %v", i, param, data)
} }
} }

View File

@ -4,6 +4,7 @@ import (
"math" "math"
"math/bits" "math/bits"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -46,7 +47,7 @@ func (u Uint128) IsZero() bool {
// Returns a Uint64 value. // Returns a Uint64 value.
func (u Uint128) Uint64() Uint64 { func (u Uint128) Uint64() Uint64 {
if u.w1 != 0 { if u.w1 != 0 {
log.Warnf("Uint128 overflow at Uint64(%v)", u) obilog.Warnf("Uint128 overflow at Uint64(%v)", u)
} }
return Uint64{w0: u.w0} return Uint64{w0: u.w0}
} }

View File

@ -4,6 +4,7 @@ import (
"math" "math"
"math/bits" "math/bits"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -51,7 +52,7 @@ func (u Uint256) IsZero() bool {
// Returns a Uint64 value. // Returns a Uint64 value.
func (u Uint256) Uint64() Uint64 { func (u Uint256) Uint64() Uint64 {
if u.w3 != 0 || u.w2 != 0 || u.w1 != 0 { if u.w3 != 0 || u.w2 != 0 || u.w1 != 0 {
log.Warnf("Uint256 overflow at Uint64(%v)", u) obilog.Warnf("Uint256 overflow at Uint64(%v)", u)
} }
return Uint64{w0: u.w0} return Uint64{w0: u.w0}
} }
@ -64,7 +65,7 @@ func (u Uint256) Uint64() Uint64 {
// Returns a Uint128 value. // Returns a Uint128 value.
func (u Uint256) Uint128() Uint128 { func (u Uint256) Uint128() Uint128 {
if u.w3 != 0 || u.w2 != 0 { if u.w3 != 0 || u.w2 != 0 {
log.Warnf("Uint256 overflow at Uint128(%v)", u) obilog.Warnf("Uint256 overflow at Uint128(%v)", u)
} }
return Uint128{u.w1, u.w0} return Uint128{u.w1, u.w0}
} }

View File

@ -4,6 +4,7 @@ import (
"math" "math"
"math/bits" "math/bits"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -100,7 +101,7 @@ func (u Uint64) LeftShift64(n uint, carryIn uint64) (value, carry uint64) {
} }
log.Warnf("Uint64 overflow at LeftShift64(%v, %v)", u, n) obilog.Warnf("Uint64 overflow at LeftShift64(%v, %v)", u, n)
return 0, 0 return 0, 0
} }
@ -129,7 +130,7 @@ func (u Uint64) RightShift64(n uint, carryIn uint64) (value, carry uint64) {
return carryIn, u.w0 >> (n - 64) return carryIn, u.w0 >> (n - 64)
} }
log.Warnf("Uint64 overflow at RightShift64(%v, %v)", u, n) obilog.Warnf("Uint64 overflow at RightShift64(%v, %v)", u, n)
return 0, 0 return 0, 0
} }

View File

@ -3,8 +3,8 @@ package obiiter
import ( import (
"runtime" "runtime"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"github.com/pbnjay/memory" "github.com/pbnjay/memory"
log "github.com/sirupsen/logrus"
) )
func (iterator IBioSequence) LimitMemory(fraction float64) IBioSequence { func (iterator IBioSequence) LimitMemory(fraction float64) IBioSequence {
@ -25,11 +25,11 @@ func (iterator IBioSequence) LimitMemory(fraction float64) IBioSequence {
runtime.Gosched() runtime.Gosched()
nwait++ nwait++
if nwait%1000 == 0 { if nwait%1000 == 0 {
log.Warnf("Wait for memory limit %f/%f", fracLoad(), fraction) obilog.Warnf("Wait for memory limit %f/%f", fracLoad(), fraction)
} }
if nwait > 10000 { if nwait > 10000 {
log.Warnf("Very long wait for memory limit %f/%f", fracLoad(), fraction) obilog.Warnf("Very long wait for memory limit %f/%f", fracLoad(), fraction)
break break
} }
} }

View File

@ -6,9 +6,9 @@ import (
"unsafe" "unsafe"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obifp" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obifp"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"github.com/schollz/progressbar/v3" "github.com/schollz/progressbar/v3"
log "github.com/sirupsen/logrus"
) )
type KmerMap[T obifp.FPUint[T]] struct { type KmerMap[T obifp.FPUint[T]] struct {
@ -226,12 +226,12 @@ func NewKmerMap[T obifp.FPUint[T]](
sparseAt := -1 sparseAt := -1
if sparse && kmersize%2 == 0 { if sparse && kmersize%2 == 0 {
log.Warnf("Kmer size must be odd when using sparse mode") obilog.Warnf("Kmer size must be odd when using sparse mode")
kmersize++ kmersize++
} }
if !sparse && kmersize%2 == 1 { if !sparse && kmersize%2 == 1 {
log.Warnf("Kmer size must be even when not using sparse mode") obilog.Warnf("Kmer size must be even when not using sparse mode")
kmersize-- kmersize--
} }

12
pkg/obilog/warning.go Normal file
View File

@ -0,0 +1,12 @@
package obilog
import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"github.com/sirupsen/logrus"
)
func Warnf(format string, args ...interface{}) {
if !obidefault.SilentWarning() {
logrus.Warnf(format, args...)
}
}

View File

@ -8,6 +8,7 @@ import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
lua "github.com/yuin/gopher-lua" lua "github.com/yuin/gopher-lua"
@ -230,7 +231,7 @@ func LuaProcessor(iterator obiiter.IBioSequence, name, program string, breakOnEr
if breakOnError { if breakOnError {
log.Fatalf("Error during Lua sequence processing : %v", err) log.Fatalf("Error during Lua sequence processing : %v", err)
} else { } else {
log.Warnf("Error during Lua sequence processing : %v", err) obilog.Warnf("Error during Lua sequence processing : %v", err)
} }
} }

View File

@ -87,7 +87,7 @@ func lookForTag(seq string, delimiter byte) string {
i := len(seq) - 1 i := len(seq) - 1
// log.Warnf("Provided fragment : %s", string(seq)) // obilog.Warnf("Provided fragment : %s", string(seq))
for i >= 0 && seq[i] != delimiter { for i >= 0 && seq[i] != delimiter {
i-- i--
@ -109,7 +109,7 @@ func lookForTag(seq string, delimiter byte) string {
return "" return ""
} }
// log.Warnf("extracted : %s", string(seq[begin:end])) // obilog.Warnf("extracted : %s", string(seq[begin:end]))
return seq[begin:end] return seq[begin:end]
} }
@ -340,8 +340,8 @@ func (marker *Marker) beginTagExtractor(
sequence *obiseq.BioSequence, sequence *obiseq.BioSequence,
begin int, begin int,
forward bool) string { forward bool) string {
// log.Warnf("Forward : %v -> %d %c", forward, marker.Forward_spacer, marker.Forward_tag_delimiter) // obilog.Warnf("Forward : %v -> %d %c", forward, marker.Forward_spacer, marker.Forward_tag_delimiter)
// log.Warnf("Forward : %v -> %d %c", forward, marker.Reverse_spacer, marker.Reverse_tag_delimiter) // obilog.Warnf("Forward : %v -> %d %c", forward, marker.Reverse_spacer, marker.Reverse_tag_delimiter)
if forward { if forward {
if marker.Forward_tag_length == 0 { if marker.Forward_tag_length == 0 {
return "" return ""
@ -351,10 +351,10 @@ func (marker *Marker) beginTagExtractor(
return marker.beginFixedTagExtractor(sequence, begin, forward) return marker.beginFixedTagExtractor(sequence, begin, forward)
} else { } else {
if marker.Forward_tag_indels == 0 { if marker.Forward_tag_indels == 0 {
// log.Warnf("Delimited tag for forward primers %s", marker.forward.String()) // obilog.Warnf("Delimited tag for forward primers %s", marker.forward.String())
return marker.beginDelimitedTagExtractor(sequence, begin, forward) return marker.beginDelimitedTagExtractor(sequence, begin, forward)
} else { } else {
// log.Warnf("Rescue tag for forward primers %s", marker.forward.String()) // obilog.Warnf("Rescue tag for forward primers %s", marker.forward.String())
return marker.beginRescueTagExtractor(sequence, begin, forward) return marker.beginRescueTagExtractor(sequence, begin, forward)
} }
} }
@ -367,10 +367,10 @@ func (marker *Marker) beginTagExtractor(
return marker.beginFixedTagExtractor(sequence, begin, forward) return marker.beginFixedTagExtractor(sequence, begin, forward)
} else { } else {
if marker.Reverse_tag_indels == 0 { if marker.Reverse_tag_indels == 0 {
// log.Warnf("Delimited tag for reverse/complement primers %s", marker.creverse.String()) // obilog.Warnf("Delimited tag for reverse/complement primers %s", marker.creverse.String())
return marker.beginDelimitedTagExtractor(sequence, begin, forward) return marker.beginDelimitedTagExtractor(sequence, begin, forward)
} else { } else {
// log.Warnf("Rescue tag for reverse/complement primers %s", marker.creverse.String()) // obilog.Warnf("Rescue tag for reverse/complement primers %s", marker.creverse.String())
return marker.beginRescueTagExtractor(sequence, begin, forward) return marker.beginRescueTagExtractor(sequence, begin, forward)
} }
} }
@ -390,10 +390,10 @@ func (marker *Marker) endTagExtractor(
return marker.endFixedTagExtractor(sequence, end, forward) return marker.endFixedTagExtractor(sequence, end, forward)
} else { } else {
if marker.Reverse_tag_indels == 0 { if marker.Reverse_tag_indels == 0 {
// log.Warnf("Delimited tag for reverse primers %s", marker.reverse.String()) // obilog.Warnf("Delimited tag for reverse primers %s", marker.reverse.String())
return marker.endDelimitedTagExtractor(sequence, end, forward) return marker.endDelimitedTagExtractor(sequence, end, forward)
} else { } else {
// log.Warnf("Rescue tag for reverse primers %s", marker.reverse.String()) // obilog.Warnf("Rescue tag for reverse primers %s", marker.reverse.String())
return marker.endRescueTagExtractor(sequence, end, forward) return marker.endRescueTagExtractor(sequence, end, forward)
} }
} }
@ -406,10 +406,10 @@ func (marker *Marker) endTagExtractor(
return marker.endFixedTagExtractor(sequence, end, forward) return marker.endFixedTagExtractor(sequence, end, forward)
} else { } else {
if marker.Forward_tag_indels == 0 { if marker.Forward_tag_indels == 0 {
// log.Warnf("Delimited tag for forward/complement primers %s", marker.cforward.String()) // obilog.Warnf("Delimited tag for forward/complement primers %s", marker.cforward.String())
return marker.endDelimitedTagExtractor(sequence, end, forward) return marker.endDelimitedTagExtractor(sequence, end, forward)
} else { } else {
// log.Warnf("Rescue tag for forward/complement primers %s", marker.cforward.String()) // obilog.Warnf("Rescue tag for forward/complement primers %s", marker.cforward.String())
return marker.endRescueTagExtractor(sequence, end, forward) return marker.endRescueTagExtractor(sequence, end, forward)
} }
} }

View File

@ -73,6 +73,11 @@ func GenerateOptionParser(program string,
options.GetEnv("OBISOLEXA"), options.GetEnv("OBISOLEXA"),
options.Description("Decodes quality string according to the Solexa specification.")) options.Description("Decodes quality string according to the Solexa specification."))
options.BoolVar(obidefault.SilentWarningPtr(), "silent-warning", obidefault.SilentWarning(),
options.GetEnv("OBIWARNING"),
options.Description("Stop printing of the warning message"),
)
for _, o := range optionset { for _, o := range optionset {
o(options) o(options)
} }

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 = "8b379d3" var _Commit = "2ab6f67"
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.

View File

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -136,7 +137,12 @@ func (s *BioSequence) SetAttribute(key string, value interface{}) {
} }
if key == "sequence" { if key == "sequence" {
s.SetSequence(value.([]byte)) data, err := obiutils.InterfaceToString(value)
if err != nil {
obilog.Warnf("%s: cannot convert value %v to sequence", s.Id(), value)
return
}
s.SetSequence([]byte(data))
return return
} }

View File

@ -444,6 +444,15 @@ func (s *BioSequence) SetSequence(sequence []byte) {
s.sequence = obiutils.InPlaceToLower(CopySlice(sequence)) s.sequence = obiutils.InPlaceToLower(CopySlice(sequence))
} }
func (s *BioSequence) HasValidSequence() bool {
for _, c := range s.sequence {
if !((c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '[' || c == ']') {
return false
}
}
return true
}
// Setting the qualities of the BioSequence. // Setting the qualities of the BioSequence.
func (s *BioSequence) SetQualities(qualities Quality) { func (s *BioSequence) SetQualities(qualities Quality) {
if s.qualities != nil { if s.qualities != nil {

View File

@ -1,6 +1,7 @@
package obiseq package obiseq
import ( import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
@ -61,7 +62,7 @@ func (s *BioSequenceSlice) EnsureCapacity(capacity int) *BioSequenceSlice {
if c < capacity { if c < capacity {
n++ n++
if n < 4 { if n < 4 {
log.Warnf("cannot allocate a Biosequence Slice of size %d (only %d from %d)", capacity, c, old_c) obilog.Warnf("cannot allocate a Biosequence Slice of size %d (only %d from %d)", capacity, c, old_c)
} else { } else {
log.Panicf("cannot allocate a Biosequence Slice of size %d (only %d from %d)", capacity, c, old_c) log.Panicf("cannot allocate a Biosequence Slice of size %d (only %d from %d)", capacity, c, old_c)
} }

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"regexp" "regexp"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -278,9 +279,10 @@ func ExpressionPredicat(expression string) SequencePredicate {
) )
if err != nil { if err != nil {
log.Fatalf("Expression '%s' cannot be evaluated on sequence %s", obilog.Warnf("Expression '%s' cannot be evaluated on sequence %s",
expression, expression,
sequence.Id()) sequence.Id())
return false
} }
return value return value

View File

@ -6,6 +6,7 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
) )
@ -41,7 +42,7 @@ func (s *BioSequence) SetTaxid(taxid string, rank ...string) {
taxon, isAlias, err = taxonomy.Taxon(taxid) taxon, isAlias, err = taxonomy.Taxon(taxid)
if err != nil { if err != nil {
logger := log.Warnf logger := obilog.Warnf
if obidefault.FailOnTaxonomy() { if obidefault.FailOnTaxonomy() {
logger = log.Fatalf logger = log.Fatalf
} }
@ -51,7 +52,7 @@ func (s *BioSequence) SetTaxid(taxid string, rank ...string) {
if isAlias { if isAlias {
if obidefault.UpdateTaxid() { if obidefault.UpdateTaxid() {
log.Warnf("%s: Taxid: %v is updated to %s", obilog.Warnf("%s: Taxid: %v is updated to %s",
s.Id(), taxid, taxon.String()) s.Id(), taxid, taxon.String())
taxid = taxon.String() taxid = taxon.String()
} else { } else {
@ -59,7 +60,7 @@ func (s *BioSequence) SetTaxid(taxid string, rank ...string) {
log.Fatalf("%s: Taxid: %v is an alias from taxonomy (%v) to %s", log.Fatalf("%s: Taxid: %v is an alias from taxonomy (%v) to %s",
s.Id(), taxid, taxonomy.Name(), taxon.String()) s.Id(), taxid, taxonomy.Name(), taxon.String())
} }
log.Warnf("%s: Taxid %v has to be updated to %s", obilog.Warnf("%s: Taxid %v has to be updated to %s",
s.Id(), taxid, taxon.String()) s.Id(), taxid, taxon.String())
} }

View File

@ -3,6 +3,7 @@ package obiseq
import ( import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
) )
@ -66,7 +67,7 @@ func IsSubCladeOfSlot(taxonomy *obitax.Taxonomy, key string) SequencePredicate {
parent, _, err := taxonomy.Taxon(val) parent, _, err := taxonomy.Taxon(val)
if err != nil { if err != nil {
log.Warnf("%s: %s is unkown from the taxonomy (%v)", sequence.Id(), val, err) obilog.Warnf("%s: %s is unkown from the taxonomy (%v)", sequence.Id(), val, err)
} }
taxon := sequence.Taxon(taxonomy) taxon := sequence.Taxon(taxonomy)

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"slices" "slices"
log "github.com/sirupsen/logrus" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
) )
type SeqAnnotator func(*BioSequence) type SeqAnnotator func(*BioSequence)
@ -119,7 +119,7 @@ func SeqToSliceWorker(worker SeqWorker,
s.Id(), err) s.Id(), err)
return BioSequenceSlice{}, err return BioSequenceSlice{}, err
} else { } else {
log.Warnf("got an error on sequence %s processing : %v", obilog.Warnf("got an error on sequence %s processing : %v",
s.Id(), err) s.Id(), err)
} }
} }
@ -208,7 +208,7 @@ func SeqToSliceConditionalWorker(
s.Id(), err) s.Id(), err)
return BioSequenceSlice{}, err return BioSequenceSlice{}, err
} else { } else {
log.Warnf("got an error on sequence %s processing : %v", obilog.Warnf("got an error on sequence %s processing : %v",
s.Id(), err) s.Id(), err)
} }
} }

View File

@ -8,6 +8,7 @@ import (
"golang.org/x/exp/rand" "golang.org/x/exp/rand"
"gonum.org/v1/gonum/stat/sampleuv" "gonum.org/v1/gonum/stat/sampleuv"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -280,7 +281,7 @@ func (clustering *KmeansClustering) AssignToClass() {
nreset := clustering.ResetEmptyCenters() nreset := clustering.ResetEmptyCenters()
if nreset > 0 { if nreset > 0 {
log.Warnf("Reseted %d empty centers", nreset) obilog.Warnf("Reseted %d empty centers", nreset)
} }
} }

View File

@ -35,7 +35,7 @@ func (f *TaxidFactory) FromString(taxid string) (Taxid, error) {
if len(part2) == 0 { if len(part2) == 0 {
taxid = part1 taxid = part1
} else { } else {
//log.Warnf("TaxidFactory.FromString: taxid %s -> -%s- -%s- ", taxid, part1, part2) //obilog.Warnf("TaxidFactory.FromString: taxid %s -> -%s- -%s- ", taxid, part1, part2)
if part1 != f.code { if part1 != f.code {
return nil, fmt.Errorf("taxid %s string does not start with taxonomy code %s", taxid, f.code) return nil, fmt.Errorf("taxid %s string does not start with taxonomy code %s", taxid, f.code)
} }

View File

@ -322,7 +322,7 @@ func CLIAnnotationWorker() obiseq.SeqWorker {
if CLIHasCut() { if CLIHasCut() {
from, to := CLICut() from, to := CLICut()
w := CutSequenceWorker(from, to, false) w := CutSequenceWorker(from, to, true)
annotator = annotator.ChainWorkers(w) annotator = annotator.ChainWorkers(w)
} }

View File

@ -130,7 +130,7 @@ func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obipcr command // the obipcr command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
obigrep.SequenceSelectionOptionSet(options) obigrep.SequenceSelectionOptionSet(options)
SequenceAnnotationOptionSet(options) SequenceAnnotationOptionSet(options)
} }

View File

@ -53,7 +53,7 @@ func commonSuffix(a, b *obiseq.BioSequence) int {
if obiutils.UnsafeString(as[i+1:]) != obiutils.UnsafeString(bs[j+1:]) { if obiutils.UnsafeString(as[i+1:]) != obiutils.UnsafeString(bs[j+1:]) {
log.Fatalf("i: %d, j: %d (%s/%s)", i, j, as[i+1:], bs[j+1:]) log.Fatalf("i: %d, j: %d (%s/%s)", i, j, as[i+1:], bs[j+1:])
} }
// log.Warnf("i: %d, j: %d (%s)", i, j, as[i+1:]) // obilog.Warnf("i: %d, j: %d (%s)", i, j, as[i+1:])
return l return l
} }

View File

@ -113,10 +113,10 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
} }
// level, _ := sequence.GetAttribute("obicleandb_level") // level, _ := sequence.GetAttribute("obicleandb_level")
// log.Warnf("%s - level: %v", sequence.Id(), level) // obilog.Warnf("%s - level: %v", sequence.Id(), level)
// log.Warnf("%s - gdist: %v", sequence.Id(), indist) // obilog.Warnf("%s - gdist: %v", sequence.Id(), indist)
// log.Warnf("%s - fdist: %v", sequence.Id(), outdist) // obilog.Warnf("%s - fdist: %v", sequence.Id(), outdist)
// log.Warnf("%s - pval: %f", sequence.Id(), pval) // obilog.Warnf("%s - pval: %f", sequence.Id(), pval)
} }
if pval < 0.0 { if pval < 0.0 {

View File

@ -126,11 +126,16 @@ func PairedFilesOptionSet(options *getoptions.GetOpt) {
) )
} }
func OptionSet(options *getoptions.GetOpt) { func OptionSet(allow_paired bool) func(options *getoptions.GetOpt) {
obioptions.LoadTaxonomyOptionSet(options, false, false) f := func(options *getoptions.GetOpt) {
InputOptionSet(options) obioptions.LoadTaxonomyOptionSet(options, false, false)
OutputOptionSet(options) InputOptionSet(options)
PairedFilesOptionSet(options) OutputOptionSet(options)
if allow_paired {
PairedFilesOptionSet(options)
}
}
return f
} }
// Returns true if the number of reads described in the // Returns true if the number of reads described in the

View File

@ -17,7 +17,7 @@ func DemergeOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obipcr command // the obipcr command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
DemergeOptionSet(options) DemergeOptionSet(options)
} }

View File

@ -166,7 +166,7 @@ func SequenceSelectionOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obipcr command // the obipcr command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(true)(options)
SequenceSelectionOptionSet(options) SequenceSelectionOptionSet(options)
options.StringVar(&_SaveRejected, "save-discarded", _SaveRejected, options.StringVar(&_SaveRejected, "save-discarded", _SaveRejected,

View File

@ -46,7 +46,7 @@ func JoinOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obipcr command // the obipcr command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
JoinOptionSet(options) JoinOptionSet(options)
} }

View File

@ -76,12 +76,12 @@ func KmerSimMatchOptionSet(options *getoptions.GetOpt) {
} }
func CountOptionSet(options *getoptions.GetOpt) { func CountOptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
KmerSimCountOptionSet(options) KmerSimCountOptionSet(options)
} }
func MatchOptionSet(options *getoptions.GetOpt) { func MatchOptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
KmerSimCountOptionSet(options) KmerSimCountOptionSet(options)
KmerSimMatchOptionSet(options) KmerSimMatchOptionSet(options)
} }

View File

@ -49,7 +49,7 @@ func MicroSatelliteOptionSet(options *getoptions.GetOpt) {
} }
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
MicroSatelliteOptionSet(options) MicroSatelliteOptionSet(options)
} }

View File

@ -54,7 +54,7 @@ func MultiplexOptionSet(options *getoptions.GetOpt) {
} }
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
MultiplexOptionSet(options) MultiplexOptionSet(options)
} }

View File

@ -67,7 +67,7 @@ func PCROptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obipcr command // the obipcr command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
PCROptionSet(options) PCROptionSet(options)
} }

View File

@ -88,7 +88,7 @@ func IndexSequence(seqidx int,
// Initialize a matrix to store alignment scores // Initialize a matrix to store alignment scores
var matrix []uint64 var matrix []uint64
// log.Warnf("%s : %s", sequence.Id(), pseq.String()) // obilog.Warnf("%s : %s", sequence.Id(), pseq.String())
for idx_path := 1; idx_path < path_len; idx_path++ { for idx_path := 1; idx_path < path_len; idx_path++ {
mini := -1 mini := -1
seqidcs := refs[pseq.Taxon(idx_path).Node] seqidcs := refs[pseq.Taxon(idx_path).Node]
@ -144,8 +144,8 @@ func IndexSequence(seqidx int,
} }
if mini == 0 { if mini == 0 {
// log.Warnf("%s: %s", sequence.Id(), sequence.String()) // obilog.Warnf("%s: %s", sequence.Id(), sequence.String())
// log.Warnf("%s: %s", suject.Id(), suject.String()) // obilog.Warnf("%s: %s", suject.Id(), suject.String())
break break
} }
} }
@ -158,7 +158,7 @@ func IndexSequence(seqidx int,
// insure than closest is strictly increasing // insure than closest is strictly increasing
for k := idx_path - 1; k >= 0 && mini < closest[k]; k-- { for k := idx_path - 1; k >= 0 && mini < closest[k]; k-- {
closest[k] = mini closest[k] = mini
// log.Warnf("(%s,%s) Smaller alignment found than previous (%d,%d). Resetting closest.", sequence.Id(), pseq.Taxon(idx_path).String(), mini, closest[k]) // obilog.Warnf("(%s,%s) Smaller alignment found than previous (%d,%d). Resetting closest.", sequence.Id(), pseq.Taxon(idx_path).String(), mini, closest[k])
} }
} else { } else {
closest[idx_path] = seq_len closest[idx_path] = seq_len
@ -167,7 +167,7 @@ func IndexSequence(seqidx int,
obitag_index := make(map[int]string, pseq.Len()) obitag_index := make(map[int]string, pseq.Len())
// log.Warnf("(%s,%s): %v", sequence.Id(), pseq.Taxon(0).String(), closest) // obilog.Warnf("(%s,%s): %v", sequence.Id(), pseq.Taxon(0).String(), closest)
for i, d := range closest { for i, d := range closest {
if i < (len(closest)-1) && d < closest[i+1] { if i < (len(closest)-1) && d < closest[i+1] {
current_taxon := pseq.Taxon(i) current_taxon := pseq.Taxon(i)

View File

@ -8,5 +8,5 @@ import (
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obiuniq command // the obiuniq command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
} }

View File

@ -26,7 +26,7 @@ func ScriptOptionSet(options *getoptions.GetOpt) {
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
ScriptOptionSet(options) ScriptOptionSet(options)
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
obigrep.SequenceSelectionOptionSet(options) obigrep.SequenceSelectionOptionSet(options)
} }

View File

@ -39,7 +39,7 @@ func SplitOptionSet(options *getoptions.GetOpt) {
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
SplitOptionSet(options) SplitOptionSet(options)
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
} }
func CLIHasConfig() bool { func CLIHasConfig() bool {

View File

@ -11,6 +11,7 @@ import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obikmer" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obikmer"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obilog"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obirefidx" "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obirefidx"
@ -260,7 +261,7 @@ func CLIAssignTaxonomy(iterator obiiter.IBioSequence,
if taxon != nil { if taxon != nil {
j++ j++
} else { } else {
log.Warnf("Taxid %s is not described in the taxonomy %s."+ obilog.Warnf("Taxid %s is not described in the taxonomy %s."+
" Sequence %s is discared from the reference database", " Sequence %s is discared from the reference database",
seq.Taxid(), taxo.Name(), seq.Id()) seq.Taxid(), taxo.Name(), seq.Id())
} }

View File

@ -41,7 +41,7 @@ func TagOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obiuniq command // the obiuniq command
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
TagOptionSet(options) TagOptionSet(options)
} }

View File

@ -45,13 +45,12 @@ func UniqueOptionSet(options *getoptions.GetOpt) {
} }
// OptionSet adds to the basic option set every options declared for // OptionSet adds to the basic option set every options declared for
// the obiuniq command // the obiuniq command
// //
// It takes a pointer to a GetOpt struct as its parameter and does not return anything. // It takes a pointer to a GetOpt struct as its parameter and does not return anything.
func OptionSet(options *getoptions.GetOpt) { func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options) obiconvert.OptionSet(false)(options)
UniqueOptionSet(options) UniqueOptionSet(options)
} }
@ -150,4 +149,4 @@ func CLINoSingleton() bool {
// noSingleton bool - The boolean value to set for _NoSingleton. // noSingleton bool - The boolean value to set for _NoSingleton.
func SetNoSingleton(noSingleton bool) { func SetNoSingleton(noSingleton bool) {
_NoSingleton = noSingleton _NoSingleton = noSingleton
} }