mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Adds the possiblility to append to files to obidistribute
This commit is contained in:
@@ -36,6 +36,10 @@ func DistributeSequence(sequences obiiter.IBioSequence) {
|
||||
|
||||
opts = append(opts, obiformats.OptionsQualityShift(obiconvert.CLIOutputQualityShift()))
|
||||
|
||||
if CLIAppendSequences() {
|
||||
opts = append(opts, obiformats.OptionsAppendFile())
|
||||
}
|
||||
|
||||
var formater obiformats.SequenceBatchWriterToFile
|
||||
|
||||
switch obiconvert.CLIOutputFormat() {
|
||||
|
||||
@@ -2,9 +2,10 @@ package obidistribute
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obiseq"
|
||||
"git.metabarcoding.org/lecasofts/go/obitools/pkg/obitools/obiconvert"
|
||||
"github.com/DavidGamba/go-getoptions"
|
||||
@@ -15,6 +16,7 @@ var _SequenceClassifierTag = ""
|
||||
var _BatchCount = 0
|
||||
var _HashSize = 0
|
||||
var _NAValue = "NA"
|
||||
var _append = false
|
||||
|
||||
func DistributeOptionSet(options *getoptions.GetOpt) {
|
||||
options.StringVar(&_FilenamePattern, "pattern", _FilenamePattern,
|
||||
@@ -37,6 +39,10 @@ func DistributeOptionSet(options *getoptions.GetOpt) {
|
||||
options.Alias("n"),
|
||||
options.Description("Indicates in how many batches the input file must bee splitted."))
|
||||
|
||||
options.BoolVar(&_append, "append", _append,
|
||||
options.Alias("A"),
|
||||
options.Description("Indicates to append sequence to files if they already exist."))
|
||||
|
||||
options.IntVar(&_HashSize, "hash", 0,
|
||||
options.Alias("H"),
|
||||
options.Description("Indicates to split the input into at most <n> batch based on a hash code of the seequence."))
|
||||
@@ -48,6 +54,10 @@ func OptionSet(options *getoptions.GetOpt) {
|
||||
DistributeOptionSet(options)
|
||||
}
|
||||
|
||||
func CLIAppendSequences() bool {
|
||||
return _append
|
||||
}
|
||||
|
||||
func CLISequenceClassifier() *obiseq.BioSequenceClassifier {
|
||||
switch {
|
||||
case _SequenceClassifierTag != "":
|
||||
|
||||
Reference in New Issue
Block a user