introduce obidefault

This commit is contained in:
Eric Coissac
2025-01-27 17:12:45 +01:00
parent 0a567f621c
commit 7c4042df6b
69 changed files with 505 additions and 479 deletions

View File

@@ -3,9 +3,9 @@ package obimultiplex
import (
log "github.com/sirupsen/logrus"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obidefault"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiiter"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obingslibrary"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
)
@@ -19,8 +19,8 @@ func IExtractBarcode(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error
obingslibrary.OptionAllowedIndel(CLIAllowsIndel()),
obingslibrary.OptionUnidentified(CLIUnidentifiedFileName()),
obingslibrary.OptionDiscardErrors(!CLIConservedErrors()),
obingslibrary.OptionParallelWorkers(obioptions.CLIParallelWorkers()),
obingslibrary.OptionBatchSize(obioptions.CLIBatchSize()),
obingslibrary.OptionParallelWorkers(obidefault.ParallelWorkers()),
obingslibrary.OptionBatchSize(obidefault.BatchSize()),
)
ngsfilter, err := CLINGSFIlter()
@@ -35,14 +35,14 @@ func IExtractBarcode(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error
if !CLIConservedErrors() {
log.Infoln("Discards unassigned sequences")
out = out.FilterOn(obiseq.HasAttribute("obimultiplex_error").Not(), obioptions.CLIBatchSize())
out = out.FilterOn(obiseq.HasAttribute("obimultiplex_error").Not(), obidefault.BatchSize())
}
var unidentified obiiter.IBioSequence
if CLIUnidentifiedFileName() != "" {
log.Printf("Unassigned sequences saved in file: %s\n", CLIUnidentifiedFileName())
unidentified, out = newIter.DivideOn(obiseq.HasAttribute("obimultiplex_error"),
obioptions.CLIBatchSize())
obidefault.BatchSize())
go func() {
_, err := obiconvert.CLIWriteBioSequences(unidentified,
@@ -55,7 +55,7 @@ func IExtractBarcode(iterator obiiter.IBioSequence) (obiiter.IBioSequence, error
}()
}
log.Printf("Sequence demultiplexing using %d workers\n", obioptions.CLIParallelWorkers())
log.Printf("Sequence demultiplexing using %d workers\n", obidefault.ParallelWorkers())
return out, nil
}