mirror of
https://github.com/metabarcoding/obitools4.git
synced 2025-12-08 16:50:27 +00:00
Adds to every obitools the ability to save in gzip compressed files
This commit is contained in:
@@ -25,6 +25,7 @@ var __output_fastobi_format__ = false
|
||||
var __output_solexa_quality__ = false
|
||||
|
||||
var __no_progress_bar__ = false
|
||||
var __compressed__ = false
|
||||
|
||||
func InputOptionSet(options *getoptions.GetOpt) {
|
||||
// options.IntVar(&__skipped_entries__, "skip", __skipped_entries__,
|
||||
@@ -72,6 +73,10 @@ func OutputOptionSet(options *getoptions.GetOpt) {
|
||||
options.BoolVar(&__no_progress_bar__, "no-progressbar", false,
|
||||
options.Description("Disable the progress bar printing"))
|
||||
|
||||
options.BoolVar(&__compressed__, "--compress", false,
|
||||
options.Alias("Z"),
|
||||
options.Description("Output is compressed"))
|
||||
|
||||
}
|
||||
|
||||
func OptionSet(options *getoptions.GetOpt) {
|
||||
@@ -110,6 +115,10 @@ func CLIOutputFormat() string {
|
||||
}
|
||||
}
|
||||
|
||||
func CLICompressed() bool {
|
||||
return __compressed__
|
||||
}
|
||||
|
||||
func CLIInputFastHeaderFormat() string {
|
||||
switch {
|
||||
case __input_fastjson_format__:
|
||||
|
||||
@@ -41,6 +41,8 @@ func CLIWriteBioSequences(iterator obiiter.IBioSequence,
|
||||
|
||||
opts = append(opts, obiformats.OptionsQualityShift(CLIOutputQualityShift()))
|
||||
|
||||
opts = append(opts, obiformats.OptionsCompressed(CLICompressed()))
|
||||
|
||||
var err error
|
||||
|
||||
if len(filenames) == 0 {
|
||||
|
||||
@@ -30,19 +30,13 @@ func DistributeSequence(sequences obiiter.IBioSequence) {
|
||||
nworkers = 2
|
||||
}
|
||||
|
||||
opts = append(opts, obiformats.OptionsParallelWorkers(nworkers))
|
||||
opts = append(opts, obiformats.OptionsBufferSize(obioptions.CLIBufferSize()))
|
||||
opts = append(opts, obiformats.OptionsBatchSize(obioptions.CLIBatchSize()))
|
||||
opts = append(opts, obiformats.OptionsParallelWorkers(nworkers),
|
||||
obiformats.OptionsBufferSize(obioptions.CLIBufferSize()),
|
||||
obiformats.OptionsBatchSize(obioptions.CLIBatchSize()),
|
||||
obiformats.OptionsQualityShift(obiconvert.CLIOutputQualityShift()),
|
||||
obiformats.OptionsAppendFile(CLIAppendSequences()),
|
||||
obiformats.OptionsCompressed(obiconvert.CLICompressed()))
|
||||
|
||||
opts = append(opts, obiformats.OptionsQualityShift(obiconvert.CLIOutputQualityShift()))
|
||||
|
||||
if CLIAppendSequences() {
|
||||
opts = append(opts, obiformats.OptionsAppendFile())
|
||||
}
|
||||
|
||||
if CLICompressed() {
|
||||
opts = append(opts, obiformats.OptionsCompressed())
|
||||
}
|
||||
var formater obiformats.SequenceBatchWriterToFile
|
||||
|
||||
switch obiconvert.CLIOutputFormat() {
|
||||
|
||||
@@ -18,7 +18,6 @@ var _BatchCount = 0
|
||||
var _HashSize = 0
|
||||
var _NAValue = "NA"
|
||||
var _append = false
|
||||
var _compressed = false
|
||||
|
||||
func DistributeOptionSet(options *getoptions.GetOpt) {
|
||||
options.StringVar(&_FilenamePattern, "pattern", _FilenamePattern,
|
||||
@@ -52,10 +51,6 @@ func DistributeOptionSet(options *getoptions.GetOpt) {
|
||||
options.Alias("A"),
|
||||
options.Description("Indicates to append sequence to files if they already exist."))
|
||||
|
||||
options.BoolVar(&_compressed, "--compress", false,
|
||||
options.Alias("Z"),
|
||||
options.Description("Output is compressed"))
|
||||
|
||||
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."))
|
||||
@@ -71,9 +66,6 @@ func CLIAppendSequences() bool {
|
||||
return _append
|
||||
}
|
||||
|
||||
func CLICompressed() bool {
|
||||
return _compressed
|
||||
}
|
||||
|
||||
func CLISequenceClassifier() *obiseq.BioSequenceClassifier {
|
||||
switch {
|
||||
|
||||
Reference in New Issue
Block a user