Add capacity to obidistribute to save gzipped files

This commit is contained in:
2023-02-17 12:52:19 +01:00
parent 6fd426d8be
commit 9554a32490
9 changed files with 124 additions and 30 deletions

View File

@@ -71,6 +71,7 @@ func OutputOptionSet(options *getoptions.GetOpt) {
options.BoolVar(&__no_progress_bar__, "no-progressbar", false,
options.Description("Disable the progress bar printing"))
}
func OptionSet(options *getoptions.GetOpt) {

View File

@@ -40,6 +40,9 @@ func DistributeSequence(sequences obiiter.IBioSequence) {
opts = append(opts, obiformats.OptionsAppendFile())
}
if CLICompressed() {
opts = append(opts, obiformats.OptionsCompressed())
}
var formater obiformats.SequenceBatchWriterToFile
switch obiconvert.CLIOutputFormat() {

View File

@@ -17,6 +17,8 @@ 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,
@@ -43,6 +45,10 @@ 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."))
@@ -58,6 +64,10 @@ func CLIAppendSequences() bool {
return _append
}
func CLICompressed() bool {
return _compressed
}
func CLISequenceClassifier() *obiseq.BioSequenceClassifier {
switch {
case _SequenceClassifierTag != "":