adds a directory option to obidistribute

This commit is contained in:
2023-02-17 22:52:53 +01:00
parent 9554a32490
commit d04eb915b3
6 changed files with 136 additions and 16 deletions

View File

@@ -13,13 +13,13 @@ import (
var _FilenamePattern = ""
var _SequenceClassifierTag = ""
var _DirectoryTag = ""
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,
options.Alias("p"),
@@ -30,10 +30,17 @@ func DistributeOptionSet(options *getoptions.GetOpt) {
options.StringVar(&_SequenceClassifierTag, "classifier", _SequenceClassifierTag,
options.Alias("c"),
options.Description("The name of a tag annotating thes sequences. "+
options.Description("The name of a tag annotating the sequences. "+
"The name must corresponds to a string, a integer or a boolean value. "+
"That value will be used to dispatch sequences amoong the different files"))
options.StringVar(&_DirectoryTag, "directory", _DirectoryTag,
options.Alias("d"),
options.Description("The name of a tag annotating the sequences. "+
"The name must corresponds to a string, a integer or a boolean value. "+
"That value will be used to dispatch sequences amoong the different directory " +
"in conjunction with the -c|--classifier options"))
options.StringVar(&_NAValue, "na-value", _NAValue,
options.Description("Value used when the classifier tag is not defined for a sequence."))
@@ -71,7 +78,7 @@ func CLICompressed() bool {
func CLISequenceClassifier() *obiseq.BioSequenceClassifier {
switch {
case _SequenceClassifierTag != "":
return obiseq.AnnotationClassifier(_SequenceClassifierTag, _NAValue)
return obiseq.DualAnnotationClassifier(_SequenceClassifierTag,_DirectoryTag, _NAValue)
case _BatchCount > 0:
return obiseq.RotateClassifier(_BatchCount)
case _HashSize > 0: