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
+1 -1
View File
@@ -322,7 +322,7 @@ func CLIAnnotationWorker() obiseq.SeqWorker {
if CLIHasCut() {
from, to := CLICut()
w := CutSequenceWorker(from, to, false)
w := CutSequenceWorker(from, to, true)
annotator = annotator.ChainWorkers(w)
}
+1 -1
View File
@@ -130,7 +130,7 @@ func SequenceAnnotationOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obipcr command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
obigrep.SequenceSelectionOptionSet(options)
SequenceAnnotationOptionSet(options)
}
+1 -1
View File
@@ -53,7 +53,7 @@ func commonSuffix(a, b *obiseq.BioSequence) int {
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.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
}
+4 -4
View File
@@ -113,10 +113,10 @@ func MakeSequenceFamilyGenusWorker(references obiseq.BioSequenceSlice) obiseq.Se
}
// level, _ := sequence.GetAttribute("obicleandb_level")
// log.Warnf("%s - level: %v", sequence.Id(), level)
// log.Warnf("%s - gdist: %v", sequence.Id(), indist)
// log.Warnf("%s - fdist: %v", sequence.Id(), outdist)
// log.Warnf("%s - pval: %f", sequence.Id(), pval)
// obilog.Warnf("%s - level: %v", sequence.Id(), level)
// obilog.Warnf("%s - gdist: %v", sequence.Id(), indist)
// obilog.Warnf("%s - fdist: %v", sequence.Id(), outdist)
// obilog.Warnf("%s - pval: %f", sequence.Id(), pval)
}
if pval < 0.0 {
+10 -5
View File
@@ -126,11 +126,16 @@ func PairedFilesOptionSet(options *getoptions.GetOpt) {
)
}
func OptionSet(options *getoptions.GetOpt) {
obioptions.LoadTaxonomyOptionSet(options, false, false)
InputOptionSet(options)
OutputOptionSet(options)
PairedFilesOptionSet(options)
func OptionSet(allow_paired bool) func(options *getoptions.GetOpt) {
f := func(options *getoptions.GetOpt) {
obioptions.LoadTaxonomyOptionSet(options, false, false)
InputOptionSet(options)
OutputOptionSet(options)
if allow_paired {
PairedFilesOptionSet(options)
}
}
return f
}
// Returns true if the number of reads described in the
+1 -1
View File
@@ -17,7 +17,7 @@ func DemergeOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obipcr command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
DemergeOptionSet(options)
}
+1 -1
View File
@@ -166,7 +166,7 @@ func SequenceSelectionOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obipcr command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(true)(options)
SequenceSelectionOptionSet(options)
options.StringVar(&_SaveRejected, "save-discarded", _SaveRejected,
+1 -1
View File
@@ -46,7 +46,7 @@ func JoinOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obipcr command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
JoinOptionSet(options)
}
+2 -2
View File
@@ -76,12 +76,12 @@ func KmerSimMatchOptionSet(options *getoptions.GetOpt) {
}
func CountOptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
KmerSimCountOptionSet(options)
}
func MatchOptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
KmerSimCountOptionSet(options)
KmerSimMatchOptionSet(options)
}
+1 -1
View File
@@ -49,7 +49,7 @@ func MicroSatelliteOptionSet(options *getoptions.GetOpt) {
}
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
MicroSatelliteOptionSet(options)
}
+1 -1
View File
@@ -54,7 +54,7 @@ func MultiplexOptionSet(options *getoptions.GetOpt) {
}
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
MultiplexOptionSet(options)
}
+1 -1
View File
@@ -67,7 +67,7 @@ func PCROptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obipcr command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
PCROptionSet(options)
}
+5 -5
View File
@@ -88,7 +88,7 @@ func IndexSequence(seqidx int,
// Initialize a matrix to store alignment scores
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++ {
mini := -1
seqidcs := refs[pseq.Taxon(idx_path).Node]
@@ -144,8 +144,8 @@ func IndexSequence(seqidx int,
}
if mini == 0 {
// log.Warnf("%s: %s", sequence.Id(), sequence.String())
// log.Warnf("%s: %s", suject.Id(), suject.String())
// obilog.Warnf("%s: %s", sequence.Id(), sequence.String())
// obilog.Warnf("%s: %s", suject.Id(), suject.String())
break
}
}
@@ -158,7 +158,7 @@ func IndexSequence(seqidx int,
// insure than closest is strictly increasing
for k := idx_path - 1; k >= 0 && mini < closest[k]; k-- {
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 {
closest[idx_path] = seq_len
@@ -167,7 +167,7 @@ func IndexSequence(seqidx int,
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 {
if i < (len(closest)-1) && d < closest[i+1] {
current_taxon := pseq.Taxon(i)
+1 -1
View File
@@ -8,5 +8,5 @@ import (
// OptionSet adds to the basic option set every options declared for
// the obiuniq command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
}
+1 -1
View File
@@ -26,7 +26,7 @@ func ScriptOptionSet(options *getoptions.GetOpt) {
func OptionSet(options *getoptions.GetOpt) {
ScriptOptionSet(options)
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
obigrep.SequenceSelectionOptionSet(options)
}
+1 -1
View File
@@ -39,7 +39,7 @@ func SplitOptionSet(options *getoptions.GetOpt) {
func OptionSet(options *getoptions.GetOpt) {
SplitOptionSet(options)
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
}
func CLIHasConfig() bool {
+2 -1
View File
@@ -11,6 +11,7 @@ import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"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/obitax"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obirefidx"
@@ -260,7 +261,7 @@ func CLIAssignTaxonomy(iterator obiiter.IBioSequence,
if taxon != nil {
j++
} 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",
seq.Taxid(), taxo.Name(), seq.Id())
}
+1 -1
View File
@@ -41,7 +41,7 @@ func TagOptionSet(options *getoptions.GetOpt) {
// OptionSet adds to the basic option set every options declared for
// the obiuniq command
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
TagOptionSet(options)
}
+2 -3
View File
@@ -45,13 +45,12 @@ func UniqueOptionSet(options *getoptions.GetOpt) {
}
// OptionSet adds to the basic option set every options declared for
// the obiuniq command
//
// It takes a pointer to a GetOpt struct as its parameter and does not return anything.
func OptionSet(options *getoptions.GetOpt) {
obiconvert.OptionSet(options)
obiconvert.OptionSet(false)(options)
UniqueOptionSet(options)
}
@@ -150,4 +149,4 @@ func CLINoSingleton() bool {
// noSingleton bool - The boolean value to set for _NoSingleton.
func SetNoSingleton(noSingleton bool) {
_NoSingleton = noSingleton
}
}