move the worker class to the obiseq package

This commit is contained in:
2023-01-22 22:39:13 +01:00
parent f97f92df72
commit 2d375df94f
12 changed files with 153 additions and 43 deletions

View File

@@ -18,7 +18,7 @@ func ParseGuessedFastSeqHeader(sequence *obiseq.BioSequence) {
func IParseFastSeqHeaderBatch(iterator obiiter.IBioSequence,
options ...WithOption) obiiter.IBioSequence {
opt := MakeOptions(options)
return iterator.MakeIWorker(obiiter.AnnotatorToSeqWorker(opt.ParseFastSeqHeader()),
return iterator.MakeIWorker(obiseq.AnnotatorToSeqWorker(opt.ParseFastSeqHeader()),
opt.ParallelWorkers(),
opt.BufferSize())
}

View File

@@ -1,12 +1,11 @@
package obiformats
import (
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiiter"
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
)
type __options__ struct {
fastseq_header_parser obiiter.SeqAnnotator
fastseq_header_parser obiseq.SeqAnnotator
fastseq_header_writer func(*obiseq.BioSequence) string
with_progress_bar bool
buffer_size int
@@ -59,7 +58,7 @@ func (opt Options) ParallelWorkers() int {
return opt.pointer.parallel_workers
}
func (opt Options) ParseFastSeqHeader() obiiter.SeqAnnotator {
func (opt Options) ParseFastSeqHeader() obiseq.SeqAnnotator {
return opt.pointer.fastseq_header_parser
}
@@ -124,7 +123,7 @@ func OptionsQualitySolexa() WithOption {
return OptionsQualityShift(64)
}
func OptionsFastSeqHeaderParser(parser obiiter.SeqAnnotator) WithOption {
func OptionsFastSeqHeaderParser(parser obiseq.SeqAnnotator) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.fastseq_header_parser = parser
})