Normalise the managment of speed measure

This commit is contained in:
2023-02-16 13:31:49 +01:00
parent f56363a100
commit 6e36b22040
17 changed files with 48 additions and 17 deletions

View File

@ -24,6 +24,8 @@ var __output_fastjson_format__ = false
var __output_fastobi_format__ = false
var __output_solexa_quality__ = false
var __no_progress_bar__ = false
func InputOptionSet(options *getoptions.GetOpt) {
// options.IntVar(&__skipped_entries__, "skip", __skipped_entries__,
// options.Description("The N first sequence records of the file are discarded from the analysis and not reported to the output file."))
@ -67,8 +69,8 @@ func OutputOptionSet(options *getoptions.GetOpt) {
options.Alias("O"),
options.Description("output FASTA/FASTQ title line annotations follow OBI format."))
options.BoolVar(&__output_solexa_quality__, "solexa-output", false,
options.Description("Encodes quality string according to the Solexa specification."))
options.BoolVar(&__no_progress_bar__, "no-progressbar", false,
options.Description("Disable the progress bar printing"))
}
func OptionSet(options *getoptions.GetOpt) {
@ -154,3 +156,7 @@ func CLIOutputQualityShift() int {
return 33
}
}
func CLIProgressBar() bool {
return !__no_progress_bar__
}

View File

@ -8,9 +8,12 @@ import (
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obioptions"
)
func WriteBioSequences(iterator obiiter.IBioSequence,
func CLIWriteBioSequences(iterator obiiter.IBioSequence,
terminalAction bool, filenames ...string) (obiiter.IBioSequence, error) {
if CLIProgressBar() {
iterator = iterator.Speed()
}
var newIter obiiter.IBioSequence
opts := make([]obiformats.WithOption, 0, 10)

View File

@ -22,7 +22,7 @@ func IFilterSequence(iterator obiiter.IBioSequence) obiiter.IBioSequence {
obioptions.CLIBatchSize())
go func() {
_, err := obiconvert.WriteBioSequences(discarded,
_, err := obiconvert.CLIWriteBioSequences(discarded,
true,
CLIDiscardedFileName())

View File

@ -44,7 +44,7 @@ func IExtractBarcode(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error
obioptions.CLIBatchSize())
go func() {
_, err := obiconvert.WriteBioSequences(unidentified,
_, err := obiconvert.CLIWriteBioSequences(unidentified,
true,
CLIUnidentifiedFileName())

View File

@ -192,5 +192,5 @@ func AssignTaxonomy(iterator obiiter.IBioSequence) obiiter.IBioSequence {
worker := IdentifySeqWorker(references, refcounts, taxo, CLIRunExact())
return iterator.Rebatch(17).MakeIWorker(worker, obioptions.CLIParallelWorkers(), 0).Speed("Annotated sequences").Rebatch(1000)
return iterator.Rebatch(17).MakeIWorker(worker, obioptions.CLIParallelWorkers(), 0).Rebatch(1000)
}