Adds the notioon of NA value

This commit is contained in:
2022-02-18 10:00:42 +01:00
parent aef546dae3
commit 6067b92e2f
4 changed files with 61 additions and 108 deletions

View File

@@ -14,6 +14,7 @@ var _FilenamePattern = ""
var _SequenceClassifierTag = ""
var _BatchCount = 0
var _HashSize = 0
var _NAValue = "NA"
func DistributeOptionSet(options *getoptions.GetOpt) {
options.StringVar(&_FilenamePattern, "pattern", _FilenamePattern,
@@ -29,6 +30,9 @@ func DistributeOptionSet(options *getoptions.GetOpt) {
"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(&_NAValue, "na-value", _NAValue,
options.Description("Value used when the classifier tag is not defined for a sequence."))
options.IntVar(&_BatchCount, "batches", 0,
options.Alias("n"),
options.Description("Indicates in how many batches the input file must bee splitted."))
@@ -44,10 +48,10 @@ func OptionSet(options *getoptions.GetOpt) {
DistributeOptionSet(options)
}
func CLISequenceClassifier() obiseq.SequenceClassifier {
func CLISequenceClassifier() obiseq.BioSequenceClassifier {
switch {
case _SequenceClassifierTag != "":
return obiseq.AnnotationClassifier(_SequenceClassifierTag)
return obiseq.AnnotationClassifier(_SequenceClassifierTag, _NAValue)
case _BatchCount > 0:
return obiseq.RotateClassifier(_BatchCount)
case _HashSize > 0:
@@ -66,3 +70,7 @@ func CLIFileNamePattern() string {
return _FilenamePattern
}
func CLINAValue() string {
return _NAValue
}