change the model for representing paired reads and extend its usage to other commands

This commit is contained in:
2023-02-23 23:35:58 +01:00
parent ebb05fcdf7
commit 072b85e155
23 changed files with 598 additions and 338 deletions

View File

@ -15,6 +15,11 @@ type __options__ struct {
closefile bool
appendfile bool
compressed bool
csv_ids bool
cvs_sequence bool
csv_definition bool
csv_separator string
paired_filename string
}
type Options struct {
@ -35,6 +40,11 @@ func MakeOptions(setters []WithOption) Options {
closefile: false,
appendfile: false,
compressed: false,
csv_ids: true,
csv_definition: false,
cvs_sequence: true,
csv_separator: ",",
paired_filename: "",
}
opt := Options{&o}
@ -86,6 +96,18 @@ func (opt Options) CompressedFile() bool {
return opt.pointer.compressed
}
func (opt Options) CSVIds() bool {
return opt.pointer.csv_ids
}
func (opt Options) HaveToSavePaired() bool {
return opt.pointer.paired_filename != ""
}
func (opt Options) PairedFileName() string {
return opt.pointer.paired_filename
}
func OptionsBufferSize(size int) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.buffer_size = size
@ -216,3 +238,12 @@ func OptionsWithoutProgressBar() WithOption {
return f
}
func WritePairedReadsTo(filename string) WithOption {
f := WithOption(func(opt Options) {
opt.pointer.paired_filename = filename
})
return f
}