Patch a bug in fasta and fastq reading

Former-commit-id: bcaa264b4c4a7c67617eb909b199176bf09913db
This commit is contained in:
Eric Coissac
2024-06-21 14:28:57 +02:00
parent 818ce87bab
commit 54a138196c
9 changed files with 85 additions and 44 deletions

View File

@ -1,9 +1,12 @@
package obichunk
import "git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
import (
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiseq"
)
type __options__ struct {
statsOn []string
statsOn obiseq.StatsOnDescriptions
categories []string
navalue string
cacheOnDisk bool
@ -21,7 +24,7 @@ type WithOption func(Options)
func MakeOptions(setters []WithOption) Options {
o := __options__{
statsOn: make([]string, 0, 100),
statsOn: make(obiseq.StatsOnDescriptions, 10),
categories: make([]string, 0, 100),
navalue: "NA",
cacheOnDisk: false,
@ -53,7 +56,7 @@ func (opt Options) PopCategories() string {
return ""
}
func (opt Options) StatsOn() []string {
func (opt Options) StatsOn() obiseq.StatsOnDescriptions {
return opt.pointer.statsOn
}
@ -114,7 +117,10 @@ func OptionNAValue(na string) WithOption {
func OptionStatOn(keys ...string) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.statsOn = append(opt.pointer.categories, keys...)
for _, k := range keys {
d := obiseq.MakeStatsOnDescription(k)
opt.pointer.statsOn[d.Name] = d
}
})
return f