mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-10 17:50:26 +00:00
Simplify the workers code by removing dupplicates
Former-commit-id: 638fcf8d88dd93755d1ec89c8fe92f6ed3f733df
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package obiconvert
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
@@ -93,6 +95,15 @@ func CLIWriteBioSequences(iterator obiiter.IBioSequence,
|
||||
newIter, err = obiformats.WriteSequencesToFile(iterator, fn, opts...)
|
||||
}
|
||||
} else {
|
||||
log.Info("Output is done on stdout")
|
||||
var s fs.FileInfo
|
||||
s, err = os.Stdout.Stat()
|
||||
if err != nil {
|
||||
return obiiter.NilIBioSequence, err
|
||||
}
|
||||
|
||||
log.Infof("Data is writen to %s", s.Name())
|
||||
|
||||
opts = append(opts, obiformats.OptionsSkipEmptySequence(CLISkipEmpty()))
|
||||
switch CLIOutputFormat() {
|
||||
case "fastq":
|
||||
|
||||
@@ -60,5 +60,5 @@ func CLIPCR(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error) {
|
||||
iterator = iterator.Pipe(frags)
|
||||
}
|
||||
|
||||
return iterator.MakeISliceWorker(worker, false, obioptions.CLIParallelWorkers(), 0), nil
|
||||
return iterator.MakeISliceWorker(worker, false, obioptions.CLIParallelWorkers()), nil
|
||||
}
|
||||
|
||||
@@ -293,7 +293,9 @@ func CLIAssignTaxonomy(iterator obiiter.IBioSequence,
|
||||
if err == nil {
|
||||
j++
|
||||
} else {
|
||||
log.Warnf("Taxid %d is not described in the taxonomy. Sequence %s is discared from the reference database", seq.Taxid(), seq.Id())
|
||||
log.Warnf("Taxid %d is not described in the taxonomy."+
|
||||
" Sequence %s is discared from the reference database",
|
||||
seq.Taxid(), seq.Id())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user