second version of obidistribute and a first buggy version of obiuniq

This commit is contained in:
2022-02-15 00:47:02 +01:00
parent b931321ba1
commit 3586ecc483
15 changed files with 402 additions and 21 deletions

View File

@ -1,6 +1,8 @@
package obiformats
import "git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
import (
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
)
type __options__ struct {
fastseq_header_parser obiseq.SeqAnnotator
@ -10,6 +12,7 @@ type __options__ struct {
batch_size int
quality_shift int
parallel_workers int
closefile bool
}
type Options struct {
@ -27,6 +30,7 @@ func MakeOptions(setters []WithOption) Options {
quality_shift: 33,
parallel_workers: 4,
batch_size: 5000,
closefile: false,
}
opt := Options{&o}
@ -66,6 +70,10 @@ func (opt Options) ProgressBar() bool {
return opt.pointer.with_progress_bar
}
func (opt Options) CloseFile() bool {
return opt.pointer.closefile
}
func OptionsBufferSize(size int) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.buffer_size = size
@ -74,6 +82,22 @@ func OptionsBufferSize(size int) WithOption {
return f
}
func OptionCloseFile() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.closefile = true
})
return f
}
func OptionDontCloseFile() WithOption {
f := WithOption(func(opt Options) {
opt.pointer.closefile = false
})
return f
}
// Allows to specify the ascii code corresponding to
// a quality of 0 in fastq encoded quality scores.
func OptionsQualityShift(shift int) WithOption {