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

@@ -213,7 +213,7 @@ func _ParseFastaFile(
for chunks := range input {
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 {
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 {
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)
state := 0
restart := imax - 1
@@ -74,7 +74,7 @@ func EndOfLastFastqEntry(buffer []byte) int {
state = 3
} else {
// 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
i = restart
}
@@ -101,7 +101,7 @@ func EndOfLastFastqEntry(buffer []byte) int {
// log.Warn("====> End of the last sequence")
state = 7
} 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
}
}

View File

@@ -12,6 +12,7 @@ import (
log "github.com/sirupsen/logrus"
"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/obiutils"
)
@@ -106,7 +107,7 @@ func FormatFastaBatch(batch obiiter.BioSequenceBatch, formater FormatHeader, ski
// Handle empty sequences
if skipEmpty {
// 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 {
// Terminate the program if skipEmpty is false
log.Fatalf("Sequence %s is empty", seq.Id())

View File

@@ -9,6 +9,7 @@ import (
log "github.com/sirupsen/logrus"
"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/obiutils"
)
@@ -75,7 +76,7 @@ func FormatFastqBatch(batch obiiter.BioSequenceBatch,
} else {
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 {
log.Fatalf("Sequence %s is empty", seq.Id())
}

View File

@@ -172,7 +172,7 @@ func ReadFileChunk(
} else {
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()
@@ -204,7 +204,7 @@ func ReadFileChunk(
}
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)
i++
}

View File

@@ -13,6 +13,7 @@ import (
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/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
@@ -663,7 +664,7 @@ func ReadCSVNGSFilter(reader io.Reader) (*obingslibrary.NGSLibrary, error) {
if ok {
setparam(&ngsfilter, data...)
} 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)
}
}