mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-13 02:30:26 +00:00
refactoring of the file chunck writing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package obicsv
|
||||
|
||||
import (
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obioptions"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obitools/obiconvert"
|
||||
"git.metabarcoding.org/obitools/obitools4/obitools4/pkg/obiutils"
|
||||
"github.com/DavidGamba/go-getoptions"
|
||||
@@ -66,6 +67,7 @@ func CSVOptionSet(options *getoptions.GetOpt) {
|
||||
func OptionSet(options *getoptions.GetOpt) {
|
||||
obiconvert.InputOptionSet(options)
|
||||
obiconvert.OutputModeOptionSet(options)
|
||||
obioptions.LoadTaxonomyOptionSet(options, false, false)
|
||||
CSVOptionSet(options)
|
||||
}
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ func NewCSVSequenceIterator(iter obiiter.IBioSequence, options ...WithOption) *I
|
||||
if len(batch.Slice()) == 0 {
|
||||
log.Panicf("first batch should not be empty")
|
||||
}
|
||||
auto_slot := batch.Slice().AttributeKeys(true).Members()
|
||||
auto_slot := batch.Slice().AttributeKeys(true, true).Members()
|
||||
slices.Sort(auto_slot)
|
||||
CSVKeys(auto_slot)(opt)
|
||||
iter.PushBack()
|
||||
|
||||
@@ -55,7 +55,7 @@ func WriteCSV(iterator *ICSVRecord,
|
||||
|
||||
nwriters := opt.ParallelWorkers()
|
||||
|
||||
chunkchan := obiformats.WriteSeqFileChunk(file, opt.CloseFile())
|
||||
chunkchan := obiformats.WriteFileChunk(file, opt.CloseFile())
|
||||
|
||||
newIter.Add(nwriters)
|
||||
|
||||
@@ -72,7 +72,7 @@ func WriteCSV(iterator *ICSVRecord,
|
||||
|
||||
log.Debugf("Formating CSV chunk %d", batch.Order())
|
||||
|
||||
ss := obiformats.SeqFileChunk{
|
||||
ss := obiformats.FileChunk{
|
||||
Source: batch.Source(),
|
||||
Raw: FormatCVSBatch(
|
||||
batch,
|
||||
|
||||
Reference in New Issue
Block a user